Skip to content

Commit

Permalink
Fix Win32 Narrowing Error
Browse files Browse the repository at this point in the history
Fix
```
2025-01-16T05:51:21.6362891Z D:\a\openPMD-api\openPMD-api\src\dep-adios2\ADIOS2-2.10.2\source\adios2\toolkit\format\bp5\BP5Serializer.cpp(1603,68): error C2397: conversion from 'uint64_t' to 'size_t' requires a narrowing conversion [D:\a\openPMD-api\openPMD-api\src\build-adios2\source\adios2\adios2_core.vcxproj]
2025-01-16T05:51:21.6371102Z D:\a\openPMD-api\openPMD-api\src\dep-adios2\ADIOS2-2.10.2\source\adios2\toolkit\format\bp5\BP5Serializer.cpp(1611,69): error C2397: conversion from 'uint64_t' to 'size_t' requires a narrowing conversion [D:\a\openPMD-api\openPMD-api\src\build-adios2\source\adios2\adios2_core.vcxproj]
```
with MSVC on Win32 ILP32.

`core::iovec` is a `void*` and `size_t`, so this part needs to be `size_t` as well.
  • Loading branch information
ax3l committed Jan 16, 2025
1 parent b574cc9 commit 3cfaf17
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/adios2/toolkit/format/bp5/BP5Serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1615,17 +1615,17 @@ std::vector<core::iovec> BP5Serializer::BreakoutContiguousMetadata(
}
}
helper::CopyFromBuffer(Aggregate.data(), Position, &MBCount);
for (uint64_t i = 0; i < MBCount; ++i)
for (size_t i = 0; i < MBCount; ++i)
{
uint64_t MEBSize;
size_t MEBSize;
helper::CopyFromBuffer(Aggregate.data(), Position, &MEBSize);
MetadataBlocks.push_back({Aggregate.data() + Position, MEBSize});
Position += MEBSize;
}
helper::CopyFromBuffer(Aggregate.data(), Position, &ABCount);
for (uint64_t i = 0; i < ABCount; ++i)
for (size_t i = 0; i < ABCount; ++i)
{
uint64_t AEBSize;
size_t AEBSize;
helper::CopyFromBuffer(Aggregate.data(), Position, &AEBSize);
AttributeBlocks.push_back({Aggregate.data() + Position, AEBSize});
Position += AEBSize;
Expand Down

0 comments on commit 3cfaf17

Please sign in to comment.