Constify
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7321 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
0ca6a4c35f
commit
0d298349d4
2 changed files with 16 additions and 16 deletions
|
@ -242,17 +242,17 @@ char *dupstr(char *s);
|
|||
*/
|
||||
#define asciistrdef(s, d) ( (s) ? (s) : (d) )
|
||||
#define ustrdef(s, d) ( (s) ? (s) : (d) )
|
||||
wchar_t *ustrdup(wchar_t * s);
|
||||
wchar_t *ustrreplacedup(wchar_t **dest, wchar_t *src);
|
||||
char *ustrtoa(wchar_t * s, char *outbuf, int size);
|
||||
int ustrlen(wchar_t * s);
|
||||
wchar_t *uadv(wchar_t * s);
|
||||
wchar_t *ustrcpy(wchar_t * dest, wchar_t * source);
|
||||
wchar_t *ustrdup(const wchar_t * s);
|
||||
wchar_t *ustrreplacedup(wchar_t **dest, const wchar_t *src);
|
||||
char *ustrtoa(const wchar_t * s, char *outbuf, int size);
|
||||
int ustrlen(const wchar_t * s);
|
||||
wchar_t *uadv(const wchar_t * s);
|
||||
wchar_t *ustrcpy(wchar_t * dest, const wchar_t * source);
|
||||
wchar_t utolower(wchar_t);
|
||||
int ustrcmp(const wchar_t * lhs, const wchar_t * rhs);
|
||||
int ustricmp(const wchar_t * lhs, const wchar_t * rhs);
|
||||
int utoi(wchar_t *);
|
||||
int utob(wchar_t *);
|
||||
int utoi(const wchar_t *);
|
||||
int utob(const wchar_t *);
|
||||
int uisdigit(wchar_t);
|
||||
wchar_t *ustrlow(wchar_t * s);
|
||||
wchar_t *ustrftime(wchar_t * fmt, struct tm *timespec);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <time.h>
|
||||
#include "halibut.h"
|
||||
|
||||
wchar_t *ustrdup(wchar_t * s)
|
||||
wchar_t *ustrdup(const wchar_t * s)
|
||||
{
|
||||
wchar_t *r;
|
||||
if (s)
|
||||
|
@ -21,13 +21,13 @@ wchar_t *ustrdup(wchar_t * s)
|
|||
return r;
|
||||
}
|
||||
|
||||
wchar_t *ustrreplacedup(wchar_t **dest, wchar_t *src)
|
||||
wchar_t *ustrreplacedup(wchar_t **dest, const wchar_t *src)
|
||||
{
|
||||
sfree(*dest);
|
||||
return *dest = ustrdup(src);
|
||||
}
|
||||
|
||||
char *ustrtoa(wchar_t * s, char *outbuf, int size)
|
||||
char *ustrtoa(const wchar_t * s, char *outbuf, int size)
|
||||
{
|
||||
char *p;
|
||||
if (!s)
|
||||
|
@ -44,7 +44,7 @@ char *ustrtoa(wchar_t * s, char *outbuf, int size)
|
|||
return outbuf;
|
||||
}
|
||||
|
||||
int ustrlen(wchar_t * s)
|
||||
int ustrlen(const wchar_t * s)
|
||||
{
|
||||
int len = 0;
|
||||
while (*s++)
|
||||
|
@ -52,12 +52,12 @@ int ustrlen(wchar_t * s)
|
|||
return len;
|
||||
}
|
||||
|
||||
wchar_t *uadv(wchar_t * s)
|
||||
wchar_t *uadv(const wchar_t * s)
|
||||
{
|
||||
return s + 1 + ustrlen(s);
|
||||
return ((wchar_t*) s) + 1 + ustrlen(s);
|
||||
}
|
||||
|
||||
wchar_t *ustrcpy(wchar_t * dest, wchar_t * source)
|
||||
wchar_t *ustrcpy(wchar_t * dest, const wchar_t * source)
|
||||
{
|
||||
wchar_t *ret = dest;
|
||||
do
|
||||
|
@ -141,7 +141,7 @@ int utoi(const wchar_t *s)
|
|||
return n * sign;
|
||||
}
|
||||
|
||||
int utob(wchar_t * s)
|
||||
int utob(const wchar_t * s)
|
||||
{
|
||||
if (!ustricmp(s, L"yes") || !ustricmp(s, L"y") ||
|
||||
!ustricmp(s, L"true") || !ustricmp(s, L"t"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue