diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:13 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:29:13 +0000 |
commit | c059776a3a8a7c760799d1a55c1a130c2179ecc9 (patch) | |
tree | 82ffbfb4d920bed078bcd77ebea90f0f2c7ff26e /testfrac.c | |
parent | e3dfd7a6398174ae8db6a1c0d5e5590d1dabcf31 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_903_specialxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-012804-2330
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); |