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

WPrefs: Added 'const' attribute to function parameters

This commit is contained in:
Christophe CURIS
2013-05-12 00:24:39 +02:00
committed by Carlos R. Mafra
parent eb14bca73b
commit b5101fc8ae
17 changed files with 53 additions and 53 deletions

View File

@@ -133,7 +133,7 @@ static void changePage(WMWidget * w, void *data);
static void changeColorPage(WMWidget * w, void *data);
static void OpenExtractPanelFor(_Panel * panel, char *path);
static void OpenExtractPanelFor(_Panel * panel, const char *path);
static void changedTabItem(struct WMTabViewDelegate *self, WMTabView * tabView, WMTabViewItem * item);
@@ -374,7 +374,7 @@ static WMRect previewColorPositions[] = {
{{155, 130}, {64, 64}}
};
static void str2rcolor(RContext * rc, char *name, RColor * color)
static void str2rcolor(RContext * rc, const char *name, RColor * color)
{
XColor xcolor;
@@ -386,7 +386,7 @@ static void str2rcolor(RContext * rc, char *name, RColor * color)
color->blue = xcolor.blue >> 8;
}
static void dumpRImage(char *path, RImage * image)
static void dumpRImage(const char *path, RImage * image)
{
FILE *f;
int channels = (image->format == RRGBAFormat ? 4 : 3);
@@ -477,7 +477,7 @@ static void drawMenuBevel(RImage * img)
}
}
static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int height, char *path, int border)
static Pixmap renderTexture(WMScreen * scr, WMPropList * texture, int width, int height, const char *path, int border)
{
char *type;
RImage *image = NULL;
@@ -867,7 +867,7 @@ static void cancelNewTexture(void *data)
HideTexturePanel(panel->texturePanel);
}
static char *makeFileName(char *prefix)
static char *makeFileName(const char *prefix)
{
char *fname;
@@ -1232,7 +1232,7 @@ static void paintListItem(WMList * lPtr, int index, Drawable d, char *text, int
WMReleaseColor(black);
}
static Pixmap loadRImage(WMScreen * scr, char *path)
static Pixmap loadRImage(WMScreen * scr, const char *path)
{
FILE *f;
RImage *image;
@@ -1868,7 +1868,7 @@ static void createPanel(Panel * p)
panel->texturePanel = CreateTexturePanel(panel->parent);
}
static void setupTextureFor(WMList * list, char *key, char *defValue, char *title, int index)
static void setupTextureFor(WMList * list, const char *key, char *defValue, const char *title, int index)
{
WMListItem *item;
TextureListItem *titem;
@@ -2069,7 +2069,7 @@ typedef struct ExtractPanel {
WMButton *extrB;
} ExtractPanel;
static void OpenExtractPanelFor(_Panel * panel, char *path)
static void OpenExtractPanelFor(_Panel * panel, const char *path)
{
ExtractPanel *epanel;
WMColor *color;

View File

@@ -74,7 +74,7 @@ static void pushAutoDelayButton(WMWidget *w, void *data)
}
}
static void adjustButtonSelectionBasedOnValue(_Panel *panel, int row, char *value)
static void adjustButtonSelectionBasedOnValue(_Panel *panel, int row, const char *value)
{
int j;

View File

@@ -541,7 +541,7 @@ static void selectedOption(WMWidget * w, void *data)
updateSampleFont(panel);
}
static WMLabel *createListLabel(WMScreen * scr, WMWidget * parent, char *text)
static WMLabel *createListLabel(WMScreen * scr, WMWidget * parent, const char *text)
{
WMLabel *label;
WMColor *color;

View File

@@ -298,7 +298,7 @@ static void changedItemPad(WMWidget * w, void *data)
panel->currentPad = padn;
}
static WEditMenu *putNewSubmenu(WEditMenu * menu, char *title)
static WEditMenu *putNewSubmenu(WEditMenu * menu, const char *title)
{
WEditMenu *tmp;
WEditMenuItem *item;
@@ -313,7 +313,7 @@ static WEditMenu *putNewSubmenu(WEditMenu * menu, char *title)
return tmp;
}
static ItemData *putNewItem(_Panel * panel, WEditMenu * menu, int type, char *title)
static ItemData *putNewItem(_Panel * panel, WEditMenu * menu, int type, const char *title)
{
WEditMenuItem *item;
ItemData *data;
@@ -1046,7 +1046,7 @@ static ItemData *parseCommand(WMPropList * item)
return data;
}
static void updateFrameTitle(_Panel * panel, char *title, InfoType type)
static void updateFrameTitle(_Panel * panel, const char *title, InfoType type)
{
if (type != NoInfo) {
char *tmp;
@@ -1095,7 +1095,7 @@ static void updateFrameTitle(_Panel * panel, char *title, InfoType type)
}
}
static void changeInfoType(_Panel * panel, char *title, InfoType type)
static void changeInfoType(_Panel * panel, const char *title, InfoType type)
{
WMWidget **w;
@@ -1510,7 +1510,7 @@ static void showData(_Panel * panel)
WMReleasePropList(pmenu);
}
static Bool notblank(char *s)
static Bool notblank(const char *s)
{
if (s) {
while (*s++) {
@@ -1521,7 +1521,7 @@ static Bool notblank(char *s)
return False;
}
static WMPropList *processData(char *title, ItemData * data)
static WMPropList *processData(const char *title, ItemData * data)
{
WMPropList *item;
char *s1;

View File

@@ -171,7 +171,7 @@ static void doubleClick(WMWidget * w, void *data)
WMSetTextFieldText(panel->ddelaT, buffer);
}
static int getButtonAction(char *str)
static int getButtonAction(const char *str)
{
if (!str)
return -2;
@@ -189,7 +189,7 @@ static int getButtonAction(char *str)
}
static int getWheelAction(char *str)
static int getWheelAction(const char *str)
{
if (!str)
return -2;
@@ -641,7 +641,7 @@ static void createPanel(Panel * p)
showData(panel);
}
static void storeCommandInScript(char *cmd, char *line)
static void storeCommandInScript(const char *cmd, const char *line)
{
char *path;
FILE *f;

View File

@@ -54,7 +54,7 @@ typedef struct _Panel {
#define ICON_FILE "paths"
static void addPathToList(WMList * list, int index, char *path)
static void addPathToList(WMList * list, int index, const char *path)
{
char *fpath = wexpandpath(path);
WMListItem *item;

View File

@@ -536,7 +536,7 @@ static void opaqChangeCallback(WMWidget * w, void *data)
/****************** Image ******************/
static void updateImage(TexturePanel * panel, char *path)
static void updateImage(TexturePanel * panel, const char *path)
{
WMScreen *scr = WMWidgetScreen(panel->win);
RImage *image;
@@ -735,7 +735,7 @@ void SetTexturePanelCancelAction(TexturePanel * panel, WMCallback * action, void
panel->cancelData = clientData;
}
void SetTexturePanelTexture(TexturePanel * panel, char *name, WMPropList * texture)
void SetTexturePanelTexture(TexturePanel * panel, const char *name, WMPropList * texture)
{
WMScreen *scr = WMWidgetScreen(panel->win);
char *str, *type;

View File

@@ -35,7 +35,7 @@ void ShowTexturePanel(TexturePanel *panel);
void HideTexturePanel(TexturePanel *panel);
void SetTexturePanelTexture(TexturePanel *panel, char *name,
void SetTexturePanelTexture(TexturePanel *panel, const char *name,
WMPropList *texture);

View File

@@ -72,7 +72,7 @@ static void finishedBarDownload(void *data)
panel->barPID = 0;
}
static pid_t downloadFile(WMScreen * scr, _Panel * panel, char *file)
static pid_t downloadFile(WMScreen * scr, _Panel * panel, const char *file)
{
pid_t pid;

View File

@@ -374,7 +374,7 @@ static void changeSection(WMWidget * self, void *data)
WPrefs.currentPanel = data;
}
char *LocateImage(char *name)
char *LocateImage(const char *name)
{
char *path;
char *tmp = wmalloc(strlen(name) + 8);
@@ -394,7 +394,7 @@ char *LocateImage(char *name)
return path;
}
void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, char *file,
void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, const char *file,
WMPixmap **icon_normal, WMPixmap **icon_greyed)
{
RImage *icon;
@@ -449,7 +449,7 @@ void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, char *file,
}
static WMPixmap *makeTitledIcon(WMScreen * scr, WMPixmap * icon, char *title1, char *title2)
static WMPixmap *makeTitledIcon(WMScreen * scr, WMPixmap * icon, const char *title1, const char *title2)
{
return WMRetainPixmap(icon);
@@ -516,7 +516,7 @@ static WMPixmap *makeTitledIcon(WMScreen * scr, WMPixmap * icon, char *title1, c
#endif
}
void SetButtonAlphaImage(WMScreen * scr, WMButton * bPtr, char *file, char *title1, char *title2)
void SetButtonAlphaImage(WMScreen * scr, WMButton * bPtr, const char *file, const char *title1, const char *title2)
{
WMPixmap *icon;
WMPixmap *icon2;
@@ -571,7 +571,7 @@ void SetButtonAlphaImage(WMScreen * scr, WMButton * bPtr, char *file, char *titl
wfree(iconPath);
}
void AddSection(Panel * panel, char *iconFile)
void AddSection(Panel * panel, const char *iconFile)
{
WMButton *bPtr;
@@ -949,7 +949,7 @@ void SetIntegerForKey(int value, const char *defaultName)
WMReleasePropList(object);
}
void SetStringForKey(char *value, const char *defaultName)
void SetStringForKey(const char *value, const const char *defaultName)
{
WMPropList *object;

View File

@@ -70,18 +70,18 @@ typedef struct PanelRec {
/* ---[ Wprefs.c ] ------------------------------------------------------- */
void AddSection(Panel *panel, char *iconFile);
void AddSection(Panel *panel, const char *iconFile);
char *LocateImage(char *name);
char *LocateImage(const char *name);
void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file,
char *title1, char *title2);
void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, const char *file,
const char *title1, const char *title2);
/* Loads `file' into `icon_normal'. If `icon_greyed' is not NULL,
* combine `icon_normal' with some grey and then optionally with image
* `xis', and store it in `icon_greyed' (typically to produce a
* greyed-out, red-crossed version of `icon_normal') */
void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, char *file,
void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, const char *file,
WMPixmap **icon_normal, WMPixmap **icon_greyed);
WMWindow *GetWindow(Panel *panel);
@@ -104,7 +104,7 @@ int GetSpeedForKey(const char *defaultName);
void SetIntegerForKey(int value, const char *defaultName);
void SetStringForKey(char *value, const char *defaultName);
void SetStringForKey(const char *value, const char *defaultName);
void SetBoolForKey(Bool value, const char *defaultName);
@@ -114,7 +114,7 @@ void SetSpeedForKey(int speed, const char *defaultName);
/* ---[ double.c ] ------------------------------------------------------- */
typedef struct W_DoubleTest DoubleTest;
DoubleTest *CreateDoubleTest(WMWidget *parent, char *text);
DoubleTest *CreateDoubleTest(WMWidget *parent, const char *text);
/* ---[ main.c ] --------------------------------------------------------- */
@@ -122,7 +122,7 @@ void AddDeadChildHandler(pid_t pid, void (*handler)(void*), void *data);
/* ---[ xmodifier.c ] ---------------------------------------------------- */
int ModifierFromKey(Display * dpy, char *key);
int ModifierFromKey(Display * dpy, const char *key);
#define FRAME_TOP 105

View File

@@ -137,7 +137,7 @@ static void resizeCallback(WMWidget * w, void *data)
}
}
static int getPlacement(char *str)
static int getPlacement(const char *str)
{
if (!str)
return 0;

View File

@@ -46,7 +46,7 @@ W_Class InitDoubleTest(WMScreen * scr)
/*
* Our widget fabrication plant.
*/
DoubleTest *CreateDoubleTest(WMWidget * parent, char *text)
DoubleTest *CreateDoubleTest(WMWidget * parent, const char *text)
{
DoubleTest *dPtr;

View File

@@ -115,7 +115,7 @@ W_Class InitEditMenuItem(WMScreen * scr)
return EditMenuItemClass;
}
WEditMenuItem *WCreateEditMenuItem(WMWidget * parent, char *title, Bool isTitle)
WEditMenuItem *WCreateEditMenuItem(WMWidget * parent, const char *title, Bool isTitle)
{
WEditMenuItem *iPtr;
WMScreen *scr = WMWidgetScreen(parent);
@@ -362,7 +362,7 @@ static void itemSelectObserver(void *self, WMNotification * notif)
}
}
static WEditMenu *makeEditMenu(WMScreen * scr, WMWidget * parent, char *title)
static WEditMenu *makeEditMenu(WMScreen * scr, WMWidget * parent, const char *title)
{
WEditMenu *mPtr;
WEditMenuItem *item;
@@ -417,7 +417,7 @@ static WEditMenu *makeEditMenu(WMScreen * scr, WMWidget * parent, char *title)
return mPtr;
}
WEditMenu *WCreateEditMenu(WMScreen * scr, char *title)
WEditMenu *WCreateEditMenu(WMScreen * scr, const char *title)
{
return makeEditMenu(scr, NULL, title);
}
@@ -432,7 +432,7 @@ void WSetEditMenuDelegate(WEditMenu * mPtr, WEditMenuDelegate * delegate)
mPtr->delegate = delegate;
}
WEditMenuItem *WInsertMenuItemWithTitle(WEditMenu * mPtr, int index, char *title)
WEditMenuItem *WInsertMenuItemWithTitle(WEditMenu * mPtr, int index, const char *title)
{
WEditMenuItem *item;
@@ -463,12 +463,12 @@ WEditMenuItem *WGetEditMenuItem(WEditMenu * mPtr, int index)
return WMGetFromArray(mPtr->items, index + (mPtr->flags.isTitled ? 1 : 0));
}
WEditMenuItem *WAddMenuItemWithTitle(WEditMenu * mPtr, char *title)
WEditMenuItem *WAddMenuItemWithTitle(WEditMenu * mPtr, const char *title)
{
return WInsertMenuItemWithTitle(mPtr, WMGetArrayItemCount(mPtr->items), title);
}
void WSetEditMenuTitle(WEditMenu * mPtr, char *title)
void WSetEditMenuTitle(WEditMenu * mPtr, const char *title)
{
WEditMenuItem *item;

View File

@@ -45,7 +45,7 @@ typedef struct WEditMenuDelegate {
WEditMenuItem *WCreateEditMenuItem(WMWidget *parent, char *title,
WEditMenuItem *WCreateEditMenuItem(WMWidget *parent, const char *title,
Bool isTitle);
@@ -58,20 +58,20 @@ void WSetEditMenuItemData(WEditMenuItem *item, void *data,
void WSetEditMenuItemImage(WEditMenuItem *item, WMPixmap *pixmap);
WEditMenu *WCreateEditMenu(WMScreen *scr, char *title);
WEditMenu *WCreateEditMenu(WMScreen *scr, const char *title);
WEditMenu *WCreateEditMenuPad(WMWidget *parent);
void WSetEditMenuDelegate(WEditMenu *mPtr, WEditMenuDelegate *delegate);
WEditMenuItem *WInsertMenuItemWithTitle(WEditMenu *mPtr, int index,
char *title);
const char *title);
WEditMenuItem *WAddMenuItemWithTitle(WEditMenu *mPtr, char *title);
WEditMenuItem *WAddMenuItemWithTitle(WEditMenu *mPtr, const char *title);
WEditMenuItem *WGetEditMenuItem(WEditMenu *mPtr, int index);
void WSetEditMenuTitle(WEditMenu *mPtr, char *title);
void WSetEditMenuTitle(WEditMenu *mPtr, const char *title);
char *WGetEditMenuTitle(WEditMenu *mPtr);

View File

@@ -47,7 +47,7 @@ void wAbort(Bool foo)
exit(1);
}
static void print_help(char *progname)
static void print_help(const char *progname)
{
printf(_("usage: %s [options]\n"), progname);
puts(_("options:"));

View File

@@ -262,7 +262,7 @@ static void x_reset_modifier_mapping(Display * display)
XFreeModifiermap(x_modifier_keymap);
}
int ModifierFromKey(Display * dpy, char *key)
int ModifierFromKey(Display * dpy, const char *key)
{
static int eqw = 0;