lib: make some structures constant
* isisd/isis_pdu.c
* maskbit: this pre-initialized array is not modified
* lib/prefix.c
* maskbit: idem
* lib/command.c
* facility_map: idem
* itoa64: idem
* default_motd: make local var static
* facility_name(): update local var accordingly
* facility_match(): idem
diff --git a/lib/command.c b/lib/command.c
index 31c067a..478125f 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -82,14 +82,14 @@
};
/* Default motd string. */
-const char *default_motd =
+static const char *default_motd =
"\r\n\
Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\
" QUAGGA_COPYRIGHT "\r\n\
\r\n";
-static struct facility_map {
+static const struct facility_map {
int facility;
const char *name;
size_t match;
@@ -122,7 +122,7 @@
static const char *
facility_name(int facility)
{
- struct facility_map *fm;
+ const struct facility_map *fm;
for (fm = syslog_facilities; fm->name; fm++)
if (fm->facility == facility)
@@ -133,7 +133,7 @@
static int
facility_match(const char *str)
{
- struct facility_map *fm;
+ const struct facility_map *fm;
for (fm = syslog_facilities; fm->name; fm++)
if (!strncmp(str,fm->name,fm->match))
@@ -506,7 +506,7 @@
cmd->cmdsize = cmd_cmdsize (cmd->strvec);
}
-static unsigned char itoa64[] =
+static const unsigned char itoa64[] =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static void