diff options
author | Jeremy Allison <jra@samba.org> | 2011-05-05 10:41:59 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-05-05 10:41:59 -0700 |
commit | 4f41be356a4e6b311d30de3b2e36e4c33aa72ca3 (patch) | |
tree | 91adb9035c762c36a6cb24f242c11408779bd3f7 /lib/util/charset | |
parent | 10a628b6e181af07f0c43db36ba017411b4eaaaa (diff) | |
download | samba-4f41be356a4e6b311d30de3b2e36e4c33aa72ca3.tar.gz samba-4f41be356a4e6b311d30de3b2e36e4c33aa72ca3.tar.bz2 samba-4f41be356a4e6b311d30de3b2e36e4c33aa72ca3.zip |
Fix many const compiler warnings.
Diffstat (limited to 'lib/util/charset')
-rw-r--r-- | lib/util/charset/util_str.c | 2 | ||||
-rw-r--r-- | lib/util/charset/util_unistr_w.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c index 4f4ca93cfd..e76c1dbbf5 100644 --- a/lib/util/charset/util_str.c +++ b/lib/util/charset/util_str.c @@ -550,7 +550,7 @@ char *strstr_m(const char *src, const char *findstr) DEBUG(0,("strstr_m: dest malloc fail\n")); return NULL; } - retp = (char *)(s+strlen(s2)); + retp = discard_const_p(char, (s+strlen(s2))); TALLOC_FREE(src_w); TALLOC_FREE(find_w); TALLOC_FREE(s2); diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c index 22f22ab754..5b61d52e7f 100644 --- a/lib/util/charset/util_unistr_w.c +++ b/lib/util/charset/util_unistr_w.c @@ -72,12 +72,12 @@ smb_ucs2_t *strchr_w(const smb_ucs2_t *s, smb_ucs2_t c) smb_ucs2_t cp; while (*(COPY_UCS2_CHAR(&cp,s))) { if (c == cp) { - return (smb_ucs2_t *)s; + return discard_const_p(smb_ucs2_t, s); } s++; } if (c == cp) { - return (smb_ucs2_t *)s; + return discard_const_p(smb_ucs2_t, s); } return NULL; @@ -104,7 +104,7 @@ smb_ucs2_t *strrchr_w(const smb_ucs2_t *s, smb_ucs2_t c) p += (len - 1); do { if (c == *(COPY_UCS2_CHAR(&cp,p))) { - return (smb_ucs2_t *)p; + return discard_const_p(smb_ucs2_t, p); } } while (p-- != s); return NULL; |