git.samba.org
/
obnox
/
samba
/
samba-obnox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
744dd6b
)
Fix const warnings.
author
Jeremy Allison
<jra@samba.org>
Fri, 14 Oct 2011 20:51:26 +0000
(13:51 -0700)
committer
Jeremy Allison
<jra@samba.org>
Fri, 14 Oct 2011 20:51:26 +0000
(13:51 -0700)
lib/util/charset/util_unistr_w.c
patch
|
blob
|
history
diff --git
a/lib/util/charset/util_unistr_w.c
b/lib/util/charset/util_unistr_w.c
index 7e0ece383f209021086d5382d7ccc4ebc4c7456b..72bd19855c672e02b775ffc97bd7f5d2b4194009 100644
(file)
--- 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) {
}
if (!n) {
- return
(smb_ucs2_t *)p
;
+ return
discard_const_p(smb_ucs2_t, p)
;
}
} while (p-- != s);
return NULL;
}
} 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 *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) {
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);
}
inslen = strlen_w(ins);
- r =
(smb_ucs2_t *)
s;
+ r = s;
while ((r = strchr_w(r, *ins))) {
if (strncmp_w(r, ins, inslen) == 0) {
while ((r = strchr_w(r, *ins))) {
if (strncmp_w(r, ins, inslen) == 0) {
- return
r
;
+ return
discard_const_p(smb_ucs2_t, r)
;
}
r++;
}
}
r++;
}