Browse Source

[cleanup] Allow message tables to be constant

Avoid bugs, and improve cache locality by allowing message lists
to be read/only.
Stephen Hemminger 11 years ago
parent
commit
8e4c09307d
2 changed files with 2 additions and 2 deletions
  1. 1 1
      lib/log.c
  2. 1 1
      lib/log.h

+ 1 - 1
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;
   

+ 1 - 1
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);