mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
make it compile on case-sensitive file systems and fix warnings
This commit is contained in:
parent
5e01c34943
commit
1cf506071d
3 changed files with 5 additions and 5 deletions
|
@ -101,7 +101,7 @@ void CardinalityCounter::addElement(uint64_t hash)
|
||||||
double CardinalityCounter::size()
|
double CardinalityCounter::size()
|
||||||
{
|
{
|
||||||
double answer = 0;
|
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 += pow(2, -(int)buckets[i]);
|
||||||
|
|
||||||
answer = 1/answer;
|
answer = 1/answer;
|
||||||
|
@ -119,7 +119,7 @@ void CardinalityCounter::merge(CardinalityCounter* c)
|
||||||
{
|
{
|
||||||
uint8_t* temp = (*c).getBuckets();
|
uint8_t* temp = (*c).getBuckets();
|
||||||
V = 0;
|
V = 0;
|
||||||
for (int i = 0; i < m; i++)
|
for (unsigned int i = 0; i < m; i++)
|
||||||
{
|
{
|
||||||
if (temp[i] > buckets[i])
|
if (temp[i] > buckets[i])
|
||||||
buckets[i] = temp[i];
|
buckets[i] = temp[i];
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
#define hyperloglog_h
|
#define hyperloglog_h
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <opaqueval.h>
|
#include <OpaqueVal.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "conf" is how confident the estimate given by the counter is.
|
* "conf" is how confident the estimate given by the counter is.
|
||||||
|
|
|
@ -33,7 +33,7 @@ bool CardinalityVal::DoSerialize(SerialInfo* info) const
|
||||||
serialvalid &= SERIALIZE(c->m);
|
serialvalid &= SERIALIZE(c->m);
|
||||||
serialvalid &= SERIALIZE(c->V);
|
serialvalid &= SERIALIZE(c->V);
|
||||||
serialvalid &= SERIALIZE(c->alpha_m);
|
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] );
|
serialvalid &= SERIALIZE( c->buckets[i] );
|
||||||
|
|
||||||
return serialvalid;
|
return serialvalid;
|
||||||
|
@ -56,7 +56,7 @@ bool CardinalityVal::DoUnserialize(UnserialInfo* info)
|
||||||
serialvalid &= UNSERIALIZE(&c->alpha_m);
|
serialvalid &= UNSERIALIZE(&c->alpha_m);
|
||||||
|
|
||||||
uint8_t* buckets = c->buckets;
|
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;
|
uint8_t* currbucket = buckets + i;
|
||||||
serialvalid &= UNSERIALIZE( currbucket );
|
serialvalid &= UNSERIALIZE( currbucket );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue