On Tue 16.Mar'10 at 11:39:03 +0100, Tamas TEVESZ wrote:
> Subject: [PATCH] Constify.
>
> ---
> WINGs/proplist.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/WINGs/proplist.c b/WINGs/proplist.c
> index 916b2e8..92c388a 100644
> --- a/WINGs/proplist.c
> +++ b/WINGs/proplist.c
> @@ -51,7 +51,7 @@ static WMPropList *getPLData(PLData * pldata);
> static WMPropList *getPLArray(PLData * pldata);
> static WMPropList *getPLDictionary(PLData * pldata);
> static WMPropList *getPropList(PLData * pldata);
> -static int WMMkDirHier(char *path);
> +static int WMMkDirHier(const char *path);
>
> typedef unsigned (*hashFunc) (const void *);
> typedef Bool(*isEqualFunc) (const void *, const void *);
> @@ -1636,7 +1636,7 @@ Bool WMWritePropListToFile(WMPropList * plist, char
> *path)
> *
> * returns 1 on success, 0 on failure
> */
> -static int WMMkDirHier(char *path)
> +static int WMMkDirHier(const char *path)
> {
> char *t, *thePath = NULL, buf[1024];
> size_t p, plen;
This one causes these build warnings:
Making all in .
CC proplist.lo
proplist.c: In function WMMkDirHier:
proplist.c:1651: warning: passing argument 1 of wstrdup discards qualifiers
from pointer target type
../WINGs/WINGs/WUtil.h:248: note: expected 'char *' but argument is of type
'const char *'
CC userdefaults.lo
and
CC dialog.o
dialog.c: In function ‘LoadHistory’:
dialog.c:209: warning: passing argument 2 of ‘WMFindInArray’ from incompatible
pointer type
../WINGs/WINGs/WUtil.h:455: note: expected ‘int (*)(void *, void *)’ but
argument is of type ‘int (*)(const char *, const char *)’
CC dockedapp.o
I think the first one can be fixed by making wstrdup() use 'const char *' in
its
definition (which I think makes sense).
The other one I haven't looked at.
--
To unsubscribe, send mail to [email protected].