X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Fstring.c;h=29cfa42b5e50699de6fd5f4e62645fbb380c8d15;hb=959566090f98dd31eaa67d3d5959b641e5fe902b;hp=bd9303ee8142a92b548e18580830705d3a1e3eab;hpb=c53020c26307aaae5d519ae2f90ea6dbd8911c39;p=libucw.git diff --git a/ucw/string.c b/ucw/string.c index bd9303ee..29cfa42b 100644 --- a/ucw/string.c +++ b/ucw/string.c @@ -2,7 +2,7 @@ * UCW Library -- String Routines * * (c) 2006 Pavel Charvat - * (c) 2007--2008 Martin Mares + * (c) 2007--2012 Martin Mares * * This software may be freely distributed and used according to the terms * of the GNU Lesser General Public License. @@ -10,12 +10,12 @@ #undef LOCAL_DEBUG -#include "ucw/lib.h" -#include "ucw/string.h" +#include +#include #ifdef CONFIG_DARWIN -uns -strnlen(const char *str, uns n) +size_t +strnlen(const char *str, size_t n) { const char *end = str + n; const char *c; @@ -25,10 +25,10 @@ strnlen(const char *str, uns n) #endif char * -str_format_flags(char *dest, const char *fmt, uns flags) +str_format_flags(char *dest, const char *fmt, uint flags) { char *start = dest; - for (uns i=0; fmt[i]; i++) + for (uint i=0; fmt[i]; i++) { if (flags & (1 << i)) *dest++ = fmt[i]; @@ -39,11 +39,11 @@ str_format_flags(char *dest, const char *fmt, uns flags) return start; } -uns -str_count_char(const char *str, uns chr) +size_t +str_count_char(const char *str, uint chr) { const byte *s = str; - uns i = 0; + size_t i = 0; while (*s) if (*s++ == chr) i++;