diff options
author | Jeremy Allison <jra@samba.org> | 2011-05-04 14:57:37 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-05-05 00:59:40 +0200 |
commit | 1c714850d5068864b1f04a4211223dec11a30d67 (patch) | |
tree | b890a5ba8a0f900f667ce79210ac0a4593f02642 /lib/util/charset | |
parent | ff215f5c89c91a22c910400c8ac81d82d7459ba0 (diff) | |
download | samba-1c714850d5068864b1f04a4211223dec11a30d67.tar.gz samba-1c714850d5068864b1f04a4211223dec11a30d67.tar.bz2 samba-1c714850d5068864b1f04a4211223dec11a30d67.zip |
Clean up some const and other compiler warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu May 5 00:59:40 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/util/charset')
-rw-r--r-- | lib/util/charset/util_str.c | 8 | ||||
-rw-r--r-- | lib/util/charset/util_unistr_w.c | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c index 71a37787ae..4f4ca93cfd 100644 --- a/lib/util/charset/util_str.c +++ b/lib/util/charset/util_str.c @@ -329,7 +329,7 @@ _PUBLIC_ char *strchr_m(const char *src, char c) for (s = src; *s && !(((unsigned char)s[0]) & 0x80); s++) { if (*s == c) - return (char *)s; + return discard_const_p(char, s); } if (!*s) @@ -397,7 +397,7 @@ _PUBLIC_ char *strrchr_m(const char *s, char c) break; } /* No - we have a match ! */ - return (char *)cp; + return discard_const_p(char , cp); } } while (cp-- != s); if (!got_mb) @@ -492,7 +492,7 @@ char *strstr_m(const char *src, const char *findstr) /* for correctness */ if (!findstr[0]) { - return (char*)src; + return discard_const_p(char, src); } /* Samba does single character findstr calls a *lot*. */ @@ -509,7 +509,7 @@ char *strstr_m(const char *src, const char *findstr) findstr_len = strlen(findstr); if (strncmp(s, findstr, findstr_len) == 0) { - return (char *)s; + return discard_const_p(char, s); } } } diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c index a550e52776..22f22ab754 100644 --- a/lib/util/charset/util_unistr_w.c +++ b/lib/util/charset/util_unistr_w.c @@ -22,8 +22,8 @@ #include "includes.h" /* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */ -#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\ - ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest)) +#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((const unsigned char *)(src))[0],\ + ((unsigned char *)(dest))[1] = ((const unsigned char *)(src))[1], (dest)) /* return an ascii version of a ucs2 character */ |