]> granicus.if.org Git - transmission/commitdiff
Don't use ssize_t in bitfield.c (cleaner w/o it anyway)
authorMike Gelfand <mikedld@mikedld.com>
Sun, 4 Jan 2015 15:31:47 +0000 (15:31 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Sun, 4 Jan 2015 15:31:47 +0000 (15:31 +0000)
libtransmission/bitfield.c

index bed09aec528ac98ae8cfa1377393a6cc26a8f70b..5e96d4a385f1fa447c421f278866aa718ffcfa53 100644 (file)
@@ -45,10 +45,10 @@ static size_t
 countArray (const tr_bitfield * b)
 {
   size_t ret = 0;
-  ssize_t i = b->alloc_count;
+  size_t i = b->alloc_count;
 
-  while (--i >= 0)
-    ret += trueBitCount[b->bits[i]];
+  while (i > 0)
+    ret += trueBitCount[b->bits[--i]];
 
   return ret;
 }