This changes allows the compiler to put 'names' in a read-only section.
Signed-off-by: Ben Pfaff <[email protected]>
---
lib/ofp-util.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/ofp-util.c b/lib/ofp-util.c
index 42c3613..4d3fe9e 100644
--- a/lib/ofp-util.c
+++ b/lib/ofp-util.c
@@ -4235,7 +4235,7 @@ size_t ofputil_count_phy_ports(uint8_t ofp_version,
struct ofpbuf *b)
int
ofputil_action_code_from_name(const char *name)
{
- static const char *names[OFPUTIL_N_ACTIONS] = {
+ static const char *const names[OFPUTIL_N_ACTIONS] = {
NULL,
#define OFPAT10_ACTION(ENUM, STRUCT, NAME) NAME,
#define OFPAT11_ACTION(ENUM, STRUCT, EXTENSIBLE, NAME) NAME,
@@ -4243,7 +4243,7 @@ ofputil_action_code_from_name(const char *name)
#include "ofp-util.def"
};
- const char **p;
+ const char *const *p;
for (p = names; p < &names[ARRAY_SIZE(names)]; p++) {
if (*p && !strcasecmp(name, *p)) {
--
1.7.2.5
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev