[PATCH libXaw3d 16/21] Panner: Fix old-style function definitions

Yaakov (Cygwin/X) yselkowitz at users.sourceforge.net
Thu Aug 25 22:38:18 PDT 2011


From: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>

Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
---
 src/Panner.c |  166 +++++++++++++++++++++++-----------------------------------
 1 files changed, 66 insertions(+), 100 deletions(-)

diff --git a/src/Panner.c b/src/Panner.c
index d6d8808..ee9543f 100644
--- a/src/Panner.c
+++ b/src/Panner.c
@@ -33,11 +33,10 @@ in this Software without prior written authorization from the X Consortium.
 #include <X11/Xos.h>
 #include <X11/Xmu/Misc.h>		/* for Min */
 #include <X11/Xmu/Drawing.h>
+#include <X11/Xmu/StdCmap.h>		/* for XmuDistinguishablePixels() */
 #include <ctype.h>			/* for isascii() etc. */
 #include <stdlib.h>			/* for atof() */
 
-extern Bool XmuDistinguishablePixels(); /* not defined in any Xmu headers */
-
 #if defined(ISC) && __STDC__ && !defined(ISC30)
 extern double atof(char *);
 #endif
@@ -82,8 +81,13 @@ static char defaultTranslations[] =
 #endif
 
 
-static void ActionStart(), ActionStop(), ActionAbort(), ActionMove();
-static void ActionPage(), ActionNotify(), ActionSet();
+static void ActionStart(Widget, XEvent *, String *, Cardinal *);
+static void ActionStop(Widget, XEvent *, String *, Cardinal *);
+static void ActionAbort(Widget, XEvent *, String *, Cardinal *);
+static void ActionMove(Widget, XEvent *, String *, Cardinal *);
+static void ActionPage(Widget, XEvent *, String *, Cardinal *);
+static void ActionNotify(Widget, XEvent *, String *, Cardinal *);
+static void ActionSet(Widget, XEvent *, String *, Cardinal *);
 
 static XtActionsRec actions[] = {
     { "start", ActionStart },		/* start tmp graphics */
@@ -142,14 +146,14 @@ static XtResource resources[] = {
 /*
  * widget class methods used below
  */
-static void Initialize();		/* create gc's */
-static void Realize();			/* create window */
-static void Destroy();			/* clean up widget */
-static void Resize();			/* need to rescale ourselves */
-static void Redisplay();		/* draw ourselves */
-static Boolean SetValues();		/* set all of the resources */
-static void SetValuesAlmost();		/* deal with failed setval geom req */
-static XtGeometryResult QueryGeometry();  /* say how big we would like to be */
+static void Initialize(Widget, Widget, ArgList, Cardinal *);
+static void Realize(Widget, XtValueMask *, XSetWindowAttributes *);
+static void Destroy(Widget);
+static void Resize(Widget);
+static void Redisplay(Widget, XEvent *, Region);
+static Boolean SetValues(Widget, Widget, Widget, ArgList, Cardinal *);
+static void SetValuesAlmost(Widget, Widget, XtWidgetGeometry *, XtWidgetGeometry *);
+static XtGeometryResult QueryGeometry(Widget, XtWidgetGeometry *, XtWidgetGeometry *);
 
 PannerClassRec pannerClassRec = {
   { /* core fields */
@@ -203,8 +207,8 @@ WidgetClass pannerWidgetClass = (WidgetClass) &pannerClassRec;
  *                                                                           *
  *****************************************************************************/
 
-static void reset_shadow_gc (pw)	/* used when resources change */
-    PannerWidget pw;
+static void
+reset_shadow_gc (PannerWidget pw)	/* used when resources change */
 {
     XtGCMask valuemask = GCForeground;
     XGCValues values;
@@ -245,8 +249,8 @@ static void reset_shadow_gc (pw)	/* used when resources change */
     pw->panner.shadow_gc = XtGetGC ((Widget) pw, valuemask, &values);
 }
 
-static void reset_slider_gc (pw)	/* used when resources change */
-    PannerWidget pw;
+static void
+reset_slider_gc (PannerWidget pw)	/* used when resources change */
 {
     XtGCMask valuemask = GCForeground;
     XGCValues values;
@@ -258,8 +262,8 @@ static void reset_slider_gc (pw)	/* used when resources change */
     pw->panner.slider_gc = XtGetGC ((Widget) pw, valuemask, &values);
 }
 
-static void reset_xor_gc (pw)		/* used when resources change */
-    PannerWidget pw;
+static void
+reset_xor_gc (PannerWidget pw)		/* used when resources change */
 {
     if (pw->panner.xor_gc) XtReleaseGC ((Widget) pw, pw->panner.xor_gc);
 
@@ -283,9 +287,8 @@ static void reset_xor_gc (pw)		/* used when resources change */
 }
 
 
-static void check_knob (pw, knob)
-    PannerWidget pw;
-    Boolean knob;
+static void
+check_knob (PannerWidget pw, Boolean knob)
 {
     Position pad = pw->panner.internal_border * 2;
     Position maxx = (((Position) pw->core.width) - pad -
@@ -315,8 +318,8 @@ static void check_knob (pw, knob)
 }
 
 
-static void move_shadow (pw)
-    PannerWidget pw;
+static void
+move_shadow (PannerWidget pw)
 {
     if (pw->panner.shadow_thickness > 0) {
 	int lw = pw->panner.shadow_thickness + pw->panner.line_width * 2;
@@ -341,9 +344,8 @@ static void move_shadow (pw)
     pw->panner.shadow_valid = FALSE;
 }
 
-static void scale_knob (pw, location, size)  /* set knob size and/or loc */
-    PannerWidget pw;
-    Boolean location, size;
+static void
+scale_knob (PannerWidget pw, Boolean location, Boolean size)  /* set knob size and/or loc */
 {
     if (location) {
 	pw->panner.knob_x = (Position) PANNER_HSCALE (pw, pw->panner.slider_x);
@@ -368,8 +370,8 @@ static void scale_knob (pw, location, size)  /* set knob size and/or loc */
     move_shadow (pw);
 }
 
-static void rescale (pw)
-    PannerWidget pw;
+static void
+rescale (PannerWidget pw)
 {
     int hpad = pw->panner.internal_border * 2;
     int vpad = hpad;
@@ -390,19 +392,16 @@ static void rescale (pw)
 }
 
 
-static void get_default_size (pw, wp, hp)
-    PannerWidget pw;
-    Dimension *wp, *hp;
+static void
+get_default_size (PannerWidget pw, Dimension *wp, Dimension *hp)
 {
     Dimension pad = pw->panner.internal_border * 2;
     *wp = PANNER_DSCALE (pw, pw->panner.canvas_width) + pad;
     *hp = PANNER_DSCALE (pw, pw->panner.canvas_height) + pad;
 }
 
-static Boolean get_event_xy (pw, event, x, y)
-    PannerWidget pw;
-    XEvent *event;
-    int *x, *y;
+static Boolean
+get_event_xy (PannerWidget pw, XEvent *event, int *x, int *y)
 {
     int pad = pw->panner.internal_border;
 
@@ -434,10 +433,8 @@ static Boolean get_event_xy (pw, event, x, y)
     return FALSE;
 }
 
-static int parse_page_string (s, pagesize, canvassize, relative)
-    char *s;
-    int pagesize, canvassize;
-    Boolean *relative;
+static int
+parse_page_string (char *s, int pagesize, int canvassize, Boolean *relative)
 {
     char *cp;
     double val = 1.0;
@@ -514,10 +511,8 @@ static int parse_page_string (s, pagesize, canvassize, relative)
 
 
 /*ARGSUSED*/
-static void Initialize (greq, gnew, args, num_args)
-    Widget greq, gnew;
-    ArgList args;
-    Cardinal *num_args;
+static void
+Initialize (Widget greq, Widget gnew, ArgList args, Cardinal *num_args)
 {
     PannerWidget req = (PannerWidget) greq, new = (PannerWidget) gnew;
     Dimension defwidth, defheight;
@@ -545,10 +540,8 @@ static void Initialize (greq, gnew, args, num_args)
 }
 
 
-static void Realize (gw, valuemaskp, attr)
-    Widget gw;
-    XtValueMask *valuemaskp;
-    XSetWindowAttributes *attr;
+static void
+Realize (Widget gw, XtValueMask *valuemaskp, XSetWindowAttributes *attr)
 {
     PannerWidget pw = (PannerWidget) gw;
     Pixmap pm = XtUnspecifiedPixmap;
@@ -571,8 +564,8 @@ static void Realize (gw, valuemaskp, attr)
 }
 
 
-static void Destroy (gw)
-    Widget gw;
+static void
+Destroy (Widget gw)
 {
     PannerWidget pw = (PannerWidget) gw;
 
@@ -582,18 +575,16 @@ static void Destroy (gw)
 }
 
 
-static void Resize (gw)
-    Widget gw;
+static void
+Resize (Widget gw)
 {
     rescale ((PannerWidget) gw);
 }
 
 
 /* ARGSUSED */
-static void Redisplay (gw, event, region)
-    Widget gw;
-    XEvent *event;
-    Region region;
+static void
+Redisplay (Widget gw, XEvent *event, Region region)
 {
     PannerWidget pw = (PannerWidget) gw;
     Display *dpy = XtDisplay(gw);
@@ -632,10 +623,8 @@ static void Redisplay (gw, event, region)
 
 
 /* ARGSUSED */
-static Boolean SetValues (gcur, greq, gnew, args, num_args)
-    Widget gcur, greq, gnew;
-    ArgList args;
-    Cardinal *num_args;
+static Boolean
+SetValues (Widget gcur, Widget greq, Widget gnew, ArgList args, Cardinal *num_args)
 {
     PannerWidget cur = (PannerWidget) gcur;
     PannerWidget new = (PannerWidget) gnew;
@@ -710,9 +699,8 @@ static Boolean SetValues (gcur, greq, gnew, args, num_args)
     return redisplay;
 }
 
-static void SetValuesAlmost (gold, gnew, req, reply)
-    Widget gold, gnew;
-    XtWidgetGeometry *req, *reply;
+static void
+SetValuesAlmost (Widget gold, Widget gnew, XtWidgetGeometry *req, XtWidgetGeometry *reply)
 {
     if (reply->request_mode == 0) {	/* got turned down, so cope */
 	Resize (gnew);
@@ -721,9 +709,8 @@ static void SetValuesAlmost (gold, gnew, req, reply)
 	(gold, gnew, req, reply);
 }
 
-static XtGeometryResult QueryGeometry (gw, intended, pref)
-    Widget gw;
-    XtWidgetGeometry *intended, *pref;
+static XtGeometryResult
+QueryGeometry (Widget gw, XtWidgetGeometry *intended, XtWidgetGeometry *pref)
 {
     PannerWidget pw = (PannerWidget) gw;
 
@@ -749,11 +736,8 @@ static XtGeometryResult QueryGeometry (gw, intended, pref)
  *****************************************************************************/
 
 /* ARGSUSED */
-static void ActionStart (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;
-    String *params;			/* unused */
-    Cardinal *num_params;		/* unused */
+static void
+ActionStart (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
     int x, y;
@@ -774,11 +758,8 @@ static void ActionStart (gw, event, params, num_params)
 }
 
 /* ARGSUSED */
-static void ActionStop (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;
-    String *params;			/* unused */
-    Cardinal *num_params;		/* unused */
+static void
+ActionStop (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
     int x, y;
@@ -793,11 +774,8 @@ static void ActionStop (gw, event, params, num_params)
 }
 
 /* ARGSUSED */
-static void ActionAbort (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;
-    String *params;			/* unused */
-    Cardinal *num_params;		/* unused */
+static void
+ActionAbort (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
 
@@ -815,11 +793,8 @@ static void ActionAbort (gw, event, params, num_params)
 
 
 /* ARGSUSED */
-static void ActionMove (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;			/* must be a motion event */
-    String *params;			/* unused */
-    Cardinal *num_params;		/* unused */
+static void
+ActionMove (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
     int x, y;
@@ -845,11 +820,8 @@ static void ActionMove (gw, event, params, num_params)
 
 
 /* ARGSUSED */
-static void ActionPage (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;			/* unused */
-    String *params;
-    Cardinal *num_params;		/* unused */
+static void
+ActionPage (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
     Cardinal zero = 0;
@@ -888,11 +860,8 @@ static void ActionPage (gw, event, params, num_params)
 
 
 /* ARGSUSED */
-static void ActionNotify (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;			/* unused */
-    String *params;			/* unused */
-    Cardinal *num_params;		/* unused */
+static void
+ActionNotify (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
 
@@ -939,11 +908,8 @@ static void ActionNotify (gw, event, params, num_params)
 }
 
 /* ARGSUSED */
-static void ActionSet (gw, event, params, num_params)
-    Widget gw;
-    XEvent *event;			/* unused */
-    String *params;
-    Cardinal *num_params;
+static void
+ActionSet (Widget gw, XEvent *event, String *params, Cardinal *num_params)
 {
     PannerWidget pw = (PannerWidget) gw;
     Boolean rb;
-- 
1.7.5.1



More information about the xorg-devel mailing list