[nas] [PATCHES] more K&R -> ANSI C changes
Erik Auerswald
auerswal at unix-ag.uni-kl.de
Mon Jul 17 18:39:02 MDT 2006
Hi,
the attached patches change more K&R style function declarations to ANSI C.
Each patch changes just one of the client programs. There is still a lot
to do to eliminate all of the K&R cruft from the clients...
I just checked that the programs still compile so you should be extra
careful not to break anything before commiting these patches. ;-)
Erik
-------------- next part --------------
Index: clients/audio/auconvert/auconvert.c
===================================================================
--- clients/audio/auconvert/auconvert.c (revision 155)
+++ clients/audio/auconvert/auconvert.c (working copy)
@@ -80,9 +80,7 @@
};
static void
-fatalError(message, arg)
-char *message,
- *arg;
+fatalError(char *message, char *arg)
{
fprintf(stderr, message, arg);
fprintf(stderr, "\n");
@@ -90,7 +88,7 @@
}
static void
-usage()
+usage(void)
{
int i;
@@ -114,8 +112,7 @@
}
static int
-convertDataFormat(s)
-char *s;
+convertDataFormat(char *s)
{
int f,
i;
@@ -128,8 +125,7 @@
}
static int
-convertFileFormat(s)
-char *s;
+convertFileFormat(char *s)
{
int f;
@@ -142,19 +138,14 @@
}
static void
-adjustVolume(count, data, v)
-int count;
-short *data;
-float v;
+adjustVolume(int count, short *data, float v)
{
while (count--)
*data++ *= v;
}
static void
-maxVolume(count, data)
-int count;
-short *data;
+maxVolume(int count, short *data)
{
int n = count;
short *p = data,
@@ -174,18 +165,14 @@
}
static void
-rateConvert(in, out, numBytes, data)
-Sound in,
- out;
-int numBytes;
-char *data;
+rateConvert(Sound in, Sound out, int numBytes, char *data)
{
int size = SoundBytesPerSample(out),
phase = 0;
char *last;
if (!(last = (char *) malloc(size)))
- fatalError("Malloc error");
+ fatalError("Malloc error", NULL);
while (numBytes)
{
@@ -206,16 +193,14 @@
phase += SoundSampleRate(in);
if (SoundWriteFile(last, size, out) != size)
- fatalError("Error writing output file");
+ fatalError("Error writing output file", NULL);
}
free(last);
}
int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
{
FILE *fp;
char *arg,
@@ -281,10 +266,10 @@
else
{
if (fileFormat == -1)
- fatalError("You must specify a file format for raw files");
+ fatalError("You must specify a file format for raw files", NULL);
if (!rate)
- fatalError("You must specify a sampling rate for raw files");
+ fatalError("You must specify a sampling rate for raw files", NULL);
if (!(fp = fopen(inputFile, "r")))
fatalError("Can't open input file %s", inputFile);
@@ -309,19 +294,19 @@
numBytes = SoundNumSamples(in) * SoundNumTracks(in) * sizeof(short);
if (!(data = (short *) malloc(numBytes)))
- fatalError("Malloc error");
+ fatalError("Malloc error", NULL);
if (rawFormat == -1)
{
if (SoundReadFile((char *) data, SoundNumBytes(in), in) !=
SoundNumBytes(in))
- fatalError("Error reading input file");
+ fatalError("Error reading input file", NULL);
}
else if (fread(data, 1, SoundNumBytes(in), fp) != SoundNumBytes(in))
- fatalError("Error reading input file");
+ fatalError("Error reading input file", NULL);
if (AuConvertDataToShort(SoundDataFormat(in), SoundNumBytes(in), data))
- fatalError("Error converting input data");
+ fatalError("Error converting input data", NULL);
if (!strncasecmp(volume, "max", 3))
maxVolume(numBytes / sizeof(short), data);
@@ -347,15 +332,15 @@
comment ? comment : SoundComment(in));
if (!out)
- fatalError("Error creating output sound");
+ fatalError("Error creating output sound", NULL);
if (AuConvertShortToData(outputDataFormat, numBytes, data))
- fatalError("Error converting output data");
+ fatalError("Error converting output data", NULL);
if (!outputFile && strcmp(inputFile, "-"))
{
if (!(outName = (char *) malloc(strlen(inputFile) + 7)))
- fatalError("Malloc error");
+ fatalError("Malloc error", NULL);
sprintf(outName, "%sXXXXXX", inputFile);
#if defined(HAS_MKSTEMP)
@@ -380,13 +365,13 @@
if (SoundSampleRate(in) == SoundSampleRate(out))
{
if (SoundWriteFile((char *) data, numBytes, out) != numBytes)
- fatalError("Error writing output file");
+ fatalError("Error writing output file", NULL);
}
else
rateConvert(in, out, numBytes, (char *)data);
if (SoundCloseFile(out))
- fatalError("Error closing output file");
+ fatalError("Error closing output file", NULL);
if (!outputFile)
{
@@ -395,7 +380,7 @@
close(fd);
#endif
if (rename(outName, inputFile))
- fatalError("Error renaming temp file");
+ fatalError("Error renaming temp file", NULL);
}
exit(0);
-------------- next part --------------
Index: clients/audio/auctl/execute.c
===================================================================
--- clients/audio/auctl/execute.c (revision 155)
+++ clients/audio/auctl/execute.c (working copy)
@@ -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,8 @@
} NameTable;
static int
-_do_parse (aud, argc, argv, title, tab, ntab, data)
- AuServer *aud;
- int argc;
- char **argv;
- _AuConst char *title;
- NameTable *tab;
- int ntab;
- AuPointer data;
+_do_parse (AuServer *aud, int argc, char **argv, _AuConst char *title,
+ NameTable *tab, int ntab, AuPointer data)
{
int i;
int len;
@@ -111,10 +101,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 +118,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 +133,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 +170,8 @@
/* 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 +196,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 +240,8 @@
/* 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 +273,8 @@
/* 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 +282,15 @@
/* 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 _AuConst char * _AuConst msg[] = {
"The following commands are supported:",
@@ -356,20 +320,14 @@
/* 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 +407,8 @@
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 +467,7 @@
-static char *_lower_word (s)
- register char *s;
+static char *_lower_word (register char *s)
{
register char *cp;
@@ -525,9 +479,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;
-------------- next part --------------
Index: clients/audio/audemo/audemo.c
===================================================================
--- clients/audio/audemo/audemo.c (revision 155)
+++ clients/audio/audemo/audemo.c (working copy)
@@ -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,15 +300,12 @@
}
static ElementListId
-AddToElementList(flow, volumeElement, monitorElement)
-AuFlowID flow;
-int volumeElement,
- monitorElement;
+AddToElementList(AuFlowID flow, int volumeElement, int monitorElement)
{
ElementListPtr p;
if (!(p = (ElementListPtr) malloc(sizeof(ElementListRec))))
- fatalError("malloc error in AddToElementList");
+ fatalError("malloc error in AddToElementList", NULL);
p->flow = flow;
p->volumeElement = volumeElement;
@@ -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;
@@ -394,12 +384,8 @@
#define MonitorNotifyEventMax(e, i) \
((short *) &(e)->data)[i * (e)->num_fields + 1]
-static void
-meterCB(aud, handler, ev, globals)
-AuServer *aud;
-AuEventHandlerRec *handler;
-AuEvent *ev;
-GlobalDataPtr globals;
+static void 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;
@@ -644,7 +611,7 @@
if (buf->numBuckets &&
!(buf->bucketText = (char **) malloc(sizeof(char *) * buf->numBuckets)))
- fatalError("malloc error in bucketQueryCB");
+ fatalError("malloc error in bucketQueryCB", NULL);
for (i = 0; i < buf->numBuckets; i++)
{
@@ -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;
@@ -1226,7 +1134,7 @@
}
if (!(p = buf = (char *) malloc(2000 + strlen(SoundComment(s)))))
- fatalError("Can't malloc text in samplesCB");
+ fatalError("Can't malloc text in samplesCB", NULL);
PRINT(p, " Filename: %s\n", globals->fileNames[lastSelection]);
PRINT(p, "File Format: %s\n", SoundFileFormatString(s));
@@ -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;
@@ -1271,7 +1175,7 @@
if (!(parms = (AuElementParameters *)
malloc(sizeof(AuElementParameters) * ElementCount)))
- fatalError("malloc error in adjustVolume");
+ fatalError("malloc error in adjustVolume", NULL);
while (p)
{
@@ -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;
@@ -1793,7 +1670,7 @@
if (!(globals->aud =
AuOpenServer(audioServerString, 0, NULL, 0, NULL, NULL)))
- fatalError("Can't connect to audio server");
+ fatalError("Can't connect to audio server", NULL);
globals->inputDeviceId = (AuDeviceID) 0;
@@ -1824,9 +1701,7 @@
#endif /* XT */
static void
-fatalError(message, arg)
-char *message,
- *arg;
+fatalError(char *message, char *arg)
{
fprintf(stderr, message, arg);
fprintf(stderr, "\n");
@@ -1834,9 +1709,7 @@
}
static int
-sortRoutine(ap, bp)
-_AuConst void *ap,
- *bp;
+sortRoutine(_AuConst void *ap, _AuConst void *bp)
{
_AuConst char **a = (_AuConst char **)ap;
_AuConst char **b = (_AuConst char **)bp;
@@ -1845,9 +1718,7 @@
}
static char **
-makeFileList(fileNames, nfiles)
-char **fileNames;
-int nfiles;
+makeFileList(char **fileNames, int nfiles)
{
char **fileList,
*p;
@@ -1856,7 +1727,7 @@
qsort(fileNames, nfiles, sizeof(char *), sortRoutine);
if (!(fileList = (char **) malloc(sizeof(char *) * nfiles)))
- fatalError("Can't malloc file list in makeFileList");
+ fatalError("Can't malloc file list in makeFileList", NULL);
for (i = 0; i < nfiles; i++)
{
@@ -1873,7 +1744,7 @@
fileList[i] = (char *) realloc(fileList[i], strlen(fileList[i]) + 1);
if (!fileList[i])
- fatalError("Can't realloc file list in makeFileList");
+ fatalError("Can't realloc file list in makeFileList", NULL);
}
return fileList;
@@ -1881,9 +1752,7 @@
#ifndef WIN32
static FILE *
-startFind(dir, template)
-char *dir,
- *template;
+startFind(char *dir, char *template)
{
char *cmd,
*p;
@@ -1921,10 +1790,7 @@
#endif /* !WIN32 */
static int
-getFileNames(dir, fileNames, template)
-char *dir,
- ***fileNames,
- *template;
+getFileNames(char *dir, char ***fileNames, char *template)
{
#ifndef WIN32
int files;
@@ -1935,7 +1801,7 @@
*fileNames = (char **) malloc(1);
if (!fileNames)
- fatalError("Can't malloc file names in getFileNames");
+ fatalError("Can't malloc file names in getFileNames", NULL);
if (!(fp = startFind(dir, template)))
{
@@ -1951,7 +1817,7 @@
(char **) realloc(*fileNames, sizeof(char *) * (files + 1));
if (!*fileNames)
- fatalError("Can't realloc file names in getFileNames");
+ fatalError("Can't realloc file names in getFileNames", NULL);
line[strlen(line) - 1] = 0; /* zap the trailing newline */
(*fileNames)[files++] = (char *) strdup(line);
-------------- next part --------------
Index: clients/audio/audial/audial.c
===================================================================
--- clients/audio/audial/audial.c (revision 155)
+++ clients/audio/audial/audial.c (working copy)
@@ -161,9 +161,7 @@
#endif /* NEEDUSLEEP */
static void
-fatalError(message, arg1)
-char *message,
- *arg1;
+fatalError(char *message, char *arg1)
{
fprintf(stderr, message, arg1);
fprintf(stderr, "\n");
@@ -300,7 +298,8 @@
}
static void
-doDial(AuServer *aud, char *dialString, int volume, int pause, int spacing, int duration)
+doDial(AuServer *aud, char *dialString, int volume, int pause, int spacing,
+ int duration)
{
AuDeviceID outputDevice = AuNone;
AuFlowID flow;
@@ -312,7 +311,7 @@
break;
if (i == AuServerNumElementTypes(aud))
- fatalError("audio server does not support the wave form element type");
+ fatalError("audio server does not support the wave form element type", NULL);
/* make sure the server supports sine waves */
for (i = 0; i < AuServerNumWaveForms(aud); i++)
@@ -320,7 +319,7 @@
break;
if (i == AuServerNumWaveForms(aud))
- fatalError("audio server does not support sine waves");
+ fatalError("audio server does not support sine waves", NULL);
/* look for an appropriate output device */
for (i = 0; i < AuServerNumDevices(aud); i++)
@@ -333,7 +332,7 @@
}
if (outputDevice == AuNone)
- fatalError("Couldn't find an appropriate output device");
+ fatalError("Couldn't find an appropriate output device", NULL);
flow = createDTMFflow(aud, outputDevice, volume, duration);
@@ -492,11 +491,11 @@
}
if (inputDevice == AuNone)
- fatalError("Can't find an appropriate input device");
+ fatalError("Can't find an appropriate input device", NULL);
if (!(buf = (char *) malloc(EXPORT_SIZE *
AuSizeofFormat(AuFormatLinearUnsigned8))))
- fatalError("malloc error in doRecognize()");
+ fatalError("malloc error in doRecognize()", NULL);
/* save old gain and line mode values */
da = AuGetDeviceAttributes(aud, inputDevice, NULL);
@@ -652,11 +651,11 @@
}
if (usage || (!dialString && !recognize))
- fatalError(USAGE);
+ fatalError(USAGE, NULL);
/* open the audio server */
if (!(aud = AuOpenServer(serverName, 0, NULL, 0, NULL, NULL)))
- fatalError("Can't connect to audio server");
+ fatalError("Can't connect to audio server", NULL);
if (recognize)
doRecognize(aud, mic, gain, time);
-------------- next part --------------
Index: clients/audio/auinfo/auinfo.c
===================================================================
--- clients/audio/auinfo/auinfo.c (revision 155)
+++ clients/audio/auinfo/auinfo.c (working copy)
@@ -310,15 +310,10 @@
}
-static void _print_names (aud, tab, nents, title, total, getvaliter, p, isbit)
- AuServer *aud;
- NameTable *tab;
- int nents;
- _AuConst char *title;
- int total;
- int (*getvaliter) PROTO((AuServer *, int, AuPointer));
- AuPointer p;
- AuBool isbit;
+static void _print_names (AuServer *aud, NameTable *tab, int nents,
+ _AuConst char *title, int total,
+ int (*getvaliter)(AuServer *, int, AuPointer),
+ AuPointer p, AuBool isbit)
{
int i;
char fmt[20];
-------------- next part --------------
Index: clients/audio/aupanel/aupanel.c
===================================================================
--- clients/audio/aupanel/aupanel.c (revision 155)
+++ clients/audio/aupanel/aupanel.c (working copy)
@@ -149,9 +149,7 @@
};
static void
-fatalError(message, arg)
-char *message,
- *arg;
+fatalError(char *message, char *arg)
{
fprintf(stderr, message, arg);
fprintf(stderr, "\n");
@@ -366,7 +364,7 @@
g->da = AuListDevices(g->aud, 0, NULL, &g->numDevices, NULL);
if (!g->numDevices)
- fatalError("no devices");
+ fatalError("no devices", NULL);
for (i = 0; i < g->numDevices; i++)
{
@@ -443,15 +441,15 @@
if (!strncmp(argv[1], "-a", 2))
audioServer = argv[2];
else
- fatalError(USAGE);
+ fatalError(USAGE, NULL);
else if (argc != 1)
- fatalError(USAGE);
+ fatalError(USAGE, NULL);
if (!(g->aud = AuOpenServer(audioServer, 0, NULL, 0, NULL, NULL)))
- fatalError("Can't connect to audio server");
+ fatalError("Can't connect to audio server", NULL);
if(!(g->restoreValues = calloc(AuServerNumDevices(g->aud), sizeof(int))))
- fatalError("Out of memory");
+ fatalError("Out of memory", NULL);
createWidgets(g);
XtRealizeWidget(g->top);
More information about the Nas
mailing list