]> thyrsus.com Git - ascii.git/commitdiff
Bring C up to C99 level.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 19 Oct 2010 05:12:11 +0000 (01:12 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 19 Oct 2010 05:12:11 +0000 (01:12 -0400)
ascii.c

diff --git a/ascii.c b/ascii.c
index 1c621cda9f74b38a45929bb2b644df6d27bb5642..30fc83f82d9bdd63df68ff23abd3113133fed9e4 100644 (file)
--- 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 */