[gnome-commander/ConvertWarningsToErrors] src/ls_colors.cc: fix for -Wwrite-strings
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/ConvertWarningsToErrors] src/ls_colors.cc: fix for -Wwrite-strings
- Date: Thu, 27 Apr 2017 20:35:07 +0000 (UTC)
commit 37c96f5cb9d78f24f5e09148496973f9d9c3be19
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date: Tue Apr 25 14:35:47 2017 +0900
src/ls_colors.cc: fix for -Wwrite-strings
src/ls_colors.cc:33:24: error: ISO C++ forbids converting a string constant to 'gchar* {aka char*}'
[-Werror=write-strings]
Add const correctly.
src/ls_colors.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/ls_colors.cc b/src/ls_colors.cc
index 32c3c5e..8abd107 100644
--- a/src/ls_colors.cc
+++ b/src/ls_colors.cc
@@ -165,7 +165,7 @@ static LsColor *create_color (gchar *ls_color)
}
-static void init (gchar *ls_colors)
+static void init (const gchar *ls_colors)
{
gchar **ents = g_strsplit (ls_colors, ":", 0);
@@ -191,7 +191,7 @@ static void init (gchar *ls_colors)
void ls_colors_init ()
{
- gchar *s = getenv ("LS_COLORS");
+ const gchar *s = getenv ("LS_COLORS");
if (!s)
s = DEFAULT_COLORS;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]