Make the lookup tables const.

Index: morse.c
===================================================================
RCS file: /cvs/src/games/morse/morse.c,v
retrieving revision 1.14
diff -u -r1.14 morse.c
--- morse.c     27 Oct 2009 23:59:26 -0000      1.14
+++ morse.c     18 Feb 2012 16:47:27 -0000
@@ -35,7 +35,7 @@
 #include <string.h>
 #include <unistd.h>
 
-static char
+static const char
        *digit[] = {
        "-----",
        ".----",
@@ -80,7 +80,9 @@
 struct punc {
        char c;
        char *morse;
-} other[] = {
+};
+
+static const struct punc other[] = {
        { ',', "--..--" },
        { '.', ".-.-.-" },
        { '?', "..--.." },
@@ -100,8 +102,8 @@
 };
 
 void   morse(int);
-void   decode(char *);
-void   show(char *);
+void   decode(const char *);
+void   show(const char *);
 
 static int sflag = 0;
 static int dflag = 0;
@@ -206,7 +208,7 @@
 }
 
 void
-decode(char *s)
+decode(const char *s)
 {
        int i;
        
@@ -235,7 +237,7 @@
 
 
 void
-show(char *s)
+show(const char *s)
 {
        if (sflag)
                printf(" %s", s);

Reply via email to