From 4ca6274e2b026eb628d31dab1996004acdc6e441 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 26 Jul 2014 23:02:44 +0200 Subject: [PATCH] ifcfg-rh: fix warning about duplicate const when declaring string clang warns: make[7]: Entering directory `./NetworkManager/src/settings/plugins/ifcfg-rh' CC writer.lo writer.c:2505:20: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier] static const char const as_dash[] = "\\][|/=()!"; ^~~~~~ CC utils.lo utils.c:40:20: error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier] static const char const drop_chars[] = "\r\n"; /* drop CR and LF */ ^~~~~~ Signed-off-by: Thomas Haller --- src/settings/plugins/ifcfg-rh/utils.c | 2 +- src/settings/plugins/ifcfg-rh/writer.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/utils.c b/src/settings/plugins/ifcfg-rh/utils.c index 8318a65dae..8ec7c0a131 100644 --- a/src/settings/plugins/ifcfg-rh/utils.c +++ b/src/settings/plugins/ifcfg-rh/utils.c @@ -37,7 +37,7 @@ char * utils_single_quote_string (const char *str) { - static const char const drop_chars[] = "\r\n"; /* drop CR and LF */ + static const char *drop_chars = "\r\n"; /* drop CR and LF */ static const char escape_char = '\\'; /* escape char is backslash */ static const char quote_char = '\''; /* quote char is single quote */ size_t i, slen, j = 0; diff --git a/src/settings/plugins/ifcfg-rh/writer.c b/src/settings/plugins/ifcfg-rh/writer.c index 60af599bf1..acb19705c1 100644 --- a/src/settings/plugins/ifcfg-rh/writer.c +++ b/src/settings/plugins/ifcfg-rh/writer.c @@ -2502,7 +2502,6 @@ error: static char * escape_id (const char *id) { - static const char const as_dash[] = "\\][|/=()!"; char *escaped = g_strdup (id); char *p = escaped; @@ -2510,7 +2509,7 @@ escape_id (const char *id) while (*p) { if (*p == ' ') *p = '_'; - else if (strchr (as_dash, *p)) + else if (strchr ("\\][|/=()!", *p)) *p = '-'; p++; }