diff options
author | Evan Huus <eapache@gmail.com> | 2013-03-27 02:28:45 +0000 |
---|---|---|
committer | Evan Huus <eapache@gmail.com> | 2013-03-27 02:28:45 +0000 |
commit | 64af18ddda1197497c5308e1f153c45a97b09ec1 (patch) | |
tree | 7cc9850e9e35bd14fa6c2fff9d5f0ad8ee562818 /epan/wmem/wmem_allocator_block.c | |
parent | 4252a18c90ca4e4e054d42db2d4af6d95cc3d59b (diff) |
Fix -Wshadow that happens with some old versions of gcc (not mine, for some
reason).
Don't use g_assert_cmpuint, since it apparently causes warnings on windows that
I don't know how to get rid of safely without breaking the conditions being
checked.
svn path=/trunk/; revision=48575
Diffstat (limited to 'epan/wmem/wmem_allocator_block.c')
-rw-r--r-- | epan/wmem/wmem_allocator_block.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/wmem/wmem_allocator_block.c b/epan/wmem/wmem_allocator_block.c index 682aa97c94..08a1e490dc 100644 --- a/epan/wmem/wmem_allocator_block.c +++ b/epan/wmem/wmem_allocator_block.c @@ -173,19 +173,19 @@ wmem_block_verify_chunk_chain(wmem_block_chunk_t *chunk) { guint32 total_len = 0; - g_assert_cmpuint(chunk->prev, ==, 0); + g_assert(chunk->prev == 0); do { total_len += chunk->len; if (WMEM_CHUNK_NEXT(chunk)) { - g_assert_cmpuint(chunk->len, ==, WMEM_CHUNK_NEXT(chunk)->prev); + g_assert(chunk->len == WMEM_CHUNK_NEXT(chunk)->prev); } chunk = WMEM_CHUNK_NEXT(chunk); } while (chunk); - g_assert_cmpuint(total_len, ==, WMEM_BLOCK_SIZE); + g_assert(total_len == WMEM_BLOCK_SIZE); } static void @@ -312,7 +312,7 @@ wmem_block_add_to_free_list_after(wmem_block_allocator_t *allocator, wmem_block_free_t *freeChunk; g_assert(!chunk->used); - g_assert_cmpuint(WMEM_CHUNK_DATA_LEN(chunk), >=, sizeof(wmem_block_free_t)); + g_assert(WMEM_CHUNK_DATA_LEN(chunk) >= sizeof(wmem_block_free_t)); freeChunk = WMEM_GET_FREE(chunk); @@ -450,7 +450,7 @@ wmem_block_split_free_chunk(wmem_block_allocator_t *allocator, gboolean last; g_assert(!chunk->used); - g_assert_cmpuint(WMEM_CHUNK_DATA_LEN(chunk), >=, size); + g_assert(WMEM_CHUNK_DATA_LEN(chunk) >= size); aligned_size = WMEM_ALIGN_SIZE(size); @@ -559,7 +559,7 @@ wmem_block_split_used_chunk(wmem_block_allocator_t *allocator, gboolean last; g_assert(chunk->used); - g_assert_cmpuint(WMEM_CHUNK_DATA_LEN(chunk), >=, size); + g_assert(WMEM_CHUNK_DATA_LEN(chunk) >= size); aligned_size = WMEM_ALIGN_SIZE(size); @@ -657,7 +657,7 @@ wmem_block_alloc(void *private_data, const size_t size) /* We can't allocate more than will fit in a block (less our header), * which is an awful lot. */ - g_assert_cmpuint(size, <, WMEM_BLOCK_SIZE - sizeof(wmem_block_chunk_t)); + g_assert(size < WMEM_BLOCK_SIZE - sizeof(wmem_block_chunk_t)); if (allocator->free_list_head == NULL) { /* No free chunks at all, grab a new block */ @@ -681,13 +681,13 @@ wmem_block_alloc(void *private_data, const size_t size) chunk = allocator->free_list_head; /* if we still don't have the space at this point, something is wrong */ - g_assert_cmpuint(size, <=, WMEM_CHUNK_DATA_LEN(chunk)); + g_assert(size <= WMEM_CHUNK_DATA_LEN(chunk)); /* Split our chunk into two to preserve any trailing free space */ wmem_block_split_free_chunk(allocator, chunk, size); /* if our split reduced our size too much, something went wrong */ - g_assert_cmpuint(size, <=, WMEM_CHUNK_DATA_LEN(chunk)); + g_assert(size <= WMEM_CHUNK_DATA_LEN(chunk)); /* the resulting chunk should not be in the free list */ g_assert(chunk != allocator->free_list_head); |