summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:46 +1030
committerRusty Russell <rusty@rustcorp.com.au>2011-12-05 16:42:46 +1030
commit00b226bfe48faba2ab8c74cae5eeff564969d03a (patch)
tree411071e79454153719e05340cb727202ee06e706 /lib
parented349eabd99e76d42ce5e42b914dd50afc643afd (diff)
downloadsamba-00b226bfe48faba2ab8c74cae5eeff564969d03a.tar.gz
samba-00b226bfe48faba2ab8c74cae5eeff564969d03a.tar.bz2
samba-00b226bfe48faba2ab8c74cae5eeff564969d03a.zip
lib/ccan/str: fix warnings.
Firstly, -Wwrite-strings makes string literals const, secondly, we mustn't define str_strstr etc in terms of themselves! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit 0845e79650c9257aa0ddef8ff99fd815b5edffac)
Diffstat (limited to 'lib')
-rw-r--r--lib/ccan/str/debug.c3
-rw-r--r--lib/ccan/str/test/run.c3
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/ccan/str/debug.c b/lib/ccan/str/debug.c
index 9ef756766a..027915bc64 100644
--- a/lib/ccan/str/debug.c
+++ b/lib/ccan/str/debug.c
@@ -86,6 +86,9 @@ int str_isxdigit(int i)
return isxdigit(i);
}
+#undef strstr
+#undef strchr
+#undef strrchr
char *str_strstr(const char *haystack, const char *needle)
{
diff --git a/lib/ccan/str/test/run.c b/lib/ccan/str/test/run.c
index a15654f8f3..f253746e7b 100644
--- a/lib/ccan/str/test/run.c
+++ b/lib/ccan/str/test/run.c
@@ -6,7 +6,8 @@
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof(arr[0]))
-static char *substrings[] = { "far", "bar", "baz", "b", "ba", "z", "ar", NULL };
+static const char *substrings[] = { "far", "bar", "baz", "b", "ba", "z", "ar",
+ NULL };
#define NUM_SUBSTRINGS (ARRAY_SIZE(substrings) - 1)