From 4f41be356a4e6b311d30de3b2e36e4c33aa72ca3 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 10:41:59 -0700 Subject: Fix many const compiler warnings. --- lib/util/charset/util_str.c | 2 +- lib/util/charset/util_unistr_w.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/util/charset') 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; -- cgit