summaryrefslogtreecommitdiffstats
path: root/src/peer.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-04-24 03:17:46 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-04-24 03:17:46 +0200
commit4872dd03e73aac434d735782417e40ca33336dac (patch)
tree8c8a20da4b077e60ed26aa393fd7c39c4e8dacde /src/peer.c
parentbaf9b2fd6096e5e8eee45b9f2feffa9adec6e927 (diff)
downloadfastd-4872dd03e73aac434d735782417e40ca33336dac.tar
fastd-4872dd03e73aac434d735782417e40ca33336dac.zip
Always use size_t for counters
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/peer.c b/src/peer.c
index 99fa9b3..80a91ab 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -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;
}