Explicitly constify a bunch of static data declarations which were
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 10 Mar 2005 10:20:36 +0000 (10:20 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Thu, 10 Mar 2005 10:20:36 +0000 (10:20 +0000)
conceptually const but not declared as such. Halibut is now back to
the practically-speaking-pointless but rather satisfying status of
having no global writable data whatsoever :-)

git-svn-id: svn://svn.tartarus.org/sgt/halibut@5476 cda61777-01e9-0310-a592-d414129be87e

bk_html.c
help.c
licence.c

index 4da897f..3cd8eca 100644 (file)
--- a/bk_html.c
+++ b/bk_html.c
@@ -2101,7 +2101,7 @@ static char *html_sanitise_fragment(htmlfilelist *files, htmlfile *file,
 
     /* If there's nothing left, make something valid up */
     if (!*text) {
-       static const char *anonfrag = "anon";
+       static const char *const anonfrag = "anon";
        text = sresize(text, lenof(anonfrag), char);
        strcpy(text, anonfrag);
     }
diff --git a/help.c b/help.c
index e31f784..8db2859 100644 (file)
--- a/help.c
+++ b/help.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include "halibut.h"
 
-static char *helptext[] = {
+static const char *const helptext[] = {
     "usage:   halibut [options] files",
     "options: --text[=filename]     generate plain text output",
     "         --html[=filename]     generate XHTML output",
@@ -24,19 +24,19 @@ static char *helptext[] = {
     NULL
 };
 
-static char *usagetext[] = {
+static const char *const usagetext[] = {
     "usage: halibut [--format[=filename]] [options] file.but [file.but...]",
     NULL
 };
 
 void help(void) {
-    char **p;
+    const char *const *p;
     for (p = helptext; *p; p++)
        puts(*p);
 }
 
 void usage(void) {
-    char **p;
+    const char *const *p;
     for (p = usagetext; *p; p++)
        puts(*p);
 }
index b53ae97..386259b 100644 (file)
--- a/licence.c
+++ b/licence.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-static char *licencetext[] = {
+static const char *const licencetext[] = {
     "Halibut is copyright (c) 1999-2005 Simon Tatham and James Aylett.",
     "",
     "Permission is hereby granted, free of charge, to any person",
@@ -30,7 +30,7 @@ static char *licencetext[] = {
 };
 
 void licence(void) {
-    char **p;
+    const char *const *p;
     for (p = licencetext; *p; p++)
        puts(*p);
 }