diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-24 03:17:46 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-04-24 03:17:46 +0200 |
commit | 4872dd03e73aac434d735782417e40ca33336dac (patch) | |
tree | 8c8a20da4b077e60ed26aa393fd7c39c4e8dacde /src/peer.c | |
parent | baf9b2fd6096e5e8eee45b9f2feffa9adec6e927 (diff) | |
download | fastd-4872dd03e73aac434d735782417e40ca33336dac.tar fastd-4872dd03e73aac434d735782417e40ca33336dac.zip |
Always use size_t for counters
Diffstat (limited to 'src/peer.c')
-rw-r--r-- | src/peer.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -515,9 +515,8 @@ void fastd_peer_delete(fastd_peer_t *peer) { delete_peer(peer); } -static inline unsigned count_established_group_peers(fastd_peer_group_t *group) { - unsigned ret = 0; - size_t i; +static inline size_t count_established_group_peers(fastd_peer_group_t *group) { + size_t i, ret = 0; for (i = 0; i < VECTOR_LEN(ctx.peers); i++) { fastd_peer_t *peer = VECTOR_INDEX(ctx.peers, i); @@ -538,7 +537,7 @@ bool fastd_peer_may_connect(fastd_peer_t *peer) { if (group->conf->max_connections < 0) continue; - if (count_established_group_peers(group) >= (unsigned)group->conf->max_connections) + if (count_established_group_peers(group) >= (size_t)group->conf->max_connections) return false; } |