mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Fix compiler warnings
This commit is contained in:
parent
bcf79fe11a
commit
1d33883dfc
3 changed files with 7 additions and 3 deletions
|
@ -306,7 +306,7 @@ bool SQLite::DoUpdate()
|
||||||
ofields[j] = EntryToVal(st, fields[j], mapping[j], submapping[j]);
|
ofields[j] = EntryToVal(st, fields[j], mapping[j], submapping[j]);
|
||||||
if ( ofields[j] == 0 )
|
if ( ofields[j] == 0 )
|
||||||
{
|
{
|
||||||
for ( int k = 0; k < j; ++k )
|
for ( unsigned int k = 0; k < j; ++k )
|
||||||
delete ofields[k];
|
delete ofields[k];
|
||||||
|
|
||||||
delete [] ofields;
|
delete [] ofields;
|
||||||
|
|
|
@ -495,6 +495,7 @@ BitVector::size_type BitVector::FindNext(size_type i) const
|
||||||
uint64 BitVector::Hash() const
|
uint64 BitVector::Hash() const
|
||||||
{
|
{
|
||||||
u_char buf[SHA256_DIGEST_LENGTH];
|
u_char buf[SHA256_DIGEST_LENGTH];
|
||||||
|
uint64 digest;
|
||||||
SHA256_CTX ctx;
|
SHA256_CTX ctx;
|
||||||
sha256_init(&ctx);
|
sha256_init(&ctx);
|
||||||
|
|
||||||
|
@ -502,7 +503,8 @@ uint64 BitVector::Hash() const
|
||||||
sha256_update(&ctx, &bits[i], sizeof(bits[i]));
|
sha256_update(&ctx, &bits[i], sizeof(bits[i]));
|
||||||
|
|
||||||
sha256_final(&ctx, buf);
|
sha256_final(&ctx, buf);
|
||||||
return *reinterpret_cast<uint64*>(buf); // Use the first bytes as digest.
|
memcpy(&digest, buf, sizeof(digest)); // Use the first bytes as digest
|
||||||
|
return digest;
|
||||||
}
|
}
|
||||||
|
|
||||||
BitVector::size_type BitVector::lowest_bit(block_type block)
|
BitVector::size_type BitVector::lowest_bit(block_type block)
|
||||||
|
|
|
@ -13,6 +13,7 @@ using namespace probabilistic;
|
||||||
uint64 Hasher::MakeSeed(const void* data, size_t size)
|
uint64 Hasher::MakeSeed(const void* data, size_t size)
|
||||||
{
|
{
|
||||||
u_char buf[SHA256_DIGEST_LENGTH];
|
u_char buf[SHA256_DIGEST_LENGTH];
|
||||||
|
uint64 tmpseed;
|
||||||
SHA256_CTX ctx;
|
SHA256_CTX ctx;
|
||||||
sha256_init(&ctx);
|
sha256_init(&ctx);
|
||||||
|
|
||||||
|
@ -29,7 +30,8 @@ uint64 Hasher::MakeSeed(const void* data, size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
sha256_final(&ctx, buf);
|
sha256_final(&ctx, buf);
|
||||||
return *reinterpret_cast<uint64*>(buf); // Use the first bytes as seed.
|
memcpy(&tmpseed, buf, sizeof(tmpseed)); // Use the first bytes as seed.
|
||||||
|
return tmpseed;
|
||||||
}
|
}
|
||||||
|
|
||||||
Hasher::digest_vector Hasher::Hash(const HashKey* key) const
|
Hasher::digest_vector Hasher::Hash(const HashKey* key) const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue