configure: add '-Wundef' to warning flags
[lttng-tools.git] / src / common / compat / string.h
index a18d9e7cab56c2434a67debccf45d05b82252734..4a96cb1456ffd2a928d18439007cfc3959b2b5e5 100644 (file)
@@ -25,7 +25,7 @@ size_t lttng_strnlen(const char *str, size_t max)
        size_t ret;
        const char *end;
 
-       end = memchr(str, 0, max);
+       end = (const char *) memchr(str, 0, max);
 
        if (end) {
                ret = (size_t) (end - str);
@@ -61,7 +61,7 @@ char *lttng_strndup(const char *s, size_t n)
                navail = n + 1;
        }
 
-       ret = malloc(navail);
+       ret = (char *) malloc(navail);
        if (!ret) {
                goto end;
        }
@@ -109,18 +109,18 @@ static inline int lttng_fls(int val)
 }
 #endif /* HAVE_FLS */
 
-#if HAVE_MEMRCHR
+#ifdef HAVE_MEMRCHR
 static inline
 void *lttng_memrchr(const void *s, int c, size_t n)
 {
-       return memrchr(s, c, n);
+       return (void *) memrchr(s, c, n);
 }
 #else
 static inline
 void *lttng_memrchr(const void *s, int c, size_t n)
 {
        int i;
-       const char *str = s;
+       const char *str = (const char *) s;
        for (i = n-1; i >= 0; i--) {
                if (str[i] == (char)c) {
                        return (void *)(str+i);
This page took 0.02774 seconds and 4 git commands to generate.