[nas] [patch] convert more K&R code to ANSI C

Stefan Huehner stefan at huehner.org
Wed Jul 12 09:45:37 MDT 2006


Hi,

attached patch converts some of the client programs to ANSI C.

Regards,
Stefan

-------------- next part --------------
Index: auinfo/auinfo.c
===================================================================
--- auinfo/auinfo.c	(revision 5)
+++ auinfo/auinfo.c	(revision 6)
@@ -64,9 +64,7 @@
 static const char *INDENTPAD = INDENTPADSTR;
 
 int
-main (argc, argv)
-    int argc;
-    char **argv;
+main (int argc, char **argv)
 {
     int i;
     char *audioname = NULL;
@@ -268,9 +266,7 @@
 
 #if TEXT_ALIGNMENT == TA_INDIVIDUAL
 #define ROUNDUP(n) ((((n) + 7) >> 3) << 3)
-static int _table_maxlen (tab, nents)
-    register NameTable *tab;
-    register int nents;
+static int _table_maxlen (register NameTable *tab, register int nents)
 {
     register int m = 0;
 
@@ -288,11 +284,8 @@
 #define ALL_COLUMN_WIDTH 24
 #endif
 
-static NameTable *_lookup_name (tab, nents, val, isbit)
-    register NameTable *tab;
-    register int nents;
-    register int val;
-    register AuBool isbit;		/* use bit compare instead of equal? */
+static NameTable *_lookup_name (register NameTable *tab, register int nents, register int val, register AuBool isbit)
+/* isbit: use bit compare instead of equal? */
 {
     static NameTable nttmp;
     static char tmpbuf[20];
@@ -390,16 +383,12 @@
 
 
 /* ARGSUSED2 */
-static int _get_format (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_format (AuServer *aud, int i, AuPointer p)
 {
     return AuServerFormat (aud, i);
 }
 
-static void print_formats (aud)
-    AuServer *aud;
+static void print_formats (AuServer *aud)
 {
     _print_names (aud, _nt_formats, NENTRIES(_nt_formats), 
 		  "Formats:", AuServerNumFormats(aud), _get_format, 
@@ -407,26 +396,18 @@
 }
 
 /* ARGSUSED */
-static int _get_use (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_use (AuServer *aud, int i, AuPointer p)
 {
     return (1 << i) & AuCommonUse ((AuCommonPart *) p);
 }
 
 /* ARGSUSED */
-static int _get_access (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_access (AuServer *aud, int i, AuPointer p)
 {
     return (1 << i) & AuCommonAccess ((AuCommonPart *) p);
 }
 
-static void print_comp (aud, c)
-    AuServer *aud;
-    register AuCommonPart *c;
+static void print_comp (AuServer *aud, register AuCommonPart *c)
 {
     register AuMask vmask = AuCommonValueMask (c);
 
@@ -461,27 +442,19 @@
 
 
 /* ARGSUSED */
-static int _get_devicechangables (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_devicechangables (AuServer *aud, int i, AuPointer p)
 {
     return (1 << i) & AuDeviceChangableMask((AuDeviceAttributes *) p);
 }
 
 /* ARGSUSED */
-static int _get_locations (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_locations (AuServer *aud, int i, AuPointer p)
 {
     return (1 << i) & AuDeviceLocation ((AuDeviceAttributes *) p);
 }
 
 
-static void print_device (aud, d)
-    AuServer *aud;
-    AuDeviceAttributes *d;
+static void print_device (AuServer *aud, AuDeviceAttributes *d)
 {
     AuMask vmask = AuDeviceValueMask (d);
 
@@ -525,8 +498,7 @@
     }
 }
 
-static void print_devices (aud)
-    AuServer *aud;
+static void print_devices (AuServer *aud)
 {
 
     int i;
@@ -538,9 +510,7 @@
 }
 
 static void
-print_bucket(aud, ba)
-    AuServer	*aud;
-    AuBucketAttributes	*ba;
+print_bucket(AuServer *aud, AuBucketAttributes *ba)
 {
     AuMask vmask = AuBucketValueMask (ba);
 
@@ -554,8 +524,7 @@
 }
 
 
-static void print_server_buckets (aud)
-    AuServer *aud;
+static void print_server_buckets (AuServer *aud)
 {
     int i;
 
@@ -566,8 +535,7 @@
 }
 
 
-static void print_client_buckets (aud)
-    AuServer *aud;
+static void print_client_buckets (AuServer *aud)
 {
     int	num, i;
     AuBucketAttributes	*bas;
@@ -593,16 +561,12 @@
 
 
 /* ARGSUSED2 */
-static int _get_elem_type (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_elem_type (AuServer *aud, int i, AuPointer p)
 {
     return AuServerElementType (aud, i);
 }
 
-static void print_elem_types (aud)
-    AuServer *aud;
+static void print_elem_types (AuServer *aud)
 {
     _print_names (aud, _nt_elemtypes, NENTRIES(_nt_elemtypes),
 		  "Element Types:", AuServerNumElementTypes(aud),
@@ -611,16 +575,12 @@
 
 
 /* ARGSUSED2 */
-static int _get_wave_form (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_wave_form (AuServer *aud, int i, AuPointer p)
 {
     return AuServerWaveForm (aud, i);
 }
 
-static void print_wave_forms (aud)
-    AuServer *aud;
+static void print_wave_forms (AuServer *aud)
 {
     _print_names (aud, _nt_waveforms, NENTRIES(_nt_waveforms), 
 		  "Wave Forms:", AuServerNumWaveForms(aud), _get_wave_form,
@@ -629,16 +589,12 @@
 
 
 /* ARGSUSED2 */
-static int _get_action (aud, i, p)
-    AuServer *aud;
-    int i;
-    AuPointer p;
+static int _get_action (AuServer *aud, int i, AuPointer p)
 {
     return AuServerAction (aud, i);
 }
 
-static void print_actions (aud)
-    AuServer *aud;
+static void print_actions (AuServer *aud)
 {
     _print_names (aud, _nt_actions, NENTRIES(_nt_actions), 
 		  "Actions:", AuServerNumActions(aud), _get_action, 
Index: aupanel/aupanel.c
===================================================================
--- aupanel/aupanel.c	(revision 5)
+++ aupanel/aupanel.c	(revision 6)
@@ -159,17 +159,13 @@
 }
 
 static void
-quitCB(w, gp, call_data)
-Widget          w;
-XtPointer       gp;
-XtPointer       call_data;
+quitCB(Widget w, XtPointer gp, XtPointer call_data)
 {
     exit(0);
 }
 
 static void
-showDevice(g)
-GlobalDataPtr   g;
+showDevice(GlobalDataPtr g)
 {
     Boolean         inputModeEnable, outputModeEnable,
                     gainEnable;
@@ -244,10 +240,7 @@
 }
 
 static void
-queryCB(w, gp, call_data)
-Widget          w;
-XtPointer       gp;
-XtPointer       call_data;
+queryCB(Widget w, XtPointer gp, XtPointer call_data)
 {
     GlobalDataPtr   g = (GlobalDataPtr) gp;
 
@@ -257,10 +250,7 @@
 }
 
 static void
-inputModeCB(w, gp, call_data)
-Widget          w;
-XtPointer       gp;
-XtPointer       call_data;
+inputModeCB(Widget w, XtPointer gp, XtPointer call_data)
 {
     GlobalDataPtr   g = (GlobalDataPtr) gp;
     AuDeviceAttributes *da = &g->da[g->deviceNum];
@@ -279,10 +269,7 @@
 }
 
 static void
-outputModeCB(w, gp, call_data)
-Widget          w;
-XtPointer       gp;
-XtPointer       call_data;
+outputModeCB(Widget w, XtPointer gp, XtPointer call_data)
 {
     GlobalDataPtr   g = (GlobalDataPtr) gp;
     AuDeviceAttributes *da = &g->da[g->deviceNum];
@@ -306,10 +293,7 @@
 }
 
 static void
-menuCB(w, gp, call_data)
-Widget          w;
-XtPointer       gp;
-XtPointer       call_data;
+menuCB(Widget w, XtPointer gp, XtPointer call_data)
 {
     GlobalDataPtr   g = (GlobalDataPtr) gp;
     int             i;
@@ -328,10 +312,7 @@
 }
 
 static void
-setGain(w, gp, valuep)
-Widget          w;
-XtPointer       gp;
-XtPointer       valuep;
+setGain(Widget w, XtPointer gp, XtPointer valuep)
 {
     GlobalDataPtr   g = (GlobalDataPtr) gp;
     AuDeviceAttributes *da = &g->da[g->deviceNum];
@@ -349,10 +330,7 @@
 }
 
 static void
-muteCB(w, gp, call_data)
-Widget          w;
-XtPointer       gp;
-XtPointer       call_data;
+muteCB(Widget w, XtPointer gp, XtPointer call_data)
 {
     GlobalDataPtr g = (GlobalDataPtr) gp;
     AuDeviceAttributes *da;
@@ -373,8 +351,7 @@
 }
 
 static void
-createWidgets(g)
-GlobalDataPtr   g;
+createWidgets(GlobalDataPtr g)
 {
     int             i;
     Widget          w;
@@ -429,8 +406,7 @@
 }
 
 static void
-alignWidgets(g)
-GlobalDataPtr   g;
+alignWidgets(GlobalDataPtr g)
 {
     Dimension       w,
                     w1;
@@ -453,9 +429,7 @@
 }
 
 int
-main(argc, argv)
-int             argc;
-char          **argv;
+main(int argc, char **argv)
 {
     GlobalDataRec   globals;
     GlobalDataPtr   g = &globals;
Index: audial/audial.c
===================================================================
--- audial/audial.c	(revision 5)
+++ audial/audial.c	(revision 6)
@@ -93,8 +93,7 @@
  * indicate a relative time. OBH-4/16/91
  */
 static void
-usleep(usecs)
-unsigned int    usecs;
+usleep(unsigned int usecs)
 {
     double          s1;
     AuUint32   quad[2];
@@ -115,8 +114,7 @@
 #include <poll.h>
 
 int
-usleep(usec)
-unsigned int    usec;
+usleep(unsigned int usec)
 {
     struct pollfd   f;
     return poll(&f, (unsigned long) 0, usec / 1000);
@@ -137,15 +135,13 @@
 #include <sys/time.h>
 
 static void
-stopme(sig)
-int sig;
+stopme(int sig)
 {
     signal(SIGALRM, SIG_DFL);
 }
 
 static void
-usleep(usecs)
-unsigned int    usecs;
+usleep(unsigned int usecs)
 {
     void            stopme();
     struct itimerval ntval,
@@ -215,11 +211,7 @@
 }
 
 static          AuFlowID
-createDTMFflow(aud, outputDevice, volume, duration)
-AuServer       *aud;
-AuDeviceID      outputDevice;
-int             volume,
-                duration;
+createDTMFflow(AuServer *aud, AuDeviceID outputDevice, int volume, int duration)
 {
     AuFlowID        flow;
     AuElement       elements[18];
@@ -263,12 +255,7 @@
 }
 
 static void
-dial(aud, flow, dialString, pause, spacing)
-AuServer       *aud;
-AuFlowID        flow;
-char           *dialString;
-int             pause,
-                spacing;
+dial(AuServer *aud, AuFlowID flow, char *dialString, int pause, int spacing)
 {
     AuEvent         event;
     AuElementState  states[3];
@@ -313,13 +300,7 @@
 }
 
 static void
-doDial(aud, dialString, volume, pause, spacing, duration)
-AuServer       *aud;
-char           *dialString;
-int             volume,
-                pause,
-                spacing,
-                duration;
+doDial(AuServer *aud, char *dialString, int volume, int pause, int spacing, int duration)
 {
     AuDeviceID      outputDevice = AuNone;
     AuFlowID        flow;
@@ -364,9 +345,7 @@
 #define THRESHHOLD 	3
 
 static void
-recognize(p, n)
-unsigned char  *p;
-int             n;
+recognize(unsigned char *p, int n)
 {
     static int      freqs[8] = {697, 770, 852, 941, 1209, 1336, 1477, 1633},
                     sums[8][NBINS],
@@ -482,11 +461,7 @@
 }
 
 static void
-doRecognize(aud, mic, gain, time)
-AuServer       *aud;
-AuBool          mic;
-int             gain,
-                time;
+doRecognize(AuServer *aud, AuBool mic, int gain, int time)
 {
     AuElementAction actions[1];
     AuEvent         event;
@@ -592,9 +567,7 @@
 }
 
 int
-main(argc, argv)
-int             argc;
-char          **argv;
+main(int argc, char **argv)
 {
     int             i,
                     time = 0,
Index: widgets/Slider.c
===================================================================
--- widgets/Slider.c	(revision 5)
+++ widgets/Slider.c	(revision 6)
@@ -123,11 +123,7 @@
 WidgetClass     sliderWidgetClass = (WidgetClass) & sliderClassRec;
 
 static void
-setValue(w, value, setThumb, force)
-SliderWidget    w;
-int             value;
-Boolean         setThumb,
-                force;
+setValue(SliderWidget w, int value, Boolean setThumb, Boolean force)
 {
     if (value < w->slider.min)
 	value = w->slider.min;
@@ -155,10 +151,7 @@
 }
 
 static void
-scroll(w, swp, positionp)
-Widget          w;
-XtPointer       swp,
-                positionp;
+scroll(Widget w, XtPointer swp, XtPointer positionp)
 {
     SliderWidget    sw = (SliderWidget) swp;
     int             position = (int) positionp;
@@ -167,10 +160,7 @@
 }
 
 static void
-jump(w, swp, percentp)
-Widget          w;
-XtPointer       swp,
-                percentp;
+jump(Widget w, XtPointer swp, XtPointer percentp)
 {
     SliderWidget    sw = (SliderWidget) swp;
     float          *percent = (float *) percentp;
@@ -179,11 +169,7 @@
 }
 
 static void
-Initialize(request, new, args, num_args)
-Widget          request,
-                new;
-ArgList         args;
-Cardinal       *num_args;
+Initialize(Widget request, Widget new, ArgList args, Cardinal *num_args)
 {
     SliderWidget    w = (SliderWidget) new;
 
@@ -224,12 +210,7 @@
 }
 
 static Boolean
-SetValues(current, request, new, in_args, in_num_args)
-Widget          current,
-                request,
-                new;
-ArgList         in_args;
-Cardinal       *in_num_args;
+SetValues(Widget current, Widget request, Widget new, ArgList in_args, Cardinal *in_num_args)
 {
     SliderWidget    w = (SliderWidget) new,
                     old = (SliderWidget) current;
Index: auctl/execute.c
===================================================================
--- auctl/execute.c	(revision 5)
+++ auctl/execute.c	(revision 6)
@@ -41,11 +41,7 @@
 
 #define NELEMS(what) ((sizeof(what))/(sizeof((what)[0])))
 
-int execute_command (aud, argc, argv, donep)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuBool *donep;
+int execute_command (AuServer *aud, int argc, char **argv, AuBool *donep)
 {
     static struct {
 	char *name;
@@ -86,14 +82,7 @@
 } NameTable;
 
 static int 
-_do_parse (aud, argc, argv, title, tab, ntab, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    const char *title;
-    NameTable *tab;
-    int ntab;
-    AuPointer data;
+_do_parse (AuServer *aud, int argc, char **argv, const char *title, NameTable *tab, int ntab, AuPointer data)
 {
     int i;
     int len;
@@ -111,10 +100,7 @@
 }
     
 
-static int _execute_set (aud, argc, argv)
-    AuServer *aud;
-    int argc;
-    char **argv;
+static int _execute_set (AuServer *aud, int argc, char **argv)
 {
     static NameTable settab[] = {
 	{ "device",	_execute_set_device },
@@ -131,10 +117,7 @@
 
 
 
-static int _execute_list (aud, argc, argv)
-    AuServer *aud;
-    int argc;
-    char **argv;
+static int _execute_list (AuServer *aud, int argc, char **argv)
 {
     static NameTable settab[] = {
 	{ "device",	_execute_list_device },
@@ -149,9 +132,7 @@
 }
 
 
-static AuDeviceID _parse_device_id (aud, s)
-    AuServer *aud;
-    char *s;
+static AuDeviceID _parse_device_id (AuServer *aud, char *s)
 {
     AuBool ishex; 
     AuDeviceID id = _parse_long (s, &ishex);
@@ -188,11 +169,7 @@
 
 
 /* ARGSUSED */
-static int _execute_set_device (aud, argc, argv, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuPointer data;
+static int _execute_set_device (AuServer *aud, int argc, char **argv, AuPointer data)
 {
     AuDeviceID id;
     static NameTable optab[] = {
@@ -217,10 +194,7 @@
 }
 
 
-static int _do_list_device_attributes (aud, id, mask)
-    AuServer *aud;
-    AuDeviceID id;
-    AuMask mask;
+static int _do_list_device_attributes (AuServer *aud, AuDeviceID id, AuMask mask)
 {
     AuStatus status;
     AuDeviceAttributes *d = AuGetDeviceAttributes (aud, id, &status);
@@ -264,11 +238,7 @@
 
 
 /* ARGSUSED */
-static int _execute_list_device (aud, argc, argv, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuPointer data;
+static int _execute_list_device (AuServer *aud, int argc, char **argv, AuPointer data)
 {
     AuDeviceID id;
     static NameTable optab[] = {
@@ -300,11 +270,7 @@
 
 
 /* ARGSUSED */
-static int _execute_list_gain (aud, argc, argv, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuPointer data;
+static int _execute_list_gain (AuServer *aud, int argc, char **argv, AuPointer data)
 {
     AuDeviceID id = *(AuDeviceID *) data;
     return _do_list_device_attributes (aud, id, AuCompDeviceGainMask);
@@ -312,21 +278,14 @@
 
 
 /* ARGSUSED */
-static int _execute_list_linemode (aud, argc, argv, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuPointer data;
+static int _execute_list_linemode (AuServer *aud, int argc, char **argv, AuPointer data)
 {
     AuDeviceID id = *(AuDeviceID *) data;
     return _do_list_device_attributes (aud, id, AuCompDeviceGainMask);
 }
 
 
-static int _execute_help (aud, argc, argv)
-    AuServer *aud;
-    int argc;
-    char **argv;
+static int _execute_help (AuServer *aud, int argc, char **argv)
 {
     static const char * const msg[] = {
 "The following commands are supported:",
@@ -356,20 +315,13 @@
 
     
 /* ARGSUSED */
-static int _execute_nop (aud, argc, argv)
-    AuServer *aud;
-    int argc;
-    char **argv;
+static int _execute_nop (AuServer *aud, int argc, char **argv)
 {
     return 0;
 }
 
 
-static int _execute_set_gain (aud, argc, argv, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuPointer data;
+static int _execute_set_gain (AuServer *aud, int argc, char **argv, AuPointer data)
 {
     AuDeviceID id = *(AuDeviceID *) data;
     int p;
@@ -449,11 +401,7 @@
     return 0;
 }
 
-static int _execute_set_linemode (aud, argc, argv, data)
-    AuServer *aud;
-    int argc;
-    char **argv;
-    AuPointer data;
+static int _execute_set_linemode (AuServer *aud, int argc, char **argv, AuPointer data)
 {
     AuDeviceID id = *(AuDeviceID *) data;
     AuDeviceAttributes attr;
@@ -512,8 +460,7 @@
 
 
 
-static char *_lower_word (s)
-    register char *s;
+static char *_lower_word (register char *s)
 {
     register char *cp;
 
@@ -525,9 +472,7 @@
 }
 
 
-static AuInt32 _parse_long (s, ishexp)
-    register char *s;
-    register AuBool *ishexp;
+static AuInt32 _parse_long (register char *s, register AuBool *ishexp)
 {
     char *fmt = "%ld";
     AuInt32 val = 0;
Index: auctl/auctl.c
===================================================================
--- auctl/auctl.c	(revision 5)
+++ auctl/auctl.c	(revision 6)
@@ -40,9 +40,7 @@
 static int do_command_loop PROTO((AuServer *, AuBool));
 
 int
-main (argc, argv)
-    int argc;
-    char **argv;
+main (int argc, char **argv)
 {
     int i;
     char *audioname = NULL;
@@ -99,8 +97,7 @@
 }
 
 
-static char *skip_space (s)
-    register char *s;
+static char *skip_space (register char *s)
 {
     if (!s) return NULL;
 
@@ -110,8 +107,7 @@
 }
 
 
-static char *skip_nonspace (s)
-    register char *s;
+static char *skip_nonspace (register char *s)
 {
     if (!s) return NULL;
 
@@ -122,9 +118,7 @@
 }
 
 
-static char **split_into_words (src, argcp)  /* argvify string */
-    char *src;
-    int *argcp;
+static char **split_into_words (char *src, int *argcp)  /* argvify string */
 {
     char *jword;
     char savec;
@@ -164,9 +158,7 @@
 }
 
 
-static int do_command_loop (aud, doprompt)
-    AuServer *aud;
-    AuBool doprompt;
+static int do_command_loop (AuServer *aud, AuBool doprompt)
 {
     char buf[256];
     int len;
Index: audemo/audemo.c
===================================================================
--- audemo/audemo.c	(revision 5)
+++ audemo/audemo.c	(revision 6)
@@ -270,8 +270,7 @@
 						 * headers on hosts that *do*
 						 * have strdup... */
 char           *
-strdup(s)
-char           *s;
+strdup(char *s)
 {
     char           *t;
 
@@ -284,9 +283,7 @@
 #endif
 
 static void
-RemoveFromElementList(globals, p)
-GlobalDataPtr   globals;
-ElementListPtr  p;
+RemoveFromElementList(GlobalDataPtr globals, ElementListPtr p)
 {
     RemoveFromLinkedList(ElementList, p);
     ElementCount--;
@@ -303,10 +300,7 @@
 }
 
 static          ElementListId
-AddToElementList(flow, volumeElement, monitorElement)
-AuFlowID        flow;
-int             volumeElement,
-                monitorElement;
+AddToElementList(AuFlowID flow, int volumeElement, int monitorElement)
 {
     ElementListPtr  p;
 
@@ -327,8 +321,7 @@
 }
 
 static void
-queryInputAttributes(globals)
-GlobalDataPtr   globals;
+queryInputAttributes(GlobalDataPtr globals)
 {
     Boolean         mode;
     AuDeviceAttributes *attr;
@@ -348,10 +341,7 @@
 }
 
 static void
-meterToggleCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+meterToggleCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     Boolean         meter;
@@ -395,11 +385,7 @@
     ((short *) &(e)->data)[i * (e)->num_fields + 1]
 
 static void
-meterCB(aud, handler, ev, globals)
-AuServer       *aud;
-AuEventHandlerRec *handler;
-AuEvent        *ev;
-GlobalDataPtr   globals;
+meterCB(AuServer *aud, AuEventHandlerRec *handler, AuEvent *ev, GlobalDataPtr globals)
 {
     AuMonitorNotifyEvent *e = (AuMonitorNotifyEvent *) ev;
     static int      count;
@@ -453,11 +439,7 @@
 }               DonePrivRec, *DonePrivPtr;
 
 static void
-doneCB(aud, handler, ev, datap)
-AuServer       *aud;
-AuEvent        *ev;
-AuEventHandlerRec *handler;
-AuPointer       datap;
+doneCB(AuServer *aud, AuEventHandlerRec *handler, AuEvent *ev, AuPointer datap)
 {
     DonePrivPtr     data = (DonePrivPtr) datap;
 
@@ -468,10 +450,7 @@
 }
 
 static void
-modeCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+modeCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     Boolean         mode;
@@ -485,10 +464,7 @@
 }
 
 static void
-newBucketCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+newBucketCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     String          s;
@@ -520,10 +496,7 @@
 }
 
 static void
-rescanCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+rescanCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     static char    *noFilesString = "No files found";
@@ -558,10 +531,7 @@
 }
 
 static void
-bucketPlayCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketPlayCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     static Boolean  playing;
@@ -617,10 +587,7 @@
 #define COMMENT_LEN 20
 
 static void
-bucketQueryCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketQueryCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     BucketDialogDataPtr buf = &globals->buf;
@@ -695,10 +662,7 @@
 }
 
 static void
-bucketDeleteCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketDeleteCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     XawListReturnStruct *sel;
@@ -715,10 +679,7 @@
 }
 
 static void
-bucketLoadCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketLoadCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     XawListReturnStruct *sel;
@@ -735,10 +696,7 @@
 }
 
 static void
-bucketsCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketsCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -748,10 +706,7 @@
 }
 
 static void
-bucketRecordStartCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketRecordStartCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     static Boolean  recording;
@@ -801,10 +756,7 @@
 }
 
 static void
-recordStartCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+recordStartCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     static Boolean  recording;
@@ -865,10 +817,7 @@
 }
 
 static void
-monitorCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+monitorCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     static Boolean  monitoring;
@@ -918,10 +867,7 @@
 }
 
 static void
-saveCancel(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+saveCancel(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -930,10 +876,7 @@
 }
 
 static void
-saveOk(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+saveOk(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     String          s;
@@ -963,11 +906,7 @@
 }
 
 static void
-okAction(w, event, params, num_params)
-Widget          w;
-XEvent         *event;
-String         *params;
-Cardinal       *num_params;
+okAction(Widget w, XEvent event, String *params, Cardinal *num_params)
 {
     GlobalDataPtr   globals;
 
@@ -977,10 +916,7 @@
 }
 
 static void
-bucketSaveCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketSaveCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     XawListReturnStruct *sel;
@@ -995,10 +931,7 @@
 }
 
 static void
-bucketDismissCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketDismissCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -1012,10 +945,7 @@
 }
 
 static void
-recordDismissCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+recordDismissCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -1028,10 +958,7 @@
 }
 
 static void
-bucketRecordDismissCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketRecordDismissCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -1053,17 +980,13 @@
 }
 
 static void
-recordSensitives(globals, state)
-GlobalDataPtr   globals;
-Boolean         state;
+recordSensitives(GlobalDataPtr globals, Boolean state)
 {
     XtSetSensitive(globals->rec.file, state);
 }
 
 static void
-bucketRecordSensitives(globals, state)
-GlobalDataPtr   globals;
-Boolean         state;
+bucketRecordSensitives(GlobalDataPtr globals, Boolean state)
 {
     XtSetSensitive(globals->rec.duration, state);
     XtSetSensitive(globals->rec.readOnly, state);
@@ -1071,10 +994,7 @@
 }
 
 static void
-recordCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+recordCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -1092,10 +1012,7 @@
 }
 
 static void
-bucketRecordCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+bucketRecordCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
 
@@ -1113,10 +1030,7 @@
 }
 
 static void
-playCB(w, globalsp, datap)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       datap;
+playCB(Widget w, XtPointer globalsp, XtPointer datap)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     static Boolean  playing;
@@ -1166,10 +1080,7 @@
 }
 
 static void
-bucketListCB(w, globalsp, listInfop)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       listInfop;
+bucketListCB(Widget w, XtPointer globalsp, XtPointer listInfop)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     XawListReturnStruct *listInfo = (XawListReturnStruct *) listInfop;
@@ -1190,10 +1101,7 @@
 }
 
 static void
-samplesCB(w, globalsp, listInfop)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       listInfop;
+samplesCB(Widget w, XtPointer globalsp, XtPointer listInfop)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     XawListReturnStruct *listInfo = (XawListReturnStruct *) listInfop;
@@ -1250,17 +1158,13 @@
 }
 
 static void
-quitCB(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+quitCB(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     exit(0);
 }
 
 static void
-adjustVolume(globals)
-GlobalDataPtr   globals;
+adjustVolume(GlobalDataPtr globals)
 {
     AuElementParameters *parms;
     ElementListPtr  p = ElementList;
@@ -1289,10 +1193,7 @@
 }
 
 static void
-scrollProcCB(w, globalsp, positionp)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       positionp;
+scrollProcCB(Widget w, XtPointer globalsp, XtPointer positionp)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     int             position = (int) positionp;
@@ -1319,10 +1220,7 @@
 }
 
 static void
-jumpProcCB(w, globalsp, percentp)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       percentp;
+jumpProcCB(Widget w, XtPointer globalsp, XtPointer percentp)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     float          *percent = (float *) percentp;
@@ -1344,8 +1242,7 @@
 }
 
 static void
-adjustGain(globals)
-GlobalDataPtr   globals;
+adjustGain(GlobalDataPtr globals)
 {
     AuDeviceAttributes a;
 
@@ -1356,10 +1253,7 @@
 }
 
 static void
-gainScrollCB(w, globalsp, positionp)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       positionp;
+gainScrollCB(Widget w, XtPointer globalsp, XtPointer positionp)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     int             position = (int) positionp;
@@ -1386,10 +1280,7 @@
 }
 
 static void
-gainJumpCB(w, globalsp, percentp)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       percentp;
+gainJumpCB(Widget w, XtPointer globalsp, XtPointer percentp)
 {
     GlobalDataPtr   globals = (GlobalDataPtr) globalsp;
     float          *percent = (float *) percentp;
@@ -1411,10 +1302,7 @@
 }
 
 static void
-setFileFormatMenuButton(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+setFileFormatMenuButton(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   g = (GlobalDataPtr) globalsp;
     String          string;
@@ -1427,10 +1315,7 @@
 }
 
 static void
-setDataFormatMenuButton(w, globalsp, call_data)
-Widget          w;
-XtPointer       globalsp;
-XtPointer       call_data;
+setDataFormatMenuButton(Widget w, XtPointer globalsp, XtPointer call_data)
 {
     GlobalDataPtr   g = (GlobalDataPtr) globalsp;
     String          string;
@@ -1440,8 +1325,7 @@
 }
 
 static void
-makeSaveDialog(g)
-GlobalDataPtr   g;
+makeSaveDialog(GlobalDataPtr g)
 {
     SaveDialogDataPtr s = &g->save;
     Widget          w;
@@ -1471,8 +1355,7 @@
 }
 
 static void
-makeBucketDialog(g)
-GlobalDataPtr   g;
+makeBucketDialog(GlobalDataPtr g)
 {
     Widget          w;
     int             i;
@@ -1522,8 +1405,7 @@
 }
 
 static void
-makeRecordDialog(g)
-GlobalDataPtr   g;
+makeRecordDialog(GlobalDataPtr g)
 {
     Widget          w;
     RecordDialogDataPtr r = &g->rec;
@@ -1581,9 +1463,7 @@
 }
 
 static void
-createWidgets(g, dir)
-GlobalDataPtr   g;
-char           *dir;
+createWidgets(GlobalDataPtr g, char *dir)
 {
     Widget          w,
                     ww;
@@ -1684,8 +1564,7 @@
 }
 
 static void
-alignWidgets(g)
-GlobalDataPtr   g;
+alignWidgets(GlobalDataPtr g)
 {
     Position        maxX,
                     x;
@@ -1744,9 +1623,7 @@
 }
 
 int
-main(argc, argv)
-int             argc;
-char          **argv;
+main(int argc, char **argv)
 {
     int             i,
                     endian = 1;
@@ -1834,9 +1711,7 @@
 }
 
 static int
-sortRoutine(ap, bp)
-const void          *ap,
-                       *bp;
+sortRoutine(const void *ap, const void *bp)
 {
     const char **a = (const char **)ap;
     const char **b = (const char **)bp;
@@ -1845,9 +1720,7 @@
 }
 
 static char   **
-makeFileList(fileNames, nfiles)
-char          **fileNames;
-int             nfiles;
+makeFileList(char **fileNames, int nfiles)
 {
     char          **fileList,
                    *p;
@@ -1881,9 +1754,7 @@
 
 #ifndef WIN32
 static FILE    *
-startFind(dir, template)
-char           *dir,
-               *template;
+startFind(char *dir, char *template)
 {
     char           *cmd,
                    *p;
@@ -1921,10 +1792,7 @@
 #endif /* !WIN32 */
 
 static int
-getFileNames(dir, fileNames, template)
-char           *dir,
-             ***fileNames,
-               *template;
+getFileNames(char *dir, char ***fileNames, char *template)
 {
 #ifndef WIN32
     int             files;
Index: util/issndfile.c
===================================================================
--- util/issndfile.c	(revision 5)
+++ util/issndfile.c	(revision 6)
@@ -28,9 +28,7 @@
 #include <audio/soundlib.h>
 
 int
-main(argc, argv)
-int             argc;
-char          **argv;
+main(int argc, char **argv)
 {
     return (argc == 2 && SoundOpenFileForReading(argv[1]) ? 0 : 1);
 }
Index: util/playbucket.c
===================================================================
--- util/playbucket.c	(revision 5)
+++ util/playbucket.c	(revision 6)
@@ -41,11 +41,7 @@
 }
 
 static void
-doneCB(aud, handler, ev, data)
-AuServer       *aud;
-AuEvent        *ev;
-AuEventHandlerRec *handler;
-AuPointer       data;
+doneCB(AuServer *aud, AuEventHandlerRec *handler, AuEvent *ev, AuPointer data)
 {
     AuBool         *done = (AuBool *) data;
 
@@ -53,9 +49,7 @@
 }
 
 int
-main(argc, argv)
-int             argc;
-char          **argv;
+main(int argc, char **argv)
 {
     Sound           s;
     char           *audioServer = NULL,
Index: util/soundtoh.c
===================================================================
--- util/soundtoh.c	(revision 5)
+++ util/soundtoh.c	(revision 6)
@@ -54,8 +54,7 @@
 }
 
 static char    *
-convertQuotes(str)
-char           *str;
+convertQuotes(char *str)
 {
     int             len = strlen(str) * 2 + 1;	/* more then enough for
 						 * string */
@@ -78,9 +77,7 @@
 }
 
 int
-main(argc, argv)
-int             argc;
-char          **argv;
+main(int argc, char **argv)
 {
     Sound           s;
     char           *p,


More information about the Nas mailing list