From: Anatol Belski Date: Sat, 22 Jul 2017 21:53:00 +0000 (+0200) Subject: sync libmbfl allocator with the size_t changes X-Git-Tag: php-7.3.0alpha1~1836^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61784bcb718b924acaad084a8ac2ed273e57f8fa;p=php sync libmbfl allocator with the size_t changes --- diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c index f52c94cf37..aa468da252 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c +++ b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.c @@ -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); } diff --git a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h index b2981c6f1f..38a3f817ef 100644 --- a/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h +++ b/ext/mbstring/libmbfl/mbfl/mbfl_allocators.h @@ -34,12 +34,12 @@ #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; diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index afc6870802..41cfb25478 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -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); }