From: Pavel Charvat Date: Wed, 4 Jun 2014 00:08:15 +0000 (+0200) Subject: Merge branch 'master' into dev-sizet X-Git-Tag: v6.0~15 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=f1155256f7a168f5e2c0097cb4e7197b79c4f041;p=libucw.git Merge branch 'master' into dev-sizet Conflicts: ucw/bbuf.c ucw/bbuf.h ucw/doc/mempool.txt ucw/fastbuf.h ucw/fb-pool.c ucw/gbuf.h ucw/io-mmap.c ucw/io.h ucw/mempool-fmt.c ucw/mempool-str.c ucw/mempool.c ucw/mempool.h ucw/str-hex.c ucw/string.c ucw/string.h ucw/unicode.c ucw/unicode.h --- f1155256f7a168f5e2c0097cb4e7197b79c4f041 diff --cc ucw/mempool-str.c index 657d756b,26a8b3bc..1072e3da --- a/ucw/mempool-str.c +++ b/ucw/mempool-str.c @@@ -64,11 -64,11 +64,11 @@@ mp_multicat(struct mempool *p, ... } char * - mp_strjoin(struct mempool *p, char **a, uns n, uns sep) + mp_strjoin(struct mempool *p, char **a, uint n, uint sep) { - uint sizes[n]; - uint len = 1; + size_t sizes[n]; + size_t len = 1; - for (uns i=0; ilast_big; } @@@ -384,9 -383,9 +384,9 @@@ static inline char *mp_end_string(struc /** * Return size in bytes of the last allocated memory block (with @mp_alloc() or @mp_end()). **/ -static inline uint mp_size(struct mempool *pool, void *ptr) +static inline size_t mp_size(struct mempool *pool, void *ptr) { - uns idx = mp_idx(pool, ptr); + uint idx = mp_idx(pool, ptr); return ((byte *)pool->state.last[idx] - (byte *)ptr) - pool->state.free[idx]; } diff --cc ucw/str-hex.c index 79f278ab,8cf27cb2..f8595edf --- a/ucw/str-hex.c +++ b/ucw/str-hex.c @@@ -18,9 -18,9 +18,9 @@@ hex_make(uint x } void -mem_to_hex(char *dest, const byte *src, uint bytes, uint flags) +mem_to_hex(char *dest, const byte *src, size_t bytes, uns flags) { - uns sep = flags & 0xff; + uint sep = flags & 0xff; while (bytes--) { @@@ -48,9 -48,9 +48,9 @@@ hex_parse(uint c } const char * -hex_to_mem(byte *dest, const char *src, uint max_bytes, uint flags) +hex_to_mem(byte *dest, const char *src, size_t max_bytes, uns flags) { - uns sep = flags & 0xff; + uint sep = flags & 0xff; while (max_bytes-- && Cxdigit(src[0]) && Cxdigit(src[1])) { *dest++ = (hex_parse(src[0]) << 4) | hex_parse(src[1]); diff --cc ucw/string.h index ca756ef2,a38ab938..b49370ed --- a/ucw/string.h +++ b/ucw/string.h @@@ -37,10 -37,10 +37,10 @@@ size_t strnlen(const char *str, size_t * Format a set of flag bits. When the i-th bit of @flags is 1, * set the i-th character of @dest to @fmt[i], otherwise to '-'. **/ - char *str_format_flags(char *dest, const char *fmt, uns flags); + char *str_format_flags(char *dest, const char *fmt, uint flags); /** Counts occurrences of @chr in @str. **/ -uint str_count_char(const char *str, uint chr); +size_t str_count_char(const char *str, uns chr); /* str-esc.c */