diff options
Diffstat (limited to 'epan/wmem')
-rw-r--r-- | epan/wmem/wmem_allocator_block.c | 16 | ||||
-rw-r--r-- | epan/wmem/wmem_allocator_strict.c | 10 | ||||
-rw-r--r-- | epan/wmem/wmem_slist.c | 10 | ||||
-rw-r--r-- | epan/wmem/wmem_strbuf.c | 8 | ||||
-rw-r--r-- | epan/wmem/wmem_strutl.c | 6 |
5 files changed, 25 insertions, 25 deletions
diff --git a/epan/wmem/wmem_allocator_block.c b/epan/wmem/wmem_allocator_block.c index 0ccbc4d45b..119302e3ed 100644 --- a/epan/wmem/wmem_allocator_block.c +++ b/epan/wmem/wmem_allocator_block.c @@ -474,17 +474,17 @@ wmem_block_split_free_chunk(wmem_block_allocator_t *allocator, * then update anything that may have pointed to it to point to the * new address instead */ wmem_block_chunk_t *prev, *next; - wmem_block_free_t *old, *new; + wmem_block_free_t *old_blk, *new_blk; - old = WMEM_GET_FREE(chunk); - new = WMEM_GET_FREE(extra); + old_blk = WMEM_GET_FREE(chunk); + new_blk = WMEM_GET_FREE(extra); - prev = old->prev; - next = old->next; + prev = old_blk->prev; + next = old_blk->next; - new->in_free_list = TRUE; - new->prev = prev; - new->next = next; + new_blk->in_free_list = TRUE; + new_blk->prev = prev; + new_blk->next = next; if (prev) WMEM_GET_FREE(prev)->next = extra; if (next) WMEM_GET_FREE(next)->prev = extra; diff --git a/epan/wmem/wmem_allocator_strict.c b/epan/wmem/wmem_allocator_strict.c index 783916bdbb..45ba002de4 100644 --- a/epan/wmem/wmem_allocator_strict.c +++ b/epan/wmem/wmem_allocator_strict.c @@ -77,7 +77,7 @@ static void wmem_strict_ghash_check_canaries(gpointer key _U_, gpointer value, gpointer user_data _U_) { - wmem_strict_block_check_canaries(value); + wmem_strict_block_check_canaries((wmem_strict_allocator_block_t *)value); } static void @@ -93,7 +93,7 @@ wmem_strict_block_free(wmem_strict_allocator_block_t *block) static void wmem_strict_ghash_block_free(gpointer data) { - wmem_strict_block_free(data); + wmem_strict_block_free((wmem_strict_allocator_block_t *)data); } static wmem_strict_allocator_block_t * @@ -104,7 +104,7 @@ wmem_strict_block_new(const size_t size) block = g_slice_new(wmem_strict_allocator_block_t); block->data_len = size; - block->leading_canary = g_malloc(block->data_len + (2 * WMEM_CANARY_SIZE)); + block->leading_canary = (guint8 *)g_malloc(block->data_len + (2 * WMEM_CANARY_SIZE)); block->real_data = block->leading_canary + WMEM_CANARY_SIZE; block->trailing_canary = block->real_data + block->data_len; @@ -143,7 +143,7 @@ wmem_strict_free(void *private_data, void *ptr) allocator = (wmem_strict_allocator_t*) private_data; - block = g_hash_table_lookup(allocator->block_table, ptr); + block = (wmem_strict_allocator_block_t *)g_hash_table_lookup(allocator->block_table, ptr); g_assert(block); @@ -162,7 +162,7 @@ wmem_strict_realloc(void *private_data, void *ptr, const size_t size) allocator = (wmem_strict_allocator_t*) private_data; /* retrieve and check the old block */ - block = g_hash_table_lookup(allocator->block_table, ptr); + block = (wmem_strict_allocator_block_t *)g_hash_table_lookup(allocator->block_table, ptr); g_assert(block); wmem_strict_block_check_canaries(block); diff --git a/epan/wmem/wmem_slist.c b/epan/wmem/wmem_slist.c index d4341359f2..a855d2ddba 100644 --- a/epan/wmem/wmem_slist.c +++ b/epan/wmem/wmem_slist.c @@ -99,14 +99,14 @@ wmem_slist_remove(wmem_slist_t *slist, void *data) void wmem_slist_prepend(wmem_slist_t *slist, void *data) { - wmem_slist_frame_t *new; + wmem_slist_frame_t *new_frame; - new = wmem_new(slist->allocator, wmem_slist_frame_t); + new_frame = wmem_new(slist->allocator, wmem_slist_frame_t); - new->data = data; - new->next = slist->front; + new_frame->data = data; + new_frame->next = slist->front; - slist->front = new; + slist->front = new_frame; slist->count++; } diff --git a/epan/wmem/wmem_strbuf.c b/epan/wmem/wmem_strbuf.c index b0dff00bcd..8ee49b368b 100644 --- a/epan/wmem/wmem_strbuf.c +++ b/epan/wmem/wmem_strbuf.c @@ -58,16 +58,16 @@ wmem_strbuf_sized_new(wmem_allocator_t *allocator, { wmem_strbuf_t *strbuf; - g_assert(alloc_len <= max_len); + g_assert((max_len == 0) || (alloc_len <= max_len)); - strbuf = wmem_alloc(allocator, sizeof(wmem_strbuf_t)); + strbuf = (wmem_strbuf_t *)wmem_alloc(allocator, sizeof(wmem_strbuf_t)); strbuf->allocator = allocator; strbuf->len = 0; strbuf->alloc_len = alloc_len ? alloc_len : DEFAULT_MINIMUM_LEN; strbuf->max_len = max_len; - strbuf->str = wmem_alloc(strbuf->allocator, strbuf->alloc_len); + strbuf->str = (gchar *)wmem_alloc(strbuf->allocator, strbuf->alloc_len); strbuf->str[0] = '\0'; return strbuf; @@ -119,7 +119,7 @@ wmem_strbuf_grow(wmem_strbuf_t *strbuf, const gsize to_add) return; } - strbuf->str = wmem_realloc(strbuf->allocator, strbuf->str, new_alloc_len); + strbuf->str = (gchar *)wmem_realloc(strbuf->allocator, strbuf->str, new_alloc_len); strbuf->alloc_len = new_alloc_len; } diff --git a/epan/wmem/wmem_strutl.c b/epan/wmem/wmem_strutl.c index 958c1ebc09..99d13325e8 100644 --- a/epan/wmem/wmem_strutl.c +++ b/epan/wmem/wmem_strutl.c @@ -47,7 +47,7 @@ wmem_strdup(wmem_allocator_t *allocator, const gchar *src) len = strlen(src) + 1; /* +1 for the null-terminator */ - return memcpy(wmem_alloc(allocator, len), src, len); + return (gchar *)memcpy(wmem_alloc(allocator, len), src, len); } gchar * @@ -56,7 +56,7 @@ wmem_strndup(wmem_allocator_t *allocator, const gchar *src, const size_t len) gchar *dst; guint i; - dst = wmem_alloc(allocator, len+1); + dst = (gchar *)wmem_alloc(allocator, len+1); for (i=0; (i < len) && src[i]; i++) { dst[i] = src[i]; @@ -91,7 +91,7 @@ wmem_strdup_vprintf(wmem_allocator_t *allocator, const gchar *fmt, va_list ap) len = g_printf_string_upper_bound(fmt, ap); - dst = wmem_alloc(allocator, len+1); + dst = (gchar *)wmem_alloc(allocator, len+1); g_vsnprintf(dst, (gulong) len, fmt, ap2); va_end(ap2); |