diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-17 00:58:39 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-17 00:58:39 +0200 |
commit | 69ed661a488c0e02bf5fee3dc21e6a31a99a8d85 (patch) | |
tree | d4172bd2932f8b163b58651dd2f1e14f535304c0 /src/wchar | |
parent | m fixes (diff) | |
download | slibc-69ed661a488c0e02bf5fee3dc21e6a31a99a8d85.tar.gz slibc-69ed661a488c0e02bf5fee3dc21e6a31a99a8d85.tar.bz2 slibc-69ed661a488c0e02bf5fee3dc21e6a31a99a8d85.tar.xz |
fix errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/wchar')
-rw-r--r-- | src/wchar/wcschr.c | 12 | ||||
-rw-r--r-- | src/wchar/wcscmp.c | 6 | ||||
-rw-r--r-- | src/wchar/wcsspn.c | 2 | ||||
-rw-r--r-- | src/wchar/wcsstr.c | 46 | ||||
-rw-r--r-- | src/wchar/wmemccpy.c | 4 |
5 files changed, 35 insertions, 35 deletions
diff --git a/src/wchar/wcschr.c b/src/wchar/wcschr.c index 9b87167..7acc032 100644 --- a/src/wchar/wcschr.c +++ b/src/wchar/wcschr.c @@ -32,7 +32,7 @@ * @return Pointer to the first occurrence of `c`, * `NULL` if none were found. */ -wchar_t* wmemchr(const wchar_t* segment, wchar_t c, size_t size) +wchar_t* (wmemchr)(const wchar_t* segment, wchar_t c, size_t size) { while (size--) if (*segment++ == c) @@ -52,7 +52,7 @@ wchar_t* wmemchr(const wchar_t* segment, wchar_t c, size_t size) * @param c The sought after character. * @return Pointer to the first occurrence of `c`. */ -wchar_t* rawwmemchr(const wchar_t* segment, wchar_t c) +wchar_t* (rawwmemchr)(const wchar_t* segment, wchar_t c) { for (;;) if (*segment++ == c) @@ -76,7 +76,7 @@ wchar_t* rawwmemchr(const wchar_t* segment, wchar_t c) * @return Pointer to the last occurrence of `c`, * `NULL` if none were found. */ -wchar_t* wmemrchr(const wchar_t* segment, wchar_t c, size_t size) +wchar_t* (wmemrchr)(const wchar_t* segment, wchar_t c, size_t size) { while (size--) if (segment[size] == c) @@ -95,7 +95,7 @@ wchar_t* wmemrchr(const wchar_t* segment, wchar_t c, size_t size) * @return Pointer to the first occurrence of `c`, * `NULL` if none were found. */ -wchar_t* wcschr(const wchar_t* string, wchar_t c) +wchar_t* (wcschr)(const wchar_t* string, wchar_t c) { for (;;) if (*string == c) @@ -120,7 +120,7 @@ wchar_t* wcschr(const wchar_t* string, wchar_t c) * Pointer to the terminating NUL character * if none were found. */ -wchar_t* wcschrnul(const wchar_t* string, wchar_t c) +wchar_t* (wcschrnul)(const wchar_t* string, wchar_t c) { for (;; string++) if (*string == c) @@ -144,7 +144,7 @@ wchar_t* wcschrnul(const wchar_t* string, wchar_t c) * @return Pointer to the last occurrence of `c`, * `NULL` if none were found. */ -wchar_t* wcsrchr(const wchar_t* string, wchar_t c) +wchar_t* (wcsrchr)(const wchar_t* string, wchar_t c) { wchar_t* r = NULL; for (;;) diff --git a/src/wchar/wcscmp.c b/src/wchar/wcscmp.c index ddbd228..980906d 100644 --- a/src/wchar/wcscmp.c +++ b/src/wchar/wcscmp.c @@ -17,7 +17,7 @@ */ #include <wchar.h> #include <stdint.h> -#include <wctype.h> +/* TODO #include <wctype.h> */ @@ -54,7 +54,7 @@ int wmemcasecmp(const wchar_t* a, const wchar_t* b, size_t size) { wchar_t c1, c2; for (; size--; a++, b++) - if (*a != *b); + if (*a != *b) { c1 = iswalpha(*a) ? towlower(*a) : *a; c2 = iswalpha(*b) ? towlower(*b) : *b; @@ -115,7 +115,7 @@ int wcsncmp(const wchar_t* a, const wchar_t* b, size_t length) size_t n = wcsnlen(a, length); size_t m = wcsnlen(b, length); int r = wmemcmp(a, b, (n < m ? n : m)); - return r ? r : n == m ? 0 : n < m ? -1 : +1 + return r ? r : n == m ? 0 : n < m ? -1 : +1; } diff --git a/src/wchar/wcsspn.c b/src/wchar/wcsspn.c index 63dc60b..e4a1190 100644 --- a/src/wchar/wcsspn.c +++ b/src/wchar/wcsspn.c @@ -79,7 +79,7 @@ size_t wcscspn(const wchar_t* string, const wchar_t* stopset) * `string` of a character found in `stopset`. * `NULL` is returned if none is found. */ -wchar_t* wcspbrk(const wchar_t* string, const wchar_t* stopset) +wchar_t* (wcspbrk)(const wchar_t* string, const wchar_t* stopset) { string += wcscspn(string, stopset); return *string ? string : NULL; diff --git a/src/wchar/wcsstr.c b/src/wchar/wcsstr.c index bc2bbec..36ae893 100644 --- a/src/wchar/wcsstr.c +++ b/src/wchar/wcsstr.c @@ -19,7 +19,7 @@ #include <stdint.h> #include <unistd.h> #include <alloca.h> -#include <wctype.h> +/* TODO #include <wctype.h> */ #define WIDE @@ -31,9 +31,9 @@ /** * This function is identical to `wcsstr`. */ -wchar_t* wcswcs(const wchar_t* haystack, const wchar_t* needle) +wchar_t* (wcswcs)(const wchar_t* haystack, const wchar_t* needle) { - return wcsstr(haystack, needle); + return (wcsstr)(haystack, needle); } @@ -46,9 +46,9 @@ wchar_t* wcswcs(const wchar_t* haystack, const wchar_t* needle) * @return Pointer to the first occurrence of the * substring, `NULL` if not found. */ -wchar_t* wcsstr(const wchar_t* haystack, const wchar_t* needle) +wchar_t* (wcsstr)(const wchar_t* haystack, const wchar_t* needle) { - return wmemmem(haystack, wcslen(haystack), needle, wcslen(needle)); + return (wmemmem)(haystack, wcslen(haystack), needle, wcslen(needle)); } @@ -63,9 +63,9 @@ wchar_t* wcsstr(const wchar_t* haystack, const wchar_t* needle) * @return Pointer to the first occurrence of the * substring, `NULL` if not found. */ -wchar_t* wcscasestr(const wchar_t* haystack, const wchar_t* needle) +wchar_t* (wcscasestr)(const wchar_t* haystack, const wchar_t* needle) { - return wmemcasemem(haystack, wcslen(haystack), needle, wcslen(needle)); + return (wmemcasemem)(haystack, wcslen(haystack), needle, wcslen(needle)); } @@ -82,9 +82,9 @@ wchar_t* wcscasestr(const wchar_t* haystack, const wchar_t* needle) * @return Pointer to the first occurrence of the * substring, `NULL` if not found. */ -wchar_t* wcsnstr(const wchar_t* haystack, const wchar_t* needle, size_t maxlen) +wchar_t* (wcsnstr)(const wchar_t* haystack, const wchar_t* needle, size_t maxlen) { - return wmemmem(haystack, wcsnlen(haystack, maxlen), needle, wcslen(needle)); + return (wmemmem)(haystack, wcsnlen(haystack, maxlen), needle, wcslen(needle)); } @@ -100,9 +100,9 @@ wchar_t* wcsnstr(const wchar_t* haystack, const wchar_t* needle, size_t maxlen) * @return Pointer to the first occurrence of the * substring, `NULL` if not found. */ -wchar_t* wcsncasestr(const wchar_t* haystack, const wchar_t* needle, size_t maxlen) +wchar_t* (wcsncasestr)(const wchar_t* haystack, const wchar_t* needle, size_t maxlen) { - return wmemcasemem(haystack, wcsnlen(haystack, maxlen), needle, wcslen(needle)); + return (wmemcasemem)(haystack, wcsnlen(haystack, maxlen), needle, wcslen(needle)); } @@ -117,9 +117,9 @@ wchar_t* wcsncasestr(const wchar_t* haystack, const wchar_t* needle, size_t maxl * @param needle The sought after substring. * @return Pointer to the first occurrence of the substring. */ -wchar_t* rawwcsstr(const wchar_t* haystack, const wchar_t* needle) +wchar_t* (rawwcsstr)(const wchar_t* haystack, const wchar_t* needle) { - return wmemmem(haystack, SIZE_MAX, needle, wcslen(needle)); + return (wmemmem)(haystack, SIZE_MAX, needle, wcslen(needle)); } @@ -134,9 +134,9 @@ wchar_t* rawwcsstr(const wchar_t* haystack, const wchar_t* needle) * @param needle The sought after substring. * @return Pointer to the first occurrence of the substring. */ -wchar_t* rawwcscasestr(const wchar_t* haystack, const wchar_t* needle) +wchar_t* (rawwcscasestr)(const wchar_t* haystack, const wchar_t* needle) { - return wmemcasemem(haystack, SIZE_MAX, needle, wcslen(needle)); + return (wmemcasemem)(haystack, SIZE_MAX, needle, wcslen(needle)); } @@ -155,8 +155,8 @@ wchar_t* rawwcscasestr(const wchar_t* haystack, const wchar_t* needle) * @return Pointer to the first occurrence of * the substring, `NULL` if not found. */ -wchar_t* wmemmem(const wchar_t* haystack, size_t haystack_length, - const wchar_t* needle, size_t needle_length) +wchar_t* (wmemmem)(const wchar_t* haystack, size_t haystack_length, + const wchar_t* needle, size_t needle_length) { if (haystack_length < needle_length) return NULL; @@ -180,8 +180,8 @@ wchar_t* wmemmem(const wchar_t* haystack, size_t haystack_length, * @return Pointer to the first occurrence of * the substring, `NULL` if not found. */ -wchar_t* wmemcasemem(const wchar_t* haystack, size_t haystack_length, - const wchar_t* needle, size_t needle_length) +wchar_t* (wmemcasemem)(const wchar_t* haystack, size_t haystack_length, + const wchar_t* needle, size_t needle_length) { if (haystack_length < needle_length) return NULL; @@ -204,7 +204,7 @@ wchar_t* wmemcasemem(const wchar_t* haystack, size_t haystack_length, * @return `string` if `string` begins with * `desired`, `NULL` otherwise. */ -wchar_t* wcsstarts(const wchar_t* string, const wchar_t* desired) +wchar_t* (wcsstarts)(const wchar_t* string, const wchar_t* desired) { size_t n = wcslen(string); size_t m = wcslen(desired); @@ -225,7 +225,7 @@ wchar_t* wcsstarts(const wchar_t* string, const wchar_t* desired) * @return The `string`, where `desired` beings if * `string` ends with `desired`, `NULL` otherwise. */ -wchar_t* wcsends(const wchar_t* string, const wchar_t* desired) +wchar_t* (wcsends)(const wchar_t* string, const wchar_t* desired) { size_t n = wcslen(string); size_t m = wcslen(desired); @@ -246,7 +246,7 @@ wchar_t* wcsends(const wchar_t* string, const wchar_t* desired) * @return `string` if `string` begins with * `desired`, `NULL` otherwise. */ -wchar_t* wcscasestarts(const wchar_t* string, const wchar_t* desired) +wchar_t* (wcscasestarts)(const wchar_t* string, const wchar_t* desired) { size_t n = wcslen(string); size_t m = wcslen(desired); @@ -267,7 +267,7 @@ wchar_t* wcscasestarts(const wchar_t* string, const wchar_t* desired) * @return The `string`, where `desired` beings if * `string` ends with `desired`, `NULL` otherwise. */ -wchar_t* wcscaseends(const wchar_t* string, const wchar_t* desired) +wchar_t* (wcscaseends)(const wchar_t* string, const wchar_t* desired) { size_t n = wcslen(string); size_t m = wcslen(desired); diff --git a/src/wchar/wmemccpy.c b/src/wchar/wmemccpy.c index cde1a6a..498e4db 100644 --- a/src/wchar/wmemccpy.c +++ b/src/wchar/wmemccpy.c @@ -37,7 +37,7 @@ */ wchar_t* wmemccpy(wchar_t* restrict whither, const wchar_t* restrict whence, wchar_t c, size_t size) { - wchar_t* stop = wmemchr(whence, c, size); + wchar_t* stop = (wmemchr)(whence, c, size); wchar_t* r = NULL; if (stop != NULL) size = (size_t)(stop - whence), r = whither + size; @@ -64,7 +64,7 @@ wchar_t* wmemccpy(wchar_t* restrict whither, const wchar_t* restrict whence, wch */ wchar_t* wmemcmove(wchar_t* whither, const wchar_t* whence, wchar_t c, size_t size) { - wchar_t* stop = wmemchr(whence, c, size); + wchar_t* stop = (wmemchr)(whence, c, size); wchar_t* r = NULL; if (stop != NULL) size = (size_t)(stop - whence), r = whither + size; |