Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
WeiqunZhang committed Sep 27, 2024
1 parent b8f2379 commit 57a9864
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Src/Base/AMReX_NonLocalBC.H
Original file line number Diff line number Diff line change
Expand Up @@ -882,9 +882,16 @@ ParallelCopy (FabArray<FAB>& dest, const FabArray<FAB>& src, const FabArrayBase:
components.dest_component = destcomp.i;
components.src_component = srccomp.i;
components.n_components = numcomp.n;
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
ApplyDtosAndProjectionOnReciever<DTOS, Proj> packing{components, dtos, proj};
CommHandler handler = ParallelCopy_nowait(dest, src, cmd, packing);
ParallelCopy_finish(dest, std::move(handler), cmd, packing); // NOLINT
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
}

//! \brief Call ParallelCopy_nowait followed by ParallelCopy_finish.
Expand Down
6 changes: 4 additions & 2 deletions Src/Particle/AMReX_WriteBinaryParticleData.H
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,8 @@ void WriteBinaryParticleDataAsync (PC const& pc,
{
const auto& soa = pbox.GetStructOfArrays();

const auto& p = make_particle<typename PC::ConstParticleType>{}(ptd, pindex);
make_particle<typename PC::ConstParticleType> mp{};
const auto& p = mp(ptd, pindex);
if (p.id() <= 0) { continue; }

// note: for pure SoA particle layouts, we do write the id, cpu and positions as a struct
Expand Down Expand Up @@ -1101,7 +1102,8 @@ void WriteBinaryParticleDataAsync (PC const& pc,
pindex < pbox.numParticles(); ++pindex)
{
const auto& soa = pbox.GetStructOfArrays();
const auto& p = make_particle<typename PC::ConstParticleType>{}(ptd, pindex);
make_particle<typename PC::ConstParticleType> mp{};
const auto& p = mp(ptd, pindex);

if (p.id() <= 0) { continue; }

Expand Down

0 comments on commit 57a9864

Please sign in to comment.