Skip to content

Commit 97c548b

Browse files
committed
unrelated: got rid of some warnings
1 parent 3303b29 commit 97c548b

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

toxav/msi.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ typedef struct _MSIMessage {
116116
static struct _Callbacks {
117117
MSICallback function;
118118
void *data;
119-
} callbacks[11] = {0};
119+
} callbacks[11] = {{0}};
120120

121121
inline__ void invoke_callback(int32_t call_index, MSICallbackID id)
122122
{
@@ -736,13 +736,7 @@ int send_message ( MSISession *session, MSICall *call, MSIMessage *msg, uint32_t
736736
*/
737737
int call_id_bigger( const uint8_t *first, const uint8_t *second)
738738
{
739-
int i = 0;
740-
741-
for (; i < CALL_ID_LEN; i ++) {
742-
743-
if ( first[i] != second[i] )
744-
return first[i] > second [i] ? 0 : 1;
745-
}
739+
return (memcmp(first, second, CALL_ID_LEN) < 0);
746740
}
747741

748742

toxdns/toxdns.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#endif
2727

2828
#include "../toxcore/Messenger.h"
29+
#include "../toxcore/logger.h"
2930
#include "toxdns.h"
3031

3132
static const char base32[32] = {"abcdefghijklmnopqrstuvwxyz012345"};
@@ -43,7 +44,7 @@ uint8_t i = 0; \
4344
} \
4445
} \
4546
} \
46-
47+
4748
typedef struct {
4849
uint8_t temp_pk[crypto_box_PUBLICKEYBYTES];
4950
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
143144
}
144145

145146
if (end_len != string - old_str) {
146-
printf("tox_generate_dns3_string Fail, %u != %u\n", end_len, string - old_str);
147+
LOGGER_ERROR("tox_generate_dns3_string Fail, %u != %lu\n", end_len, string - old_str);
147148
return -1;
148149
}
149150

0 commit comments

Comments
 (0)