]> git.puffer.fish Git - matthieu/frr.git/commitdiff
[cleanup] Allow message tables to be constant
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 15 May 2009 16:47:34 +0000 (09:47 -0700)
committerPaul Jakma <paul@quagga.net>
Thu, 18 Jun 2009 19:18:29 +0000 (20:18 +0100)
Avoid bugs, and improve cache locality by allowing message lists
to be read/only.

lib/log.c
lib/log.h

index f7a36851395700b06768b9fca37fe28a6da2a519..8c3e2ddce0808df5d416ae39d9325a403613d91c 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -771,7 +771,7 @@ lookup (const struct message *mes, int key)
  * provided otherwise.
  */
 const char *
-mes_lookup (struct message *meslist, int max, int index, const char *none)
+mes_lookup (const struct message *meslist, int max, int index, const char *none)
 {
   int pos = index - meslist[0].key;
   
index 86097919ab7392a859454d6bb3206ee0b37368c1..2dd1d313793c2bed264aa4384df5f8cbc16e2bd1 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
@@ -151,7 +151,7 @@ extern int zlog_rotate (struct zlog *);
 #define LOOKUP(x, y) mes_lookup(x, x ## _max, y, "(no item found)")
 
 extern const char *lookup (const struct message *, int);
-extern const char *mes_lookup (struct message *meslist, 
+extern const char *mes_lookup (const struct message *meslist, 
                                int max, int index,
                                const char *no_item);