Browse Source

silence warnings when compiling with -DNDEBUG

Change-Id: I46d16f6c083d281622ce71644bcf8d224e0b36b7
pull/734/head
Richard Fuchs 7 years ago
parent
commit
d279789e23
5 changed files with 6 additions and 0 deletions
  1. +2
    -0
      daemon/bencode.c
  2. +1
    -0
      daemon/control_ng.c
  3. +1
    -0
      include/dtls.h
  4. +1
    -0
      lib/auxlib.h
  5. +1
    -0
      lib/bitstr.h

+ 2
- 0
daemon/bencode.c View File

@ -327,6 +327,7 @@ static int __bencode_iovec_dump(struct iovec *out, bencode_item_t *item) {
out += __bencode_iovec_cpy(out, &item->iov[1], 1); out += __bencode_iovec_cpy(out, &item->iov[1], 1);
assert((out - orig) == item->iov_cnt); assert((out - orig) == item->iov_cnt);
(void) orig;
return item->iov_cnt; return item->iov_cnt;
} }
@ -349,6 +350,7 @@ static int __bencode_str_dump(char *out, bencode_item_t *item) {
out += __bencode_str_cpy(out, &item->iov[1], 1); out += __bencode_str_cpy(out, &item->iov[1], 1);
assert((out - orig) == item->str_len); assert((out - orig) == item->str_len);
(void) orig;
*out = '\0'; *out = '\0';
return item->str_len; return item->str_len;
} }


+ 1
- 0
daemon/control_ng.c View File

@ -135,6 +135,7 @@ static void control_ng_incoming(struct obj *obj, str *buf, const endpoint_t *sin
int ret = bencode_buffer_init(&bencbuf); int ret = bencode_buffer_init(&bencbuf);
assert(ret == 0); assert(ret == 0);
(void) ret;
resp = bencode_dictionary(&bencbuf); resp = bencode_dictionary(&bencbuf);
assert(resp != NULL); assert(resp != NULL);


+ 1
- 0
include/dtls.h View File

@ -83,6 +83,7 @@ INLINE void __dtls_hash(const struct dtls_hash_func *hash_func, X509 *cert, unsi
assert(bufsize >= hash_func->num_bytes); assert(bufsize >= hash_func->num_bytes);
n = hash_func->__func(out, cert); n = hash_func->__func(out, cert);
assert(n == hash_func->num_bytes); assert(n == hash_func->num_bytes);
(void) n;
} }
#define dtls_hash(hash_func, cert, outbuf) __dtls_hash(hash_func, cert, outbuf, sizeof(outbuf)) #define dtls_hash(hash_func, cert, outbuf) __dtls_hash(hash_func, cert, outbuf, sizeof(outbuf))


+ 1
- 0
lib/auxlib.h View File

@ -68,6 +68,7 @@ int uint32_eq(const void *a, const void *b);
INLINE void random_string(unsigned char *buf, int len) { INLINE void random_string(unsigned char *buf, int len) {
int ret = RAND_bytes(buf, len); int ret = RAND_bytes(buf, len);
assert(ret == 1); assert(ret == 1);
(void) ret;
} }


+ 1
- 0
lib/bitstr.h View File

@ -66,6 +66,7 @@ INLINE int bitstr_shift_ret(bitstr *b, unsigned int bits, str *ret) {
unsigned int int_bytes = b->bit_offset / 8; unsigned int int_bytes = b->bit_offset / 8;
int shift_ret = str_shift(&b->s, int_bytes); int shift_ret = str_shift(&b->s, int_bytes);
assert(shift_ret == 0); assert(shift_ret == 0);
(void) shift_ret;
b->bit_offset -= int_bytes * 8; b->bit_offset -= int_bytes * 8;
return 0; return 0;


Loading…
Cancel
Save