From 97c548bc8063bcca9f06680d371d3b944c907801 Mon Sep 17 00:00:00 2001 From: notsecure Date: Mon, 23 Jun 2014 15:17:28 -0400 Subject: [PATCH] unrelated: got rid of some warnings --- toxav/msi.c | 10 ++-------- toxdns/toxdns.c | 5 +++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/toxav/msi.c b/toxav/msi.c index 79058c76..6c4f2637 100644 --- a/toxav/msi.c +++ b/toxav/msi.c @@ -116,7 +116,7 @@ typedef struct _MSIMessage { static struct _Callbacks { MSICallback function; void *data; -} callbacks[11] = {0}; +} callbacks[11] = {{0}}; inline__ void invoke_callback(int32_t call_index, MSICallbackID id) { @@ -736,13 +736,7 @@ int send_message ( MSISession *session, MSICall *call, MSIMessage *msg, uint32_t */ int call_id_bigger( const uint8_t *first, const uint8_t *second) { - int i = 0; - - for (; i < CALL_ID_LEN; i ++) { - - if ( first[i] != second[i] ) - return first[i] > second [i] ? 0 : 1; - } + return (memcmp(first, second, CALL_ID_LEN) < 0); } diff --git a/toxdns/toxdns.c b/toxdns/toxdns.c index 3eafc3de..e6892871 100644 --- a/toxdns/toxdns.c +++ b/toxdns/toxdns.c @@ -26,6 +26,7 @@ #endif #include "../toxcore/Messenger.h" +#include "../toxcore/logger.h" #include "toxdns.h" static const char base32[32] = {"abcdefghijklmnopqrstuvwxyz012345"}; @@ -43,7 +44,7 @@ uint8_t i = 0; \ } \ } \ } \ - + typedef struct { uint8_t temp_pk[crypto_box_PUBLICKEYBYTES]; uint8_t temp_sk[crypto_box_SECRETKEYBYTES]; @@ -143,7 +144,7 @@ int tox_generate_dns3_string(void *dns3_object, uint8_t *string, uint16_t string } if (end_len != string - old_str) { - printf("tox_generate_dns3_string Fail, %u != %u\n", end_len, string - old_str); + LOGGER_ERROR("tox_generate_dns3_string Fail, %u != %lu\n", end_len, string - old_str); return -1; }