From 1adcf7a4650fe8c598ea13064c3efb253c36b581 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 24 Jan 2005 19:40:56 +0000 Subject: [PATCH] ANSIfy the code. --- qso/QSO.c | 47 +++++++++++++++++++++-------------------------- qso/make_fre.c | 2 +- qso/put_form.c | 14 +++++++------- qso/util.c | 12 ++++-------- 4 files changed, 33 insertions(+), 42 deletions(-) diff --git a/qso/QSO.c b/qso/QSO.c index 0ab534f..764d53a 100644 --- a/qso/QSO.c +++ b/qso/QSO.c @@ -105,19 +105,15 @@ #include -/* -#include - */ #include -char *A_Or_An (); - -int License_Seed (); +char *A_Or_An (char *); +char *Choose (char *Words[], int Number); +int License_Seed (void); int their_age; /* PERSON'S AGE, SO THEY AREN'T LICENSED MORE * THAN THEIR AGE */ - extern char *Transceiver[]; extern char *Antenna[]; extern char *UpFeet[]; @@ -173,7 +169,6 @@ char *FrqCallmisc[] = 0 }; -char *Choose (); int NCALLMISC; int NNUMMISC; int NMISC; @@ -187,13 +182,13 @@ int NRST; */ void -PutMisc () +PutMisc (void) { printf ("%s\n", Choose (Miscellaneous, NMISC)); } void -PutThanks () +PutThanks (void) { switch (Roll (6)) { @@ -220,7 +215,7 @@ PutThanks () } void -PutName () +PutName (void) { switch (Roll (6)) { @@ -243,7 +238,7 @@ PutName () } void -PutJob () +PutJob (void) { switch (Roll (20)) { @@ -273,7 +268,7 @@ PutJob () } void -PutAge () +PutAge (void) { their_age = Roll (60) + 16; @@ -295,7 +290,7 @@ PutAge () } void -PutLicense () +PutLicense (void) { int get_years_licence; @@ -348,13 +343,13 @@ int get_years_licence; } void -PutTemperature () +PutTemperature (void) { printf ("Temperature is %d.\n", Roll (80) + 10); } void -PutWeather1 () +PutWeather1 (void) { switch (Roll (17)) { @@ -427,7 +422,7 @@ PutWeather1 () } void -PutWeather2 () +PutWeather2 (void) { switch (Roll (10)) @@ -477,7 +472,7 @@ PutWeather2 () } void -PutWeather () +PutWeather (void) { switch (Roll (4)) { @@ -492,7 +487,7 @@ PutWeather () } void -PutCityState () +PutCityState (void) { switch (Roll (6)) { @@ -513,7 +508,7 @@ PutCityState () } void -PutLocation () +PutLocation (void) { switch (Roll (5)) @@ -535,7 +530,7 @@ PutLocation () } void -PutRig () +PutRig (void) { switch (Roll (19)) @@ -632,7 +627,7 @@ PutRig () } void -PutRST () +PutRST (void) { register char *TheRST; @@ -676,7 +671,7 @@ register char *TheRST; void -PutQ_And_Freq () +PutQ_And_Freq (void) { switch (Roll (8)) { @@ -711,7 +706,7 @@ PutQ_And_Freq () } void -PutFirstCallsign () +PutFirstCallsign (void) { Sender = Choose (CallSign, NCALLSIGN); Receiver = Choose (CallSign, NCALLSIGN); @@ -719,12 +714,12 @@ PutFirstCallsign () } void -PutLastCallsign () +PutLastCallsign (void) { printf ("%s de %s\n", Receiver, Sender); } -main () +main (int argc, char **argv) { NXCVR = CountStrings (Transceiver); diff --git a/qso/make_fre.c b/qso/make_fre.c index baa9c93..412a463 100644 --- a/qso/make_fre.c +++ b/qso/make_fre.c @@ -5,7 +5,7 @@ #define NUM_BAND 4 int -make_freq () +make_freq (void) { switch (Roll (NUM_BAND + 2)) { diff --git a/qso/put_form.c b/qso/put_form.c index 30faa4d..f38fc60 100644 --- a/qso/put_form.c +++ b/qso/put_form.c @@ -1,7 +1,7 @@ #include void -PutForm0 () +PutForm0 (void) { PutRST (); PutName (); @@ -17,7 +17,7 @@ PutForm0 () } void -PutForm1 () +PutForm1 (void) { PutLocation (); PutRST (); @@ -33,7 +33,7 @@ PutForm1 () } void -PutForm2 () +PutForm2 (void) { PutThanks (); PutRST (); @@ -48,7 +48,7 @@ PutForm2 () } void -PutForm3 () +PutForm3 (void) { PutLocation (); PutRST (); @@ -66,7 +66,7 @@ PutForm3 () } void -PutForm4 () +PutForm4 (void) { PutThanks (); @@ -84,7 +84,7 @@ PutForm4 () } void -PutForm5 () +PutForm5 (void) { PutLocation (); PutRST (); @@ -99,7 +99,7 @@ PutForm5 () PutQ_And_Freq (); } -PutQSO () +PutQSO (void) { /* printf("VVV VVV\n") ; */ PutFirstCallsign (); diff --git a/qso/util.c b/qso/util.c index 5b70b62..4fde89f 100644 --- a/qso/util.c +++ b/qso/util.c @@ -6,8 +6,7 @@ extern int their_age; int -CountStrings (StringVector) - char *StringVector[]; +CountStrings (char *StringVector[]) /* * Count the number of string values in the supplied vector * of pointers. Start with the first pointer and stop when @@ -27,8 +26,7 @@ register int Count; } int -Roll (Number) - int Number; +Roll (int Number) { int new_tmp; double tmp_val; @@ -41,7 +39,7 @@ double drand48 (); } int -License_Seed () +License_Seed (void) { if (their_age > 20) return (20); @@ -51,9 +49,7 @@ License_Seed () } char * -Choose (Words, Number) - char *Words[]; - int Number; +Choose (char *Words[], int Number) { return (Words[Roll (Number)]); } -- 2.43.0