mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-06 05:44:11 +01:00
WINGs: Properly mark 'const' some 'char*' in the public API
Update all the callers in our code to deal with the const qualifier where the compiler reports an issue.
This commit is contained in:
committed by
Carlos R. Mafra
parent
03ec24502d
commit
a079544647
@@ -1324,7 +1324,7 @@ void WMSortBrowserColumnWithComparer(WMBrowser *bPtr, int column,
|
||||
WMCompareDataProc *func);
|
||||
|
||||
/* Don't free the returned string. */
|
||||
char* WMSetBrowserPath(WMBrowser *bPtr, char *path);
|
||||
const char* WMSetBrowserPath(WMBrowser *bPtr, const char *path);
|
||||
|
||||
/* free the returned string */
|
||||
char* WMGetBrowserPath(WMBrowser *bPtr);
|
||||
@@ -1876,7 +1876,7 @@ void WMSetFilePanelCanChooseFiles(WMFilePanel *panel, Bool flag);
|
||||
|
||||
void WMSetFilePanelAutoCompletion(WMFilePanel *panel, Bool flag);
|
||||
|
||||
void WMSetFilePanelDirectory(WMFilePanel *panel, char *path);
|
||||
void WMSetFilePanelDirectory(WMFilePanel *panel, const char *path);
|
||||
|
||||
/* you can free the returned string */
|
||||
char* WMGetFilePanelFileName(WMFilePanel *panel);
|
||||
@@ -1884,7 +1884,7 @@ char* WMGetFilePanelFileName(WMFilePanel *panel);
|
||||
void WMFreeFilePanel(WMFilePanel *panel);
|
||||
|
||||
int WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
|
||||
char *path, const char *name, char **fileTypes);
|
||||
const char *path, const char *name, char **fileTypes);
|
||||
|
||||
void WMSetFilePanelAccessoryView(WMFilePanel *panel, WMView *view);
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ char* wexpandpath(const char *path);
|
||||
int wcopy_file(const char *toPath, const char *srcFile, const char *destFile);
|
||||
|
||||
/* don't free the returned string */
|
||||
char* wgethomedir(void);
|
||||
const char* wgethomedir(void);
|
||||
|
||||
/* ---[ WINGs/proplist.c ]------------------------------------------------ */
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
char *wgethomedir()
|
||||
const char *wgethomedir(void)
|
||||
{
|
||||
static char *home = NULL;
|
||||
char *tmp;
|
||||
|
||||
@@ -536,7 +536,7 @@ found_end_define_fname:
|
||||
while (*src != '\0') {
|
||||
idx = 0;
|
||||
if (*src == '~') {
|
||||
char *home = wgethomedir();
|
||||
const char *home = wgethomedir();
|
||||
while (*home != '\0') {
|
||||
if (idx < sizeof(buffer) - 2)
|
||||
buffer[idx++] = *home;
|
||||
|
||||
@@ -51,7 +51,8 @@ const char *wusergnusteppath()
|
||||
{
|
||||
static const char subdir[] = "/GNUstep";
|
||||
static char *path = NULL;
|
||||
char *gspath, *h;
|
||||
char *gspath;
|
||||
const char *h;
|
||||
int pathlen;
|
||||
|
||||
if (path)
|
||||
|
||||
@@ -619,11 +619,12 @@ void WMSetBrowserHasScroller(WMBrowser * bPtr, int hasScroller)
|
||||
bPtr->flags.hasScroller = hasScroller;
|
||||
}
|
||||
|
||||
char *WMSetBrowserPath(WMBrowser * bPtr, char *path)
|
||||
const char *WMSetBrowserPath(WMBrowser * bPtr, const char *path)
|
||||
{
|
||||
int i;
|
||||
char *str;
|
||||
char *tmp, *retPtr = NULL;
|
||||
char *tmp;
|
||||
const char *retPtr = NULL;
|
||||
int item;
|
||||
WMListItem *listItem;
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@ void WMFreeFilePanel(WMFilePanel * panel)
|
||||
}
|
||||
|
||||
int
|
||||
WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, char *path, const char *name, char **fileTypes)
|
||||
WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, const char *path, const char *name, char **fileTypes)
|
||||
{
|
||||
WMScreen *scr = WMWidgetScreen(panel->win);
|
||||
|
||||
@@ -387,12 +387,12 @@ WMRunModalFilePanelForDirectory(WMFilePanel * panel, WMWindow * owner, char *pat
|
||||
return (panel->flags.canceled ? False : True);
|
||||
}
|
||||
|
||||
void WMSetFilePanelDirectory(WMFilePanel * panel, char *path)
|
||||
void WMSetFilePanelDirectory(WMFilePanel * panel, const char *path)
|
||||
{
|
||||
WMList *list;
|
||||
WMListItem *item;
|
||||
int col;
|
||||
char *rest;
|
||||
const char *rest;
|
||||
|
||||
rest = WMSetBrowserPath(panel->browser, path);
|
||||
if (strcmp(path, "/") == 0)
|
||||
@@ -761,7 +761,7 @@ static void goFloppy(WMWidget *widget, void *p_panel)
|
||||
static void goHome(WMWidget *widget, void *p_panel)
|
||||
{
|
||||
WMFilePanel *panel = p_panel;
|
||||
char *home;
|
||||
const char *home;
|
||||
|
||||
/* Parameter not used, but tell the compiler that it is ok */
|
||||
(void) widget;
|
||||
|
||||
Reference in New Issue
Block a user