diff options
author | Richard Levitte <levitte@openssl.org> | 2015-12-17 08:24:26 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-12-17 08:24:26 +0100 |
commit | ff8428561a4fa89423862f532436a9b109369d53 (patch) | |
tree | 534e106f063c05fb2802a401a2db243f78571dc3 /crypto/mem.c | |
parent | 33eaf4c27e32ae163e1d36e7b4d8df28c2acb4f2 (diff) |
Modify the lower level memory allocation routines to take size_t
We've been using int for the size for a long time, it's about time...
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/mem.c')
-rw-r--r-- | crypto/mem.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/crypto/mem.c b/crypto/mem.c index a1a75a2ddc..0c8f4e1869 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -107,9 +107,9 @@ static void (*free_secure_func)(void *) = free; /* XXX use correct function pointer types */ #ifdef CRYPTO_MDEBUG /* use default functions from mem_dbg.c */ -static void (*malloc_debug_func) (void *, int, const char *, int, int) +static void (*malloc_debug_func) (void *, size_t, const char *, int, int) = CRYPTO_dbg_malloc; -static void (*realloc_debug_func) (void *, void *, int, const char *, int, +static void (*realloc_debug_func) (void *, void *, size_t, const char *, int, int) = CRYPTO_dbg_realloc; static void (*free_debug_func) (void *, int) = CRYPTO_dbg_free; @@ -197,9 +197,9 @@ int CRYPTO_set_secure_mem_ex_functions(void *(*m)(size_t, const char *, int), return 1; } -int CRYPTO_set_mem_debug_functions(void (*m) - (void *, int, const char *, int, int), - void (*r) (void *, void *, int, +int CRYPTO_set_mem_debug_functions(void (*m) (void *, size_t, + const char *, int, int), + void (*r) (void *, void *, size_t, const char *, int, int), void (*f) (void *, int), void (*so) (long), long (*go) (void)) @@ -245,7 +245,7 @@ void CRYPTO_get_secure_mem_functions(void *(**m)(size_t), void (**f)(void *)) malloc_secure_func : 0; if (f != NULL) *f=free_secure_func; - } +} void CRYPTO_get_secure_mem_ex_functions(void *(**m)(size_t,const char *,int), void (**f)(void *)) @@ -257,9 +257,9 @@ void CRYPTO_get_secure_mem_ex_functions(void *(**m)(size_t,const char *,int), *f=free_secure_func; } -void CRYPTO_get_mem_debug_functions(void (**m) - (void *, int, const char *, int, int), - void (**r) (void *, void *, int, +void CRYPTO_get_mem_debug_functions(void (**m) (void *, size_t, + const char *, int, int), + void (**r) (void *, void *, size_t, const char *, int, int), void (**f) (void *, int), void (**so) (long), long (**go) (void)) @@ -276,7 +276,7 @@ void CRYPTO_get_mem_debug_functions(void (**m) *go = get_debug_options_func; } -void *CRYPTO_malloc(int num, const char *file, int line) +void *CRYPTO_malloc(size_t num, const char *file, int line) { void *ret = NULL; @@ -309,7 +309,7 @@ void *CRYPTO_malloc(int num, const char *file, int line) return ret; } -void *CRYPTO_zalloc(int num, const char *file, int line) +void *CRYPTO_zalloc(size_t num, const char *file, int line) { void *ret = CRYPTO_malloc(num, file, line); @@ -318,7 +318,7 @@ void *CRYPTO_zalloc(int num, const char *file, int line) return ret; } -void *CRYPTO_realloc(void *str, int num, const char *file, int line) +void *CRYPTO_realloc(void *str, size_t num, const char *file, int line) { void *ret = NULL; @@ -337,8 +337,8 @@ void *CRYPTO_realloc(void *str, int num, const char *file, int line) return ret; } -void *CRYPTO_realloc_clean(void *str, int old_len, int num, const char *file, - int line) +void *CRYPTO_realloc_clean(void *str, size_t old_len, size_t num, + const char *file, int line) { void *ret = NULL; |