From: Eric S. Raymond Date: Tue, 19 Oct 2010 05:12:11 +0000 (-0400) Subject: Bring C up to C99 level. X-Git-Tag: 3.10~5 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=53bab887fddb7d0219cff68fb4ff181b0c211bd6;p=ascii.git Bring C up to C99 level. --- diff --git a/ascii.c b/ascii.c index 1c621cd..30fc83f 100644 --- a/ascii.c +++ b/ascii.c @@ -37,7 +37,6 @@ static string cnames[128][16] = } }; -/******************************************************************/ static int atob(str) /* ASCII-to-binary conversion */ char *str; @@ -56,7 +55,6 @@ char *str; return(val); } -/*********************************************************/ void showHelp(FILE *out, char *progname) { @@ -68,9 +66,7 @@ showHelp(FILE *out, char *progname) exit(0); } -/*********************************************************/ -void -process_options(int argc, char *argv[], char * opt_string) +static void process_options(int argc, char *argv[], char * opt_string) { int op; @@ -107,7 +103,6 @@ process_options(int argc, char *argv[], char * opt_string) }/*while*/ } -/******************************************************************/ static char *btoa(unsigned int val) /* binary-to-ASCII conversion */ { @@ -131,7 +126,6 @@ static char *btoa(unsigned int val) return(rp); } -/******************************************************************/ static void speak(unsigned int ch) /* list all the names for a given character */ { @@ -160,7 +154,7 @@ static void speak(unsigned int ch) return; } -if (isprint((int)ch)) + if (isprint((int)ch)) (void) printf("prints as `%s'\n", *ptr++); else if (iscntrl((char)ch) || ch == 0x7F) { @@ -200,7 +194,6 @@ if (isprint((int)ch)) (void) putchar('\n'); } -/******************************************************************/ static int stricmp(char *s, char *t) /* case-blind string compare */ { @@ -209,7 +202,6 @@ static int stricmp(char *s, char *t) return(*t - *s); } -/******************************************************************/ static void ascii(char *str) { int ch, hi, lo; @@ -355,9 +347,7 @@ static void ascii(char *str) } /* outer if */ } -/******************************************************************/ -void -print_table(unsigned short delivery) +void print_table(unsigned short delivery) { static unsigned short i, j, len; char separator[]= " "; @@ -384,7 +374,6 @@ print_table(unsigned short delivery) } -/*----------------------------------------- M A I N --------------*/ int main(int argc, char **argv) { char *optstring="tshvxod" ; @@ -399,6 +388,7 @@ int main(int argc, char **argv) ascii(argv[optind++]); exit(0); } + /******************************************************************/ /* ascii.c ends here */