]> mj.ucw.cz Git - libucw.git/commitdiff
Merge branch 'master' into dev-sizet
authorPavel Charvat <pchar@ucw.cz>
Wed, 4 Jun 2014 00:08:15 +0000 (02:08 +0200)
committerPavel Charvat <pchar@ucw.cz>
Wed, 4 Jun 2014 00:08:15 +0000 (02:08 +0200)
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

12 files changed:
1  2 
ucw/bbuf.c
ucw/fastbuf.h
ucw/fb-pool.c
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

diff --cc ucw/bbuf.c
Simple merge
diff --cc ucw/fastbuf.h
Simple merge
diff --cc ucw/fb-pool.c
Simple merge
Simple merge
index 657d756b7483a69aaf045f68b2de94c75bde4a6d,26a8b3bc7416e28f4f01f122e101a870a2cd7b81..1072e3dacb7fde29a0deceef692d77732478b6fa
@@@ -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; i<n; i++)
+   for (uint i=0; i<n; i++)
      len += sizes[i] = strlen(a[i]);
    if (sep && n)
      len += n-1;
diff --cc ucw/mempool.c
Simple merge
diff --cc ucw/mempool.h
index 8bf9bf9153d7152fe44dc08ecfb703b0ca762c95,28ce680af772e9075d8537ec1dc27c8cf9e25069..59ef22960e0df875f8beaec5f99b69dcaea406c7
@@@ -226,11 -225,11 +226,11 @@@ static inline struct ucw_allocator *mp_
   ***/
  
  /* For internal use only, do not call directly */
 -void *mp_start_internal(struct mempool *pool, uint size) LIKE_MALLOC;
 -void *mp_grow_internal(struct mempool *pool, uint size);
 -void *mp_spread_internal(struct mempool *pool, void *p, uint size);
 +void *mp_start_internal(struct mempool *pool, size_t size) LIKE_MALLOC;
 +void *mp_grow_internal(struct mempool *pool, size_t size);
 +void *mp_spread_internal(struct mempool *pool, void *p, size_t size);
  
- static inline uns mp_idx(struct mempool *pool, void *ptr)
+ static inline uint mp_idx(struct mempool *pool, void *ptr)
  {
    return ptr == pool->last_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 79f278ab162d70df6959d1b42bb16d5ac90664d2,8cf27cb2d34c76e70e9ebe3ccb5301fb17652545..f8595edfb8a233213fd3479afa9d9d11ac182cf0
@@@ -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.c
Simple merge
diff --cc ucw/string.h
index ca756ef2e1c13664e1247c8039812c2c81ec2490,a38ab938f4f6b32331f3197952690ac488ac326f..b49370edb056b33c1bfc2cac8d2c065b66041467
@@@ -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 */
  
diff --cc ucw/unicode.c
Simple merge
diff --cc ucw/unicode.h
Simple merge