From cd1c55d63ce306ad43c1e601a60502f9c2b28435 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Sat, 4 May 2013 15:43:29 +0200 Subject: [PATCH] WUtil: Changed declaration of 'wusergnusteppath' to return a CONST string According to the way its value is being used everywhere, that is what would be expected, so let's make it official. Please note that this may introduce warnings on user code using this function ("...discard const...") but that's an opportunity for them to check that their code is not doing anything wrong. --- WINGs/WINGs/WUtil.h | 2 +- WINGs/userdefaults.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WINGs/WINGs/WUtil.h b/WINGs/WINGs/WUtil.h index a4e8f270..515bd18b 100644 --- a/WINGs/WINGs/WUtil.h +++ b/WINGs/WINGs/WUtil.h @@ -816,7 +816,7 @@ Bool WMWritePropListToFile(WMPropList *plist, const char *path); /* ---[ WINGs/userdefaults.c ]-------------------------------------------- */ /* don't free the returned string */ -char* wusergnusteppath(void); +const char* wusergnusteppath(void); /* Free the returned string when you no longer need it */ char* wdefaultspathfordomain(const char *domain); diff --git a/WINGs/userdefaults.c b/WINGs/userdefaults.c index 7dd9931a..112f1f75 100644 --- a/WINGs/userdefaults.c +++ b/WINGs/userdefaults.c @@ -46,7 +46,7 @@ extern char *WMGetApplicationName(); #define UD_SYNC_INTERVAL 2000 #endif -char *wusergnusteppath() +const char *wusergnusteppath() { static char *path = NULL; char *gspath; -- 2.11.4.GIT