1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

wmaker: Added 'const' attribute to local variables

A number of these variable are not meant to be modified, so we
show this to the compiler.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-06-16 17:57:51 +02:00
committed by Carlos R. Mafra
parent c9b816de75
commit a6410d61e5
4 changed files with 15 additions and 15 deletions

View File

@@ -263,9 +263,9 @@ typedef struct WObjDescriptor {
/* notifications */ /* notifications */
#ifdef MAINFILE #ifdef MAINFILE
#define NOTIFICATION(n) char *WN##n = #n #define NOTIFICATION(n) const char WN##n [] = #n
#else #else
#define NOTIFICATION(n) extern char *WN##n #define NOTIFICATION(n) extern const char WN##n []
#endif #endif
NOTIFICATION(WindowAppearanceSettingsChanged); NOTIFICATION(WindowAppearanceSettingsChanged);

View File

@@ -84,8 +84,8 @@ typedef int (WDECallbackConvert) (WScreen *scr, WDefaultEntry *entry, WMPropList
typedef int (WDECallbackUpdate) (WScreen *scr, WDefaultEntry *entry, void *tdata, void *extra_data); typedef int (WDECallbackUpdate) (WScreen *scr, WDefaultEntry *entry, void *tdata, void *extra_data);
struct _WDefaultEntry { struct _WDefaultEntry {
char *key; const char *key;
char *default_value; const char *default_value;
void *extra_data; void *extra_data;
void *addr; void *addr;
WDECallbackConvert *convert; WDECallbackConvert *convert;
@@ -96,7 +96,7 @@ struct _WDefaultEntry {
/* used to map strings to integers */ /* used to map strings to integers */
typedef struct { typedef struct {
char *string; const char *string;
short value; short value;
char is_alias; char is_alias;
} WOptionEnumeration; } WOptionEnumeration;
@@ -1295,7 +1295,7 @@ static int string2index(WMPropList *key, WMPropList *val, const char *def, WOpti
static int getBool(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret) static int getBool(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
{ {
static char data; static char data;
char *val; const char *val;
int second_pass = 0; int second_pass = 0;
GET_STRING_OR_DEFAULT("Boolean", val); GET_STRING_OR_DEFAULT("Boolean", val);
@@ -1338,7 +1338,7 @@ static int getBool(WScreen * scr, WDefaultEntry * entry, WMPropList * value, voi
static int getInt(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret) static int getInt(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
{ {
static int data; static int data;
char *val; const char *val;
GET_STRING_OR_DEFAULT("Integer", val); GET_STRING_OR_DEFAULT("Integer", val);
@@ -2009,7 +2009,7 @@ getWSSpecificBackground(WScreen * scr, WDefaultEntry * entry, WMPropList * value
static int getFont(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret) static int getFont(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
{ {
static WMFont *font; static WMFont *font;
char *val; const char *val;
GET_STRING_OR_DEFAULT("Font", val); GET_STRING_OR_DEFAULT("Font", val);
@@ -2034,7 +2034,7 @@ static int getFont(WScreen * scr, WDefaultEntry * entry, WMPropList * value, voi
static int getColor(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret) static int getColor(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
{ {
static XColor color; static XColor color;
char *val; const char *val;
int second_pass = 0; int second_pass = 0;
GET_STRING_OR_DEFAULT("Color", val); GET_STRING_OR_DEFAULT("Color", val);
@@ -2067,7 +2067,7 @@ static int getKeybind(WScreen * scr, WDefaultEntry * entry, WMPropList * value,
{ {
static WShortKey shortcut; static WShortKey shortcut;
KeySym ksym; KeySym ksym;
char *val; const char *val;
char *k; char *k;
char buf[MAX_SHORTCUT_LENGTH], *b; char buf[MAX_SHORTCUT_LENGTH], *b;
@@ -2124,7 +2124,7 @@ static int getKeybind(WScreen * scr, WDefaultEntry * entry, WMPropList * value,
static int getModMask(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret) static int getModMask(WScreen * scr, WDefaultEntry * entry, WMPropList * value, void *addr, void **ret)
{ {
static int mask; static int mask;
char *str; const char *str;
GET_STRING_OR_DEFAULT("Modifier Key", str); GET_STRING_OR_DEFAULT("Modifier Key", str);
@@ -2149,13 +2149,13 @@ static int getModMask(WScreen * scr, WDefaultEntry * entry, WMPropList * value,
# include <X11/cursorfont.h> # include <X11/cursorfont.h>
typedef struct { typedef struct {
char *name; const char *name;
int id; int id;
} WCursorLookup; } WCursorLookup;
#define CURSOR_ID_NONE (XC_num_glyphs) #define CURSOR_ID_NONE (XC_num_glyphs)
static WCursorLookup cursor_table[] = { static const WCursorLookup cursor_table[] = {
{"X_cursor", XC_X_cursor}, {"X_cursor", XC_X_cursor},
{"arrow", XC_arrow}, {"arrow", XC_arrow},
{"based_arrow_down", XC_based_arrow_down}, {"based_arrow_down", XC_based_arrow_down},

View File

@@ -1121,7 +1121,7 @@ void wShowInfoPanel(WScreen * scr)
char *strbuf = NULL; char *strbuf = NULL;
const char *separator; const char *separator;
char buffer[256]; char buffer[256];
char *name; const char *name;
Window parent; Window parent;
WWindow *wwin; WWindow *wwin;
char **strl; char **strl;

View File

@@ -167,7 +167,7 @@ void SlideWindows(Window *wins[], int n, int from_x, int from_y, int to_x, int t
int i; int i;
/* animation parameters */ /* animation parameters */
static struct { static const struct {
int delay; int delay;
int steps; int steps;
int slowdown; int slowdown;