Skip to content

Commit

Permalink
cleanup: make it more clear that assert and uint32_t increment both o…
Browse files Browse the repository at this point in the history
…nly exist if NDEBUG is not defined
  • Loading branch information
zoff99 authored and iphydf committed Nov 12, 2023
1 parent 58fac53 commit d01c116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions toxcore/DHT.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,8 +533,8 @@ int pack_nodes(const Logger *logger, uint8_t *data, uint16_t length, const Node_

#ifndef NDEBUG
const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE;
#endif
assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6);
#endif
}

return packed_length;
Expand Down Expand Up @@ -565,8 +565,8 @@ int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed

#ifndef NDEBUG
const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE;
#endif
assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6);
#endif
}

if (processed_data_len != nullptr) {
Expand Down

0 comments on commit d01c116

Please sign in to comment.