From 0004d38ef884d92a1daf34f67aadb8fb6d249fc9 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Wed, 8 May 2013 15:44:08 +0200 Subject: [PATCH] WPrefs: Added const attribute to statically stored strings Now that the function handling the configuration dictionnary are const correct, the key stored in static array can be given the const attribute. --- WPrefs.app/Expert.c | 2 +- WPrefs.app/KeyboardShortcuts.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index d82bc6ff..7cb85f34 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -34,7 +34,7 @@ static const struct { OPTION_USERDEF } class; - char *op_name; /* The identifier for the option in the config file */ + const char *op_name; /* The identifier for the option in the config file */ } expert_options[] = { diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index d5b2ce18..ef486568 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -66,11 +66,11 @@ typedef struct _Panel { * Second is the text displayed to the user */ static const struct { + const char *key; /* - * Fixme: these strings should be 'const', but 'GetStringForKey' - * and 'WMAddListItem' do not allow us to do so + * Fixme: this string should be 'const', but 'WMAddListItem' + * do not allow us to do so */ - char *key; char *title; } keyOptions[] = { { "RootMenuKey", N_("Open applications menu") }, -- 2.11.4.GIT