From 981b24db5e7ccc289c2e39a2954cf1ff261442b9 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Thu, 28 Sep 2006 22:36:23 +0000 Subject: rt_names.c: move few strings into rodata --- networking/libiproute/rt_names.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'networking') diff --git a/networking/libiproute/rt_names.c b/networking/libiproute/rt_names.c index 5181ba4..c0f7907 100644 --- a/networking/libiproute/rt_names.c +++ b/networking/libiproute/rt_names.c @@ -16,7 +16,7 @@ #include #include "rt_names.h" -static void rtnl_tab_initialize(char *file, char **tab, int size) +static void rtnl_tab_initialize(char *file, const char **tab, int size) { char buf[512]; FILE *fp; @@ -51,7 +51,7 @@ static void rtnl_tab_initialize(char *file, char **tab, int size) } -static char * rtnl_rtprot_tab[256] = { +static const char * rtnl_rtprot_tab[256] = { "none", "redirect", "kernel", @@ -96,7 +96,7 @@ const char * rtnl_rtprot_n2a(int id, char *buf, int len) int rtnl_rtprot_a2n(uint32_t *id, char *arg) { - static char *cache = NULL; + static const char *cache = NULL; static unsigned long res; char *end; int i; @@ -128,7 +128,7 @@ int rtnl_rtprot_a2n(uint32_t *id, char *arg) -static char * rtnl_rtscope_tab[256] = { +static const char * rtnl_rtscope_tab[256] = { "global", }; @@ -163,7 +163,7 @@ const char * rtnl_rtscope_n2a(int id, char *buf, int len) int rtnl_rtscope_a2n(uint32_t *id, char *arg) { - static char *cache = NULL; + static const char *cache = NULL; static unsigned long res; char *end; int i; @@ -195,7 +195,7 @@ int rtnl_rtscope_a2n(uint32_t *id, char *arg) -static char * rtnl_rtrealm_tab[256] = { +static const char * rtnl_rtrealm_tab[256] = { "unknown", }; @@ -210,7 +210,7 @@ static void rtnl_rtrealm_initialize(void) int rtnl_rtrealm_a2n(uint32_t *id, char *arg) { - static char *cache = NULL; + static const char *cache = NULL; static unsigned long res; char *end; int i; @@ -242,7 +242,7 @@ int rtnl_rtrealm_a2n(uint32_t *id, char *arg) -static char * rtnl_rtdsfield_tab[256] = { +static const char * rtnl_rtdsfield_tab[256] = { "0", }; @@ -274,7 +274,7 @@ const char * rtnl_dsfield_n2a(int id, char *buf, int len) int rtnl_dsfield_a2n(uint32_t *id, char *arg) { - static char *cache = NULL; + static const char *cache = NULL; static unsigned long res; char *end; int i; @@ -303,4 +303,3 @@ int rtnl_dsfield_a2n(uint32_t *id, char *arg) *id = res; return 0; } - -- cgit v1.1