From 411457dc8fed37cee29dad80f2cbf3816b14f11a Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 28 Aug 2014 20:54:05 -0400 Subject: [PATCH] Fixed gcc warnings. --- toxcore/TCP_client.c | 2 +- toxcore/TCP_server.c | 2 +- toxcore/onion_announce.c | 4 ++-- toxcore/onion_client.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/toxcore/TCP_client.c b/toxcore/TCP_client.c index f7b208e0..23ab28c0 100644 --- a/toxcore/TCP_client.c +++ b/toxcore/TCP_client.c @@ -322,7 +322,7 @@ static int write_packet_TCP_secure_connection(TCP_Client_Connection *con, const increment_nonce(con->sent_nonce); - if (len == sizeof(packet)) { + if ((unsigned int)len == sizeof(packet)) { return 1; } diff --git a/toxcore/TCP_server.c b/toxcore/TCP_server.c index b1f7e04b..5dae1262 100644 --- a/toxcore/TCP_server.c +++ b/toxcore/TCP_server.c @@ -415,7 +415,7 @@ static int write_packet_TCP_secure_connection(TCP_Secure_Connection *con, const increment_nonce(con->sent_nonce); - if (len == sizeof(packet)) { + if ((unsigned int)len == sizeof(packet)) { return 1; } diff --git a/toxcore/onion_announce.c b/toxcore/onion_announce.c index f5c38eea..baccc95b 100644 --- a/toxcore/onion_announce.c +++ b/toxcore/onion_announce.c @@ -108,8 +108,8 @@ int create_data_request(uint8_t *packet, uint16_t max_packet_length, const uint8 int len = encrypt_data(encrypt_public_key, random_secret_key, packet + 1 + crypto_box_PUBLICKEYBYTES, data, length, packet + 1 + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES); - if (1 + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES + - (uint32_t)len != DATA_REQUEST_MIN_SIZE + length) + if (1 + crypto_box_PUBLICKEYBYTES + crypto_box_NONCEBYTES + crypto_box_PUBLICKEYBYTES + len != DATA_REQUEST_MIN_SIZE + + length) return -1; return DATA_REQUEST_MIN_SIZE + length; diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index fb725ef6..167a26f9 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -231,7 +231,7 @@ static int send_onion_packet_tcp_udp(const Onion_Client *onion_c, const Onion_Pa if (len == -1) return -1; - if ((uint32_t)sendpacket(onion_c->net, path->ip_port1, packet, len) != len) + if (sendpacket(onion_c->net, path->ip_port1, packet, len) != len) return -1; return 0;