From: Christophe CURIS <[email protected]>
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 8f7a5b6..80bde8f 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 51e895d..0a99c3e 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 7cb85f3..e170bbd 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 ef48656..a4d4c57 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") },
--
1.7.10.4
--
To unsubscribe, send mail to [email protected].