]> granicus.if.org Git - php/commitdiff
sync libmbfl allocator with the size_t changes
authorAnatol Belski <ab@php.net>
Sat, 22 Jul 2017 21:53:00 +0000 (23:53 +0200)
committerAnatol Belski <ab@php.net>
Sat, 22 Jul 2017 21:53:00 +0000 (23:53 +0200)
ext/mbstring/libmbfl/mbfl/mbfl_allocators.c
ext/mbstring/libmbfl/mbfl/mbfl_allocators.h
ext/mbstring/mbstring.c

index f52c94cf3748357b4a8242b76fce115bc63c82fe..aa468da2528ac12398b2c8ee11ce3d6c9f61ba3f 100644 (file)
@@ -54,9 +54,9 @@
 
 #include "mbfl_allocators.h"
 
-static void *__mbfl__malloc(unsigned int);
-static void *__mbfl__realloc(void *, unsigned int);
-static void *__mbfl__calloc(unsigned int, unsigned int);
+static void *__mbfl__malloc(size_t);
+static void *__mbfl__realloc(void *, size_t);
+static void *__mbfl__calloc(size_t, size_t);
 static void __mbfl__free(void *);
 
 static mbfl_allocators default_allocators = {
@@ -71,17 +71,17 @@ static mbfl_allocators default_allocators = {
 
 mbfl_allocators *__mbfl_allocators = &default_allocators;
 
-static void *__mbfl__malloc(unsigned int sz)
+static void *__mbfl__malloc(size_t sz)
 {
        return malloc(sz);
 }
 
-static void *__mbfl__realloc(void *ptr, unsigned int sz)
+static void *__mbfl__realloc(void *ptr, size_t sz)
 {
        return realloc(ptr, sz);
 }
 
-static void *__mbfl__calloc(unsigned int nelems, unsigned int szelem)
+static void *__mbfl__calloc(size_t nelems, size_t szelem)
 {
        return calloc(nelems, szelem);
 }
index b2981c6f1f7792ca41da778e5d577d42418a99ae..38a3f817efafa6c4b89f2fe53645a0839996b743 100644 (file)
 #include "mbfl_defs.h"
 
 typedef struct _mbfl_allocators {
-       void *(*malloc)(unsigned int);
-       void *(*realloc)(void *, unsigned int);
-       void *(*calloc)(unsigned int, unsigned int);
+       void *(*malloc)(size_t);
+       void *(*realloc)(void *, size_t);
+       void *(*calloc)(size_t, size_t);
        void (*free)(void *);
-       void *(*pmalloc)(unsigned int);
-       void *(*prealloc)(void *, unsigned int);
+       void *(*pmalloc)(size_t);
+       void *(*prealloc)(void *, size_t);
        void (*pfree)(void *);
 } mbfl_allocators;
 
index afc6870802d83bad234997e054a6251820250458..41cfb25478d98e249bde5fffa12d9f43e26f6e65 100644 (file)
@@ -654,17 +654,17 @@ static char *get_output_encoding(void) {
 
 
 /* {{{ allocators */
-static void *_php_mb_allocators_malloc(unsigned int sz)
+static void *_php_mb_allocators_malloc(size_t sz)
 {
        return emalloc(sz);
 }
 
-static void *_php_mb_allocators_realloc(void *ptr, unsigned int sz)
+static void *_php_mb_allocators_realloc(void *ptr, size_t sz)
 {
        return erealloc(ptr, sz);
 }
 
-static void *_php_mb_allocators_calloc(unsigned int nelems, unsigned int szelem)
+static void *_php_mb_allocators_calloc(size_t nelems, size_t szelem)
 {
        return ecalloc(nelems, szelem);
 }
@@ -674,12 +674,12 @@ static void _php_mb_allocators_free(void *ptr)
        efree(ptr);
 }
 
-static void *_php_mb_allocators_pmalloc(unsigned int sz)
+static void *_php_mb_allocators_pmalloc(size_t sz)
 {
        return pemalloc(sz, 1);
 }
 
-static void *_php_mb_allocators_prealloc(void *ptr, unsigned int sz)
+static void *_php_mb_allocators_prealloc(void *ptr, size_t sz)
 {
        return perealloc(ptr, sz, 1);
 }