From a4395c5764a5db9915271462f2a95ee93a28f61e Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Thu, 9 May 2013 17:34:10 +0200 Subject: [PATCH] WPrefs.app: Added const attribute to local string Now that the WINGs functions are const-correct, it is possible to set the attribute on the strings to help the compiler. --- WINGs/wevent.c | 2 +- WINGs/wfontpanel.c | 2 +- WPrefs.app/Expert.c | 2 +- WPrefs.app/KeyboardShortcuts.c | 6 +----- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/WINGs/wevent.c b/WINGs/wevent.c index 8f7a5b6f..80bde8f3 100644 --- a/WINGs/wevent.c +++ b/WINGs/wevent.c @@ -6,7 +6,7 @@ #include "WINGsP.h" /* table to map event types to event masks */ -static unsigned long eventMasks[] = { +static const unsigned long eventMasks[] = { 0, 0, KeyPressMask, /* KeyPress */ diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c index 51e895de..0a99c3e0 100644 --- a/WINGs/wfontpanel.c +++ b/WINGs/wfontpanel.c @@ -56,7 +56,7 @@ typedef struct W_FontPanel { #define DEF_WIDTH 320 #define DEF_HEIGHT (DEF_UPPER_HEIGHT+DEF_LOWER_HEIGHT) -static int scalableFontSizes[] = { +static const int scalableFontSizes[] = { 8, 10, 11, diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index 7cb85f34..e170bbdb 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -25,7 +25,7 @@ * expert tab of the window with the corresponding information for effect */ static const struct { - char *label; /* Text displayed to user */ + const char *label; /* Text displayed to user */ int def_state; /* True/False: the default value, if not defined in current config */ diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c index ef486568..a4d4c576 100644 --- a/WPrefs.app/KeyboardShortcuts.c +++ b/WPrefs.app/KeyboardShortcuts.c @@ -67,11 +67,7 @@ typedef struct _Panel { */ static const struct { const char *key; - /* - * Fixme: this string should be 'const', but 'WMAddListItem' - * do not allow us to do so - */ - char *title; + const char *title; } keyOptions[] = { { "RootMenuKey", N_("Open applications menu") }, { "WindowListKey", N_("Open window list menu") },