Skip to content

Commit

Permalink
Merge pull request #1531 from malaterre/nanovdb-32
Browse files Browse the repository at this point in the history
Use fixed-width integers to remove warnings (32bits)
  • Loading branch information
kmuseth committed Jun 6, 2023
2 parents e17efa5 + ec2a10f commit 9a57c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions nanovdb/nanovdb/unittest/TestNanoVDB.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ TEST_F(TestNanoVDB, InternalNodeValueMask)
EXPECT_EQ(end-start, 28);// padding is 28 bytes

// use padding for an offset and check that it doesn't interfere with other data
size_t &offset = *reinterpret_cast<size_t*>(&(data->mStdDevi)+1);
uint64_t &offset = *reinterpret_cast<uint64_t*>(&(data->mStdDevi)+1);
data->mStdDevi = true;
data->mTable[0].child = 123434214;
offset = 45634923663;
Expand Down Expand Up @@ -1751,7 +1751,7 @@ TEST_F(TestNanoVDB, InternalNodeValueMask)
EXPECT_EQ(end-start, 28);// padding is 28 bytes

// use padding for an offset and check that it doesn't interfere with other data
size_t &offset = *reinterpret_cast<size_t*>(&(data->mStdDevi)+1);
uint64_t &offset = *reinterpret_cast<uint64_t*>(&(data->mStdDevi)+1);
data->mStdDevi = true;
data->mTable[0].child = 123434214;
offset = 45634923663;
Expand Down Expand Up @@ -2283,7 +2283,7 @@ TEST_F(TestNanoVDB, BasicGrid)
EXPECT_EQ(sizeof(TreeT), nanovdb::AlignUp<NANOVDB_DATA_ALIGNMENT>(4*8 + 3*4 + 3*4 + 8));
EXPECT_EQ(sizeof(TreeT), size_t(4*8 + 3*4 + 3*4 + 8));// should already be 32 byte aligned

size_t bytes[6] = {GridT::memUsage(), TreeT::memUsage(), RootT::memUsage(1), NodeT2::memUsage(), NodeT1::memUsage(), LeafT::DataType::memUsage()};
uint64_t bytes[6] = {GridT::memUsage(), TreeT::memUsage(), RootT::memUsage(1), NodeT2::memUsage(), NodeT1::memUsage(), LeafT::DataType::memUsage()};
for (int i = 1; i < 6; ++i)
bytes[i] += bytes[i - 1]; // Byte offsets to: tree, root, internal nodes, leafs, total
std::unique_ptr<uint8_t[]> pool(new uint8_t[bytes[5] + NANOVDB_DATA_ALIGNMENT]);
Expand Down

0 comments on commit 9a57c7e

Please sign in to comment.