diff options
author | irungentoo <irungentoo@gmail.com> | 2015-12-08 19:09:38 -0500 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-12-08 19:09:38 -0500 |
commit | 30acc33ef673b357768acd3f438fe675cd60b5f6 (patch) | |
tree | 8596469550953b2f8ea17d9693540234d1e224c2 /toxcore | |
parent | feda36e7cfd72db28e9b1a0c1d2412f4d47ff2d0 (diff) |
uint32_t -> unsigned int.
Diffstat (limited to 'toxcore')
-rw-r--r-- | toxcore/ping.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/toxcore/ping.c b/toxcore/ping.c index 5c377d77..17fb3e9e 100644 --- a/toxcore/ping.c +++ b/toxcore/ping.c | |||
@@ -227,7 +227,7 @@ static int handle_ping_response(void *_dht, IP_Port source, const uint8_t *packe | |||
227 | */ | 227 | */ |
228 | static int in_list(const Client_data *list, uint16_t length, const uint8_t *public_key, IP_Port ip_port) | 228 | static int in_list(const Client_data *list, uint16_t length, const uint8_t *public_key, IP_Port ip_port) |
229 | { | 229 | { |
230 | uint32_t i; | 230 | unsigned int i; |
231 | 231 | ||
232 | for (i = 0; i < length; ++i) { | 232 | for (i = 0; i < length; ++i) { |
233 | if (id_equal(list[i].public_key, public_key)) { | 233 | if (id_equal(list[i].public_key, public_key)) { |
@@ -265,7 +265,6 @@ int add_to_ping(PING *ping, const uint8_t *public_key, IP_Port ip_port) | |||
265 | if (in_list(ping->dht->close_clientlist, LCLIENT_LIST, public_key, ip_port)) | 265 | if (in_list(ping->dht->close_clientlist, LCLIENT_LIST, public_key, ip_port)) |
266 | return -1; | 266 | return -1; |
267 | 267 | ||
268 | uint32_t i; | ||
269 | 268 | ||
270 | IP_Port temp; | 269 | IP_Port temp; |
271 | 270 | ||
@@ -274,6 +273,8 @@ int add_to_ping(PING *ping, const uint8_t *public_key, IP_Port ip_port) | |||
274 | return -1; | 273 | return -1; |
275 | } | 274 | } |
276 | 275 | ||
276 | unsigned int i; | ||
277 | |||
277 | for (i = 0; i < MAX_TO_PING; ++i) { | 278 | for (i = 0; i < MAX_TO_PING; ++i) { |
278 | if (!ip_isset(&ping->to_ping[i].ip_port.ip)) { | 279 | if (!ip_isset(&ping->to_ping[i].ip_port.ip)) { |
279 | memcpy(ping->to_ping[i].public_key, public_key, crypto_box_PUBLICKEYBYTES); | 280 | memcpy(ping->to_ping[i].public_key, public_key, crypto_box_PUBLICKEYBYTES); |
@@ -286,7 +287,7 @@ int add_to_ping(PING *ping, const uint8_t *public_key, IP_Port ip_port) | |||
286 | } | 287 | } |
287 | } | 288 | } |
288 | 289 | ||
289 | uint32_t r = rand(); | 290 | unsigned int r = rand(); |
290 | 291 | ||
291 | for (i = 0; i < MAX_TO_PING; ++i) { | 292 | for (i = 0; i < MAX_TO_PING; ++i) { |
292 | if (id_closest(ping->dht->self_public_key, ping->to_ping[(i + r) % MAX_TO_PING].public_key, public_key) == 2) { | 293 | if (id_closest(ping->dht->self_public_key, ping->to_ping[(i + r) % MAX_TO_PING].public_key, public_key) == 2) { |
@@ -311,7 +312,7 @@ void do_to_ping(PING *ping) | |||
311 | if (!ip_isset(&ping->to_ping[0].ip_port.ip)) | 312 | if (!ip_isset(&ping->to_ping[0].ip_port.ip)) |
312 | return; | 313 | return; |
313 | 314 | ||
314 | uint32_t i; | 315 | unsigned int i; |
315 | 316 | ||
316 | for (i = 0; i < MAX_TO_PING; ++i) { | 317 | for (i = 0; i < MAX_TO_PING; ++i) { |
317 | if (!ip_isset(&ping->to_ping[i].ip_port.ip)) | 318 | if (!ip_isset(&ping->to_ping[i].ip_port.ip)) |