diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/nss_wrapper/nss_wrapper.c | 2 | ||||
-rw-r--r-- | lib/util/charset/util_str.c | 8 | ||||
-rw-r--r-- | lib/util/charset/util_unistr_w.c | 4 | ||||
-rw-r--r-- | lib/util/util_net.c | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/lib/nss_wrapper/nss_wrapper.c b/lib/nss_wrapper/nss_wrapper.c index cfa5a68712..8767fbfd89 100644 --- a/lib/nss_wrapper/nss_wrapper.c +++ b/lib/nss_wrapper/nss_wrapper.c @@ -36,7 +36,9 @@ /* defining this gives us the posix getpwnam_r() calls on solaris Thanks to heimdal for this */ +#ifndef _POSIX_PTHREAD_SEMANTICS #define _POSIX_PTHREAD_SEMANTICS +#endif #define NSS_WRAPPER_NOT_REPLACE #include "../replace/replace.h" diff --git a/lib/util/charset/util_str.c b/lib/util/charset/util_str.c index 71a37787ae..4f4ca93cfd 100644 --- a/lib/util/charset/util_str.c +++ b/lib/util/charset/util_str.c @@ -329,7 +329,7 @@ _PUBLIC_ char *strchr_m(const char *src, char c) for (s = src; *s && !(((unsigned char)s[0]) & 0x80); s++) { if (*s == c) - return (char *)s; + return discard_const_p(char, s); } if (!*s) @@ -397,7 +397,7 @@ _PUBLIC_ char *strrchr_m(const char *s, char c) break; } /* No - we have a match ! */ - return (char *)cp; + return discard_const_p(char , cp); } } while (cp-- != s); if (!got_mb) @@ -492,7 +492,7 @@ char *strstr_m(const char *src, const char *findstr) /* for correctness */ if (!findstr[0]) { - return (char*)src; + return discard_const_p(char, src); } /* Samba does single character findstr calls a *lot*. */ @@ -509,7 +509,7 @@ char *strstr_m(const char *src, const char *findstr) findstr_len = strlen(findstr); if (strncmp(s, findstr, findstr_len) == 0) { - return (char *)s; + return discard_const_p(char, s); } } } diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c index a550e52776..22f22ab754 100644 --- a/lib/util/charset/util_unistr_w.c +++ b/lib/util/charset/util_unistr_w.c @@ -22,8 +22,8 @@ #include "includes.h" /* Copy into a smb_ucs2_t from a possibly unaligned buffer. Return the copied smb_ucs2_t */ -#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((unsigned char *)(src))[0],\ - ((unsigned char *)(dest))[1] = ((unsigned char *)(src))[1], (dest)) +#define COPY_UCS2_CHAR(dest,src) (((unsigned char *)(dest))[0] = ((const unsigned char *)(src))[0],\ + ((unsigned char *)(dest))[1] = ((const unsigned char *)(src))[1], (dest)) /* return an ascii version of a ucs2 character */ diff --git a/lib/util/util_net.c b/lib/util/util_net.c index a8a05da138..7d678c9b14 100644 --- a/lib/util/util_net.c +++ b/lib/util/util_net.c @@ -591,7 +591,7 @@ char *print_sockaddr(char *dest, size_t destlen, const struct sockaddr_storage *psa) { - return print_sockaddr_len(dest, destlen, (struct sockaddr *)psa, + return print_sockaddr_len(dest, destlen, (const struct sockaddr *)psa, sizeof(struct sockaddr_storage)); } |