~ubuntu-branches/ubuntu/oneiric/x11-xserver-utils/oneiric

« back to all changes in this revision

Viewing changes to xvidtune/xvidtune.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker
  • Date: 2010-08-09 10:24:12 UTC
  • mfrom: (5.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100809102412-3j7ifv5scdrd5f8m
Tags: 7.5+2ubuntu1
* Merge from debian unstable. Remaining Ubuntu changes:
  - 101_xset_spellfix.patch: Spelling fix in help docs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#include <stdlib.h>
50
50
#include <signal.h>
51
51
 
52
 
int MajorVersion, MinorVersion;
53
 
int EventBase, ErrorBase;
54
 
int dot_clock, mode_flags;
55
 
unsigned long    TestTimeout=5000;  /* Default test timeout */
56
 
XtSignalId sigId;
 
52
static int MajorVersion, MinorVersion;
 
53
static int EventBase, ErrorBase;
 
54
static int dot_clock, mode_flags;
 
55
static unsigned long TestTimeout=5000;  /* Default test timeout */
 
56
static XtSignalId sigId;
57
57
 
58
58
/* Minimum extension version required */
59
59
#define MINMAJOR 0
370
370
         XtVaSetValues(auto_apply_toggle, XtNstate, 0, NULL);
371
371
 
372
372
      if (i == Flags)
373
 
         (void) sprintf (buf, "%04x", sdp->val);
 
373
         (void) snprintf (buf, sizeof(buf), "%04x", sdp->val);
374
374
      else if (i >= PixelClock && i <= VSyncRate)
375
 
         (void) sprintf (buf, "%6.2f", (float)sdp->val / 1000.0);
 
375
         (void) snprintf (buf, sizeof(buf), "%6.2f", (float)sdp->val / 1000.0);
376
376
      else if (i == BlankDelay1 || i == BlankDelay2) {
377
 
         (void) sprintf (buf, "%d", sdp->val);
 
377
         (void) snprintf (buf, sizeof(buf), "%d", sdp->val);
378
378
      } else
379
 
         (void) sprintf (buf, "%5d", sdp->val);
 
379
         (void) snprintf (buf, sizeof(buf), "%5d", sdp->val);
380
380
         
381
381
      sdp->lastpercent = -1;
382
382
      if (i == Flags) {
532
532
    Time time;
533
533
    char tmpbuf[16];
534
534
 
535
 
    sprintf(tmpbuf, "\"%dx%d\"",
 
535
    snprintf(tmpbuf, sizeof(tmpbuf), "\"%dx%d\"",
536
536
           AppRes.field[HDisplay].val, AppRes.field[VDisplay].val);
537
 
    sprintf(modebuf, "%-11s   %6.2f   %4d %4d %4d %4d   %4d %4d %4d %4d",
 
537
    snprintf(modebuf, sizeof(modebuf),
 
538
           "%-11s   %6.2f   %4d %4d %4d %4d   %4d %4d %4d %4d",
538
539
           tmpbuf, (float)dot_clock/1000.0,
539
540
           AppRes.field[HDisplay].val,
540
541
           AppRes.field[HSyncStart].val,
724
725
        char tmp[6];
725
726
 
726
727
        if (current < lower) {
727
 
            (void) sprintf (tmp, "%5d", lower);
 
728
            (void) snprintf (tmp, sizeof(tmp), "%5d", lower);
728
729
            current = lower;
729
730
        } else {
730
 
            (void) sprintf (tmp, "%5d", upper);
 
731
            (void) snprintf (tmp, sizeof(tmp), "%5d", upper);
731
732
            current = upper;
732
733
        }
733
734
        text.firstPos = 0;
911
912
        sdp->val = isValid(tmp_val, fieldindex);
912
913
        
913
914
        sdp->lastpercent = ipercent;
914
 
        (void) sprintf (buf, "%5d", sdp->val);
 
915
        (void) snprintf (buf, sizeof(buf), "%5d", sdp->val);
915
916
        XtVaSetValues (sdp->textwidget, XtNlabel, buf, NULL);
916
917
        if (sdp->val != tmp_val) {
917
918
            int base;
965
966
 
966
967
    wids[0] = XtCreateWidget (w1name, labelWidgetClass, form, NULL, 0);
967
968
    if (findex >= PixelClock && findex <= VSyncRate)
968
 
        (void) sprintf(buf, "%6.2f", (float)AppRes.field[findex].val / 1000.0);
 
969
        (void) snprintf(buf, sizeof(buf), "%6.2f",
 
970
                        (float)AppRes.field[findex].val / 1000.0);
969
971
    else
970
 
        (void) sprintf (buf, "%5d", AppRes.field[findex].val);
 
972
        (void) snprintf (buf, sizeof(buf), "%5d", AppRes.field[findex].val);
971
973
    wids[1] = XtVaCreateWidget (w2name, labelWidgetClass,
972
974
                form, XtNlabel, buf, NULL);
973
975
    if (w3name != NULL) {
1216
1218
                                     NULL);
1217
1219
    XtAddCallback (w, XtNcallback, AdjustCB, (XtPointer)-VTotal);
1218
1220
 
1219
 
    (void) sprintf (buf, "%04x", AppRes.field[Flags].val);
 
1221
    (void) snprintf (buf, sizeof(buf), "%04x", AppRes.field[Flags].val);
1220
1222
    wids[0] = XtCreateWidget ("Flags-label", labelWidgetClass,
1221
1223
                forms[8], NULL, 0);
1222
1224
    wids[1] = XtVaCreateWidget ("Flags-text", asciiTextWidgetClass,
1293
1295
                                   s3form, NULL);
1294
1296
        XtAddCallback (wids[3], XtNcallback, ChangeBlankCB,
1295
1297
                        (XtPointer)-BlankDelay1);
1296
 
        (void) sprintf (buf, "%d", AppRes.field[BlankDelay1].val);
 
1298
        (void) snprintf (buf, sizeof(buf), "%d", AppRes.field[BlankDelay1].val);
1297
1299
        wids[4] = XtVaCreateWidget("Blank1-text", asciiTextWidgetClass,
1298
1300
                        s3form, XtNstring, buf, XtNtranslations, trans, NULL);
1299
1301
        AddCallback(wids[4], XtNcallback, BlankEditCB, (XPointer) BlankDelay1);
1309
1311
                                   s3form, NULL);
1310
1312
        XtAddCallback (wids[7], XtNcallback, ChangeBlankCB,
1311
1313
                        (XtPointer)-BlankDelay2);
1312
 
        (void) sprintf (buf, "%d", AppRes.field[BlankDelay2].val);
 
1314
        (void) snprintf (buf, sizeof(buf), "%d", AppRes.field[BlankDelay2].val);
1313
1315
        wids[8] = XtVaCreateWidget("Blank2-text", asciiTextWidgetClass,
1314
1316
                        s3form, XtNstring, buf, XtNtranslations, trans, NULL);
1315
1317
        AddCallback(wids[8], XtNcallback, BlankEditCB, (XPointer) BlankDelay2);
1629
1631
        <Btn1Down>: select-start()\n");
1630
1632
 
1631
1633
    if (!ModeSettable()) {
1632
 
        printf("Video are not settable on this chip\n");
 
1634
        printf("Video modes are not settable on this chip\n");
1633
1635
        displayNoTune(top);
1634
1636
        modeSettable = FALSE;
1635
1637
    } else