]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: make some structures constant
authorStephen Hemminger <shemminger@vyatta.com>
Mon, 21 Dec 2009 09:54:58 +0000 (12:54 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 21 Dec 2009 10:03:51 +0000 (13:03 +0300)
* 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

isisd/isis_pdu.c
lib/command.c
lib/prefix.c

index 4311a9057f2507185b097bc95ab2200bee7599d8..a2ab0649d1bf055a933ccc94ad82a5c3e7b06bca 100644 (file)
@@ -64,7 +64,7 @@ extern struct isis *isis;
 #endif /* PNBBY */
 
 /* Utility mask array. */
-static u_char maskbit[] = {
+static const u_char maskbit[] = {
   0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff
 };
 
index 31c067a36a91438e95439ebc829d7838b2165082..478125f20a76e552f9071596862d9860461a8afb 100644 (file)
@@ -82,14 +82,14 @@ static struct cmd_node config_node =
 };
 
 /* 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 struct facility_map {
 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 @@ facility_name(int facility)
 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 @@ install_element (enum node_type ntype, struct cmd_element *cmd)
   cmd->cmdsize = cmd_cmdsize (cmd->strvec);
 }
 
-static unsigned char itoa64[] =        
+static const unsigned char itoa64[] =
 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
 
 static void
index 2afaa09c76635dc3d35fba2a108e23b3f9482018..c85e65949cf46a18b2ec7fd26f1c5ac2435826a9 100644 (file)
@@ -29,7 +29,7 @@
 #include "log.h"
 \f
 /* Maskbit. */
-static u_char maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0,
+static const u_char maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0,
                                 0xf8, 0xfc, 0xfe, 0xff};
 
 /* Number of bits in prefix type. */