diff options
author | Jeremy Allison <jra@samba.org> | 2011-10-14 13:51:26 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-10-14 13:51:26 -0700 |
commit | f4a41ce5a6f050fd4b46da8d85b4125791d26560 (patch) | |
tree | 74b2ebe3a6199c072d3381fa08c538b485736f6f | |
parent | 744dd6bcbe7e078daac150d9e7be60c89985b510 (diff) | |
download | samba-f4a41ce5a6f050fd4b46da8d85b4125791d26560.tar.gz samba-f4a41ce5a6f050fd4b46da8d85b4125791d26560.tar.bz2 samba-f4a41ce5a6f050fd4b46da8d85b4125791d26560.zip |
Fix const warnings.
-rw-r--r-- | lib/util/charset/util_unistr_w.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c index 7e0ece383f..72bd19855c 100644 --- a/lib/util/charset/util_unistr_w.c +++ b/lib/util/charset/util_unistr_w.c @@ -130,7 +130,7 @@ smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n) } if (!n) { - return (smb_ucs2_t *)p; + return discard_const_p(smb_ucs2_t, p); } } while (p-- != s); return NULL; @@ -142,7 +142,7 @@ smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n) smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins) { - smb_ucs2_t *r; + const smb_ucs2_t *r; size_t inslen; if (!s || !*s || !ins || !*ins) { @@ -150,11 +150,11 @@ smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins) } inslen = strlen_w(ins); - r = (smb_ucs2_t *)s; + r = s; while ((r = strchr_w(r, *ins))) { if (strncmp_w(r, ins, inslen) == 0) { - return r; + return discard_const_p(smb_ucs2_t, r); } r++; } |