[master] 9dbcdff Constify a couple of largish tables.

Poul-Henning Kamp phk at FreeBSD.org
Sat Jan 11 20:18:16 CET 2014


commit 9dbcdff45325233f00d90efd0a2c350e8ea9cd4a
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sat Jan 11 19:18:04 2014 +0000

    Constify a couple of largish tables.

diff --git a/include/vapi/vsl.h b/include/vapi/vsl.h
index fee24d1..a01360f 100644
--- a/include/vapi/vsl.h
+++ b/include/vapi/vsl.h
@@ -119,12 +119,12 @@ typedef void VSL_tagfind_f(int tag, void *priv);
 	 *   priv: The priv argument
 	 */
 
-extern const char *VSL_tags[SLT__MAX];
+extern const char * const VSL_tags[SLT__MAX];
 	/*
 	 * Tag to string array.  Contains NULL for invalid tags.
 	 */
 
-extern unsigned VSL_tagflags[SLT__MAX];
+extern const unsigned VSL_tagflags[SLT__MAX];
 	/*
 	 * Tag flags array.
 	 */
diff --git a/lib/libvarnishapi/vsl.c b/lib/libvarnishapi/vsl.c
index 4bbfc05..3d659f5 100644
--- a/lib/libvarnishapi/vsl.c
+++ b/lib/libvarnishapi/vsl.c
@@ -57,13 +57,13 @@
 
 /*--------------------------------------------------------------------*/
 
-const char *VSL_tags[SLT__MAX] = {
+const char * const VSL_tags[SLT__MAX] = {
 #  define SLTM(foo,flags,sdesc,ldesc)       [SLT_##foo] = #foo,
 #  include "tbl/vsl_tags.h"
 #  undef SLTM
 };
 
-unsigned VSL_tagflags[SLT__MAX] = {
+const unsigned VSL_tagflags[SLT__MAX] = {
 #  define SLTM(foo, flags, sdesc, ldesc)	[SLT_##foo] = flags,
 #  include "tbl/vsl_tags.h"
 #  undef SLTM



More information about the varnish-commit mailing list