From 8f1bbcf83e23286ebdfd17b83d886fc8f0a3eb2a Mon Sep 17 00:00:00 2001 From: iphydf Date: Mon, 22 Jan 2018 09:37:31 +0000 Subject: Use for alloca on FreeBSD. https://www.freebsd.org/cgi/man.cgi?alloca If stdlib.h does not define alloca, and we're using GCC (or Clang), we define the macro ourselves in terms of a GCC builtin. --- toxcore/DHT.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toxcore/DHT.c') diff --git a/toxcore/DHT.c b/toxcore/DHT.c index 33ebc690..747f7328 100644 --- a/toxcore/DHT.c +++ b/toxcore/DHT.c @@ -535,7 +535,7 @@ int pack_nodes(uint8_t *data, uint16_t length, const Node_format *nodes, uint16_ memcpy(data + packed_length, nodes[i].public_key, CRYPTO_PUBLIC_KEY_SIZE); packed_length += CRYPTO_PUBLIC_KEY_SIZE; - uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; + const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); } @@ -571,7 +571,7 @@ int unpack_nodes(Node_format *nodes, uint16_t max_num_nodes, uint16_t *processed len_processed += CRYPTO_PUBLIC_KEY_SIZE; ++num; - uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; + const uint32_t increment = ipp_size + CRYPTO_PUBLIC_KEY_SIZE; assert(increment == PACKED_NODE_SIZE_IP4 || increment == PACKED_NODE_SIZE_IP6); } -- cgit v1.2.3