From 1cf506071df6498a87b495472f5d9236f79e165e Mon Sep 17 00:00:00 2001 From: Bernhard Amann Date: Wed, 1 May 2013 18:12:20 -0700 Subject: [PATCH] make it compile on case-sensitive file systems and fix warnings --- src/HyperLogLog.cc | 4 ++-- src/HyperLogLog.h | 2 +- src/OpaqueVal.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/HyperLogLog.cc b/src/HyperLogLog.cc index a399f5a495..6dacab33a2 100644 --- a/src/HyperLogLog.cc +++ b/src/HyperLogLog.cc @@ -101,7 +101,7 @@ void CardinalityCounter::addElement(uint64_t hash) double CardinalityCounter::size() { double answer = 0; - for (int i = 0; i < m; i++) + for (unsigned int i = 0; i < m; i++) answer += pow(2, -(int)buckets[i]); answer = 1/answer; @@ -119,7 +119,7 @@ void CardinalityCounter::merge(CardinalityCounter* c) { uint8_t* temp = (*c).getBuckets(); V = 0; - for (int i = 0; i < m; i++) + for (unsigned int i = 0; i < m; i++) { if (temp[i] > buckets[i]) buckets[i] = temp[i]; diff --git a/src/HyperLogLog.h b/src/HyperLogLog.h index 68b7f0ecfc..f07167502a 100644 --- a/src/HyperLogLog.h +++ b/src/HyperLogLog.h @@ -4,7 +4,7 @@ #define hyperloglog_h #include -#include +#include /* * "conf" is how confident the estimate given by the counter is. diff --git a/src/OpaqueVal.cc b/src/OpaqueVal.cc index b712f728f7..54c771b366 100644 --- a/src/OpaqueVal.cc +++ b/src/OpaqueVal.cc @@ -33,7 +33,7 @@ bool CardinalityVal::DoSerialize(SerialInfo* info) const serialvalid &= SERIALIZE(c->m); serialvalid &= SERIALIZE(c->V); serialvalid &= SERIALIZE(c->alpha_m); - for ( int i = 0; i < c->m; i++ ) + for ( unsigned int i = 0; i < c->m; i++ ) serialvalid &= SERIALIZE( c->buckets[i] ); return serialvalid; @@ -56,7 +56,7 @@ bool CardinalityVal::DoUnserialize(UnserialInfo* info) serialvalid &= UNSERIALIZE(&c->alpha_m); uint8_t* buckets = c->buckets; - for ( int i = 0; i < m; i++ ) + for ( unsigned int i = 0; i < m; i++ ) { uint8_t* currbucket = buckets + i; serialvalid &= UNSERIALIZE( currbucket );