diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:49:11 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:49:11 +0000 |
commit | b01f39a8e6eadd35758fe4301e019b66f238917d (patch) | |
tree | 82ffbfb4d920bed078bcd77ebea90f0f2c7ff26e /testfrac.c | |
parent | 82a6e01af6c39e22855495b912c23efddfb17224 (diff) |
merge latest (4.3.99.16) from XFree86 (vendor) branchXORG-RELEASE-1-BASEXEVIE-MERGEXEVIE-BASEXINERAMA_2XEVIE
Diffstat (limited to 'testfrac.c')
-rw-r--r-- | testfrac.c | 35 |
1 files changed, 10 insertions, 25 deletions
@@ -4,7 +4,7 @@ ** How to make a widget to choose the fraction of tests to be run. ** */ -/* $XFree86: xc/programs/xgc/testfrac.c,v 1.3 2000/02/17 14:00:37 dawes Exp $ */ +/* $XFree86: xc/programs/xgc/testfrac.c,v 1.5 2003/09/13 21:33:11 dawes Exp $ */ #include <stdio.h> #include <X11/Intrinsic.h> @@ -14,10 +14,6 @@ #include <X11/Xaw/Scrollbar.h> #include "xgc.h" -extern void interpret(); - -extern XtAppContext appcontext; - #define SCROLLBAR_LENGTH 125 #define SLIDER_LENGTH 0.2 /* proportion of scrollbar taken up by the slider */ @@ -39,10 +35,7 @@ static int oldpercent = -1; /* so we only update when the slider has /*ARGSUSED*/ static void -slider_jump(w, data, position) - Widget w; - caddr_t data; - caddr_t position; +slider_jump(Widget w, caddr_t data, caddr_t position) { static Arg percentargs[] = { {XtNlabel, (XtArgVal) NULL} @@ -74,7 +67,7 @@ slider_jump(w, data, position) /* Update the label widget */ - sprintf(snewpercent,"%d",(int)(newpercent*100)); + snprintf(snewpercent, sizeof snewpercent, "%d",(int)(newpercent*100)); percentargs[0].value = (XtArgVal) snewpercent; XtSetValues(percent, percentargs, XtNumber(percentargs)); } @@ -87,26 +80,20 @@ slider_jump(w, data, position) /*ARGSUSED*/ static void -slider_scroll(w, data, position) - Widget w; - caddr_t data; - caddr_t position; -{} +slider_scroll(Widget w, caddr_t data, caddr_t position) +{ +} /*ARGSUSED*/ static void -update(w,event,params,num_params) - Widget w; - XEvent *event; - String *params; - int *num_params; +update(Widget w, XEvent *event, String *params, int *num_params) { char buf[80]; int newpercent; newpercent = (int)(fraction * 100.0); if (newpercent != oldpercent) { - sprintf(buf, "percent %d\n", (int)(fraction * 100.0)); + snprintf(buf, sizeof buf, "percent %d\n", (int)(fraction * 100.0)); interpret(buf); oldpercent = newpercent; } @@ -125,8 +112,7 @@ update(w,event,params,num_params) */ void -create_testfrac_choice(w) - Widget w; +create_testfrac_choice(Widget w) { static XtCallbackRec jumpcallbacks[] = { {(XtCallbackProc) slider_jump, NULL}, @@ -197,8 +183,7 @@ create_testfrac_choice(w) } void -update_slider(newpercent) - int newpercent; +update_slider(int newpercent) { fraction = (float) newpercent / 100.0; XawScrollbarSetThumb(slider, fraction / (1.0-SLIDER_LENGTH), SLIDER_LENGTH); |