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

wmaker: Added 'const' attribute to most local functions

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2013-06-16 17:57:47 +02:00
committed by Carlos R. Mafra
parent 69b6848187
commit f0c1dc9fc3
10 changed files with 24 additions and 24 deletions

View File

@@ -267,7 +267,7 @@ static Pixmap makePixmap(WScreen * scr, int width, int height, int side, Pixmap
return pixmap;
}
static void showText(WScreen * scr, int x, int y, int h, int w, char *text)
static void showText(WScreen *scr, int x, int y, int h, int w, const char *text)
{
int width;
int height;
@@ -327,7 +327,7 @@ static void showText(WScreen * scr, int x, int y, int h, int w, char *text)
}
#else /* !SHAPED_BALLOON */
static void showText(WScreen * scr, int x, int y, int h, int w, char *text)
static void showText(WScreen *scr, int x, int y, int h, int w, const char *text)
{
int width;
int height;

View File

@@ -1252,7 +1252,7 @@ void wDefaultUpdateIcons(WScreen *scr)
} else var = WMGetFromPLString(value)\
static int string2index(WMPropList * key, WMPropList * val, char *def, WOptionEnumeration * values)
static int string2index(WMPropList *key, WMPropList *val, const char *def, WOptionEnumeration * values)
{
char *str;
WOptionEnumeration *v;
@@ -2236,7 +2236,7 @@ static WCursorLookup cursor_table[] = {
{NULL, CURSOR_ID_NONE}
};
static void check_bitmap_status(int status, char *filename, Pixmap bitmap)
static void check_bitmap_status(int status, const char *filename, Pixmap bitmap)
{
switch (status) {
case BitmapOpenFailed:

View File

@@ -555,7 +555,7 @@ typedef struct IconPanel {
short preview;
} IconPanel;
static void listPixmaps(WScreen * scr, WMList * lPtr, char *path)
static void listPixmaps(WScreen *scr, WMList *lPtr, const char *path)
{
struct dirent *dentry;
DIR *dir;
@@ -608,7 +608,7 @@ static void listPixmaps(WScreen * scr, WMList * lPtr, char *path)
panel->preview = True;
}
static void setViewedImage(IconPanel * panel, char *file)
static void setViewedImage(IconPanel *panel, const char *file)
{
WMPixmap *pixmap;
RColor color;

View File

@@ -124,7 +124,7 @@ static WAppIcon *mainIconCreate(WScreen *scr, int type, char *name);
static void drawerIconExpose(WObjDescriptor *desc, XEvent *event);
static void removeDrawerCallback(WMenu *menu, WMenuEntry *entry);
static void drawerAppendToChain(WScreen *scr, WDock *drawer);
static char *findUniqueName(WScreen *scr, char *instance_basename);
static char *findUniqueName(WScreen *scr, const char *instance_basename);
static void addADrawerCallback(WMenu *menu, WMenuEntry *entry);
static void swapDrawers(WScreen *scr, int on_right_side, int new_x);
static WDock* getDrawer(WScreen *scr, int y_index);
@@ -4263,7 +4263,7 @@ static void drawerRemoveFromChain(WScreen *scr, WDock *drawer)
/* Don't free the returned string. Duplicate it. */
static char * findUniqueName(WScreen *scr, char *instance_basename)
static char * findUniqueName(WScreen *scr, const char *instance_basename)
{
static char buffer[128];
WDrawerChain *dc;

View File

@@ -85,7 +85,7 @@ static void menuTitleMouseDown(WCoreWindow * sender, void *data, XEvent * event)
static void menuCloseClick(WCoreWindow * sender, void *data, XEvent * event);
static void updateTexture(WMenu * menu);
static int saveMenuRecurs(WMPropList * menus, WScreen * scr, WMenu * menu);
static int restoreMenuRecurs(WScreen * scr, WMPropList * menus, WMenu * menu, char *path);
static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path);
static void selectEntry(WMenu * menu, int entry_no);
static void closeCascade(WMenu * menu);
@@ -2416,7 +2416,7 @@ static int restoreMenu(WScreen * scr, WMPropList * menu, int which)
return False;
}
static int restoreMenuRecurs(WScreen * scr, WMPropList * menus, WMenu * menu, char *path)
static int restoreMenuRecurs(WScreen *scr, WMPropList *menus, WMenu *menu, const char *path)
{
WMPropList *key, *entry;
char buffer[512];

View File

@@ -55,7 +55,7 @@ extern WPreferences wPreferences;
#define ICON_SIZE wPreferences.icon_size
/**** Local prototypes *****/
static void UnescapeWM_CLASS(char *str, char **name, char **class);
static void UnescapeWM_CLASS(const char *str, char **name, char **class);
/* XFetchName Wrapper */
Bool wFetchName(Display *dpy, Window win, char **winname)
@@ -435,7 +435,7 @@ static char *getselection(WScreen * scr)
}
static char*
parseuserinputpart(char *line, int *ptr, char *endchars)
parseuserinputpart(const char *line, int *ptr, const char *endchars)
{
int depth = 0, begin;
char *value = NULL;
@@ -459,7 +459,7 @@ parseuserinputpart(char *line, int *ptr, char *endchars)
}
static char*
getuserinput(WScreen *scr, char *line, int *ptr, Bool advanced)
getuserinput(WScreen *scr, const char *line, int *ptr, Bool advanced)
{
char *ret = NULL, *title = NULL, *prompt = NULL, *name = NULL;
int rv;
@@ -870,7 +870,7 @@ char *EscapeWM_CLASS(char *name, char *class)
return ret;
}
static void UnescapeWM_CLASS(char *str, char **name, char **class)
static void UnescapeWM_CLASS(const char *str, char **name, char **class)
{
int i, j, k, dot;

View File

@@ -67,7 +67,7 @@ extern WPreferences wPreferences;
static WMenu *readMenuPipe(WScreen * scr, char **file_name);
static WMenu *readPLMenuPipe(WScreen * scr, char **file_name);
static WMenu *readMenuFile(WScreen * scr, char *file_name);
static WMenu *readMenuFile(WScreen *scr, const char *file_name);
static WMenu *readMenuDirectory(WScreen * scr, char *title, char **file_name, char *command);
static WMenu *configureMenu(WScreen * scr, WMPropList * definition, Bool includeGlobals);
static void menu_parser_register_macros(WMenuParser parser);
@@ -305,7 +305,7 @@ static void legalPanelCommand(WMenu * menu, WMenuEntry * entry)
/********************************************************************/
static char * getLocalizedMenuFile(char *menu)
static char *getLocalizedMenuFile(const char *menu)
{
char *buffer, *ptr, *locale;
int len;
@@ -422,7 +422,7 @@ static void removeShortcutsForMenu(WMenu * menu)
menu->menu->screen_ptr->flags.root_menu_changed_shortcuts = 1;
}
static Bool addShortcut(const char *file, char *shortcutDefinition, WMenu * menu, WMenuEntry * entry)
static Bool addShortcut(const char *file, const char *shortcutDefinition, WMenu *menu, WMenuEntry *entry)
{
Shortcut *ptr;
KeySym ksym;
@@ -564,7 +564,7 @@ static void separateCommand(char *line, char ***file, char **command)
WMFreeArray(array);
}
static WMenu *constructPLMenu(WScreen *screen, char *path)
static WMenu *constructPLMenu(WScreen *screen, const char *path)
{
WMPropList *pl = NULL;
WMenu *menu = NULL;
@@ -1013,7 +1013,7 @@ static WMenu *parseCascade(WScreen * scr, WMenu * menu, WMenuParser parser)
return NULL;
}
static WMenu *readMenuFile(WScreen * scr, char *file_name)
static WMenu *readMenuFile(WScreen *scr, const char *file_name)
{
WMenu *menu = NULL;
FILE *file = NULL;
@@ -1191,7 +1191,7 @@ static void menu_parser_register_macros(WMenuParser parser)
/************ Menu Configuration From Directory *************/
static Bool isFilePackage(char *file)
static Bool isFilePackage(const char *file)
{
int l;

View File

@@ -316,7 +316,7 @@ static RImage *getTile(void)
return stile;
}
static void drawTitle(WSwitchPanel *panel, int idecks, char *title)
static void drawTitle(WSwitchPanel *panel, int idecks, const char *title)
{
char *ntitle;
int width = WMWidgetWidth(panel->win);

View File

@@ -318,7 +318,7 @@ void wUserMenuRefreshInstances(WMenu * menu, WWindow * wwin)
wMenuPaint(menu);
}
static WMenu *readUserMenuFile(WScreen * scr, char *file_name)
static WMenu *readUserMenuFile(WScreen *scr, const char *file_name)
{
WMenu *menu = NULL;
WMPropList *plum;

View File

@@ -167,7 +167,7 @@ static WMPropList *get_value(WMPropList * dict_win, WMPropList * dict_class, WMP
return default_value;
}
static WMPropList *get_value_from_instanceclass(char *value)
static WMPropList *get_value_from_instanceclass(const char *value)
{
WMPropList *key, *val = NULL;
@@ -314,7 +314,7 @@ void wDefaultFillAttributes(char *instance, char *class,
WMPLSetCaseSensitive(False);
}
static WMPropList *get_generic_value(char *instance, char *class,
static WMPropList *get_generic_value(const char *instance, const char *class,
WMPropList *option, Bool default_icon)
{
WMPropList *value, *key, *dict;