diff options
author | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2012-09-01 23:23:02 +0400 |
---|---|---|
committer | ambrop7 <ambrop7@1a93d707-3861-5ebc-ad3b-9740d49b5140> | 2012-09-01 23:23:02 +0400 |
commit | 93bc612a21aa2fa8bdfc3e10b1b1cca423ef873b (patch) | |
tree | 806d85671a3bdb627f42f63d69a5d2e83f43785f /structure | |
parent | e0876b0af6e09f1293a109336c45149d0cdf2fc3 (diff) |
get rid of some warnings
Diffstat (limited to 'structure')
-rw-r--r-- | structure/ChunkBuffer2.h | 6 | ||||
-rw-r--r-- | structure/IndexedList.h | 2 | ||||
-rw-r--r-- | structure/LinkedList3.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/structure/ChunkBuffer2.h b/structure/ChunkBuffer2.h index 68e7266..98073ad 100644 --- a/structure/ChunkBuffer2.h +++ b/structure/ChunkBuffer2.h @@ -87,6 +87,8 @@ static int _ChunkBuffer2_end (ChunkBuffer2 *buf) } } +#ifndef NDEBUG + static void _ChunkBuffer2_assert_buffer (ChunkBuffer2 *buf) { ASSERT(buf->size > 0) @@ -147,6 +149,8 @@ static void _ChunkBuffer2_assert_io (ChunkBuffer2 *buf) } } +#endif + static void _ChunkBuffer2_update_input (ChunkBuffer2 *buf) { int end = _ChunkBuffer2_end(buf); @@ -183,9 +187,11 @@ static void _ChunkBuffer2_update_output (ChunkBuffer2 *buf) if (buf->used > 0) { int datalen = buf->buffer[buf->start].len; ASSERT(datalen >= 0) +#ifndef NDEBUG int blocklen = bdivide_up(datalen, sizeof(struct ChunkBuffer2_block)); ASSERT(blocklen <= buf->used - 1) ASSERT(blocklen <= buf->wrap - buf->start - 1) +#endif buf->output_dest = (uint8_t *)&buf->buffer[buf->start + 1]; buf->output_avail = datalen; } else { diff --git a/structure/IndexedList.h b/structure/IndexedList.h index f5cdc71..ca611e9 100644 --- a/structure/IndexedList.h +++ b/structure/IndexedList.h @@ -38,6 +38,7 @@ #include <stdint.h> #include <misc/offset.h> +#include <misc/debug.h> #include <structure/CAvl.h> typedef struct IndexedList_s IndexedList; @@ -164,6 +165,7 @@ static void IndexedList_InsertAt (IndexedList *o, IndexedListNode *node, uint64_ ASSERT(IndexedList__Tree_Count(&o->tree, 0) < UINT64_MAX - 1) uint64_t orig_count = IndexedList__Tree_Count(&o->tree, 0); + B_USE(orig_count) IndexedList__Tree_InsertAt(&o->tree, 0, IndexedList__TreeDeref(0, node), index); diff --git a/structure/LinkedList3.h b/structure/LinkedList3.h index b12baf0..8f54cdb 100644 --- a/structure/LinkedList3.h +++ b/structure/LinkedList3.h @@ -338,7 +338,7 @@ LinkedList3Node * LinkedList3Iterator_Next (LinkedList3Iterator *it) // jump to next entry if (it->e) { // get next entry - LinkedList3Node *next; + LinkedList3Node *next = NULL; // to remove warning switch (it->dir) { case 1: next = it->e->n; |