Use Bro-style platform-independent integer types.

This commit is contained in:
Matthias Vallentin 2013-08-16 13:29:52 -07:00
parent f5655bd2fe
commit 516e044e34
6 changed files with 9 additions and 9 deletions

View file

@ -492,7 +492,7 @@ BitVector::size_type BitVector::FindNext(size_type i) const
return block ? bi * bits_per_block + lowest_bit(block) : find_from(bi + 1);
}
uint64_t BitVector::Hash() const
uint64 BitVector::Hash() const
{
u_char buf[SHA256_DIGEST_LENGTH];
SHA256_CTX ctx;
@ -502,7 +502,7 @@ uint64_t BitVector::Hash() const
sha256_update(&ctx, &bits[i], sizeof(bits[i]));
sha256_final(&ctx, buf);
return *reinterpret_cast<uint64_t*>(buf); // Use the first bytes as seed.
return *reinterpret_cast<uint64*>(buf); // Use the first bytes as digest.
}
BitVector::size_type BitVector::lowest_bit(block_type block)

View file

@ -15,7 +15,7 @@ namespace probabilistic {
*/
class BitVector : public SerialObj {
public:
typedef uint64_t block_type;
typedef uint64 block_type;
typedef size_t size_type;
typedef bool const_reference;
@ -281,7 +281,7 @@ public:
*
* @return The hash.
*/
uint64_t Hash() const;
uint64 Hash() const;
/**
* Serializes the bit vector.

View file

@ -153,7 +153,7 @@ CounterVector operator|(const CounterVector& x, const CounterVector& y)
}
uint64_t CounterVector::Hash() const
uint64 CounterVector::Hash() const
{
return bits->Hash();
}

View file

@ -131,7 +131,7 @@ public:
*
* @return The hash.
*/
uint64_t Hash() const;
uint64 Hash() const;
/**
* Serializes the bit vector.

View file

@ -10,7 +10,7 @@
using namespace probabilistic;
uint64_t Hasher::MakeSeed(const void* data, size_t size)
uint64 Hasher::MakeSeed(const void* data, size_t size)
{
u_char buf[SHA256_DIGEST_LENGTH];
SHA256_CTX ctx;
@ -29,7 +29,7 @@ uint64_t Hasher::MakeSeed(const void* data, size_t size)
}
sha256_final(&ctx, buf);
return *reinterpret_cast<uint64_t*>(buf); // Use the first bytes as seed.
return *reinterpret_cast<uint64*>(buf); // Use the first bytes as seed.
}
Hasher::digest_vector Hasher::Hash(const HashKey* key) const

View file

@ -30,7 +30,7 @@ public:
*
* @return A seed suitable for hashers.
*/
static uint64_t MakeSeed(const void* data, size_t size);
static uint64 MakeSeed(const void* data, size_t size);
/**
* Destructor.