diff options
author | Michael Mann <mmann78@netscape.net> | 2016-05-12 13:39:15 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-05-13 16:00:58 +0000 |
commit | 4d4190f12791ca04599c616800b6f7803b1d5f54 (patch) | |
tree | 1bd25c14b2cb3a28ff7e4ea61c2710ce1349e713 /epan/wmem | |
parent | f3e120816c1e74eda131f95a74e61777995c2c7b (diff) |
Have wmem conform to checkAPIs.pl
Yes, the rename of structure members is a bit hacky.
Yes, catering to Windows since "GLib's v*printf routines are
surprisingly slow on Windows".
But it does pass checkAPIs.pl
Change-Id: I5b1552472c83aa2e159f17b5b7eb70b37d03eff9
Reviewed-on: https://code.wireshark.org/review/15404
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/wmem')
-rw-r--r-- | epan/wmem/wmem_allocator.h | 6 | ||||
-rw-r--r-- | epan/wmem/wmem_allocator_block.c | 6 | ||||
-rw-r--r-- | epan/wmem/wmem_allocator_block_fast.c | 6 | ||||
-rw-r--r-- | epan/wmem/wmem_allocator_simple.c | 6 | ||||
-rw-r--r-- | epan/wmem/wmem_allocator_strict.c | 6 | ||||
-rw-r--r-- | epan/wmem/wmem_core.c | 6 | ||||
-rw-r--r-- | epan/wmem/wmem_strutl.c | 3 |
7 files changed, 20 insertions, 19 deletions
diff --git a/epan/wmem/wmem_allocator.h b/epan/wmem/wmem_allocator.h index e131a30f8e..530663a23d 100644 --- a/epan/wmem/wmem_allocator.h +++ b/epan/wmem/wmem_allocator.h @@ -37,9 +37,9 @@ struct _wmem_user_cb_container_t; * on this structure */ struct _wmem_allocator_t { /* Consumer functions */ - void *(*alloc)(void *private_data, const size_t size); - void (*free)(void *private_data, void *ptr); - void *(*realloc)(void *private_data, void *ptr, const size_t size); + void *(*walloc)(void *private_data, const size_t size); + void (*wfree)(void *private_data, void *ptr); + void *(*wrealloc)(void *private_data, void *ptr, const size_t size); /* Producer/Manager functions */ void (*free_all)(void *private_data); diff --git a/epan/wmem/wmem_allocator_block.c b/epan/wmem/wmem_allocator_block.c index 6d7d42a18f..c487db62b0 100644 --- a/epan/wmem/wmem_allocator_block.c +++ b/epan/wmem/wmem_allocator_block.c @@ -1108,9 +1108,9 @@ wmem_block_allocator_init(wmem_allocator_t *allocator) block_allocator = wmem_new(NULL, wmem_block_allocator_t); - allocator->alloc = &wmem_block_alloc; - allocator->realloc = &wmem_block_realloc; - allocator->free = &wmem_block_free; + allocator->walloc = &wmem_block_alloc; + allocator->wrealloc = &wmem_block_realloc; + allocator->wfree = &wmem_block_free; allocator->free_all = &wmem_block_free_all; allocator->gc = &wmem_block_gc; diff --git a/epan/wmem/wmem_allocator_block_fast.c b/epan/wmem/wmem_allocator_block_fast.c index 6e1de7f6d7..d5f705653d 100644 --- a/epan/wmem/wmem_allocator_block_fast.c +++ b/epan/wmem/wmem_allocator_block_fast.c @@ -242,9 +242,9 @@ wmem_block_fast_allocator_init(wmem_allocator_t *allocator) block_allocator = wmem_new(NULL, wmem_block_fast_allocator_t); - allocator->alloc = &wmem_block_fast_alloc; - allocator->realloc = &wmem_block_fast_realloc; - allocator->free = &wmem_block_fast_free; + allocator->walloc = &wmem_block_fast_alloc; + allocator->wrealloc = &wmem_block_fast_realloc; + allocator->wfree = &wmem_block_fast_free; allocator->free_all = &wmem_block_fast_free_all; allocator->gc = &wmem_block_fast_gc; diff --git a/epan/wmem/wmem_allocator_simple.c b/epan/wmem/wmem_allocator_simple.c index 85eb1b41bc..394fadb8f9 100644 --- a/epan/wmem/wmem_allocator_simple.c +++ b/epan/wmem/wmem_allocator_simple.c @@ -133,9 +133,9 @@ wmem_simple_allocator_init(wmem_allocator_t *allocator) simple_allocator = wmem_new(NULL, wmem_simple_allocator_t); - allocator->alloc = &wmem_simple_alloc; - allocator->realloc = &wmem_simple_realloc; - allocator->free = &wmem_simple_free; + allocator->walloc = &wmem_simple_alloc; + allocator->wrealloc = &wmem_simple_realloc; + allocator->wfree = &wmem_simple_free; allocator->free_all = &wmem_simple_free_all; allocator->gc = &wmem_simple_gc; diff --git a/epan/wmem/wmem_allocator_strict.c b/epan/wmem/wmem_allocator_strict.c index 241d1c4e1d..66e8612b01 100644 --- a/epan/wmem/wmem_allocator_strict.c +++ b/epan/wmem/wmem_allocator_strict.c @@ -215,9 +215,9 @@ wmem_strict_allocator_init(wmem_allocator_t *allocator) strict_allocator = wmem_new(NULL, wmem_strict_allocator_t); - allocator->alloc = &wmem_strict_alloc; - allocator->realloc = &wmem_strict_realloc; - allocator->free = &wmem_strict_free; + allocator->walloc = &wmem_strict_alloc; + allocator->wrealloc = &wmem_strict_realloc; + allocator->wfree = &wmem_strict_free; allocator->free_all = &wmem_strict_free_all; allocator->gc = &wmem_strict_gc; diff --git a/epan/wmem/wmem_core.c b/epan/wmem/wmem_core.c index fb3fa2fea2..f5d932e816 100644 --- a/epan/wmem/wmem_core.c +++ b/epan/wmem/wmem_core.c @@ -53,7 +53,7 @@ wmem_alloc(wmem_allocator_t *allocator, const size_t size) return NULL; } - return allocator->alloc(allocator->private_data, size); + return allocator->walloc(allocator->private_data, size); } void * @@ -84,7 +84,7 @@ wmem_free(wmem_allocator_t *allocator, void *ptr) return; } - allocator->free(allocator->private_data, ptr); + allocator->wfree(allocator->private_data, ptr); } void * @@ -105,7 +105,7 @@ wmem_realloc(wmem_allocator_t *allocator, void *ptr, const size_t size) g_assert(allocator->in_scope); - return allocator->realloc(allocator->private_data, ptr, size); + return allocator->wrealloc(allocator->private_data, ptr, size); } static void diff --git a/epan/wmem/wmem_strutl.c b/epan/wmem/wmem_strutl.c index 009abf1d80..915e9e5dd8 100644 --- a/epan/wmem/wmem_strutl.c +++ b/epan/wmem/wmem_strutl.c @@ -31,6 +31,7 @@ #endif #include <glib.h> +#include <glib/gprintf.h> #include "wmem_core.h" #include "wmem_allocator.h" @@ -140,7 +141,7 @@ wmem_strdup_vprintf(wmem_allocator_t *allocator, const gchar *fmt, va_list ap) dst = (gchar *)wmem_alloc(allocator, needed_len); - vsprintf(dst, fmt, ap2); + vsprintf_s(dst, needed_len, fmt, ap2); va_end(ap2); |