From 016fec735bba75539bd8a0a072de265129f9821c Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Sun, 29 Dec 2024 21:25:09 -0500 Subject: [PATCH] CarpetX: remove redundant const in cast --- CarpetX/src/io_openpmd.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/CarpetX/src/io_openpmd.cxx b/CarpetX/src/io_openpmd.cxx index 32d7c8d4d..dad8160c4 100644 --- a/CarpetX/src/io_openpmd.cxx +++ b/CarpetX/src/io_openpmd.cxx @@ -1237,7 +1237,7 @@ void carpetx_openpmd_t::InputOpenPMD(const cGH *const cctkGH, case CCTK_VARIABLE_REAL: record_components.at(vi).loadChunk( std::shared_ptr( - static_cast( + static_cast( cactus_ptr->data_at(contig_offset + cactus_np * vi)), [=](CCTK_REAL *const ptr) { expand_box(static_cast(ptr)); @@ -1250,7 +1250,7 @@ void carpetx_openpmd_t::InputOpenPMD(const cGH *const cctkGH, static_cast( cactus_ptr->data_at(contig_offset + cactus_np * vi)), [=](CCTK_INT *const ptr) { - expand_box(static_cast(ptr)); + expand_box(static_cast(ptr)); }), start, count); break; @@ -1260,7 +1260,7 @@ void carpetx_openpmd_t::InputOpenPMD(const cGH *const cctkGH, static_cast( cactus_ptr->data_at(contig_offset + cactus_np * vi)), [=](CCTK_COMPLEX *const ptr) { - expand_box(static_cast(ptr)); + expand_box(static_cast(ptr)); }), start, count); break; @@ -1843,16 +1843,15 @@ void carpetx_openpmd_t::OutputOpenPMD(const cGH *const cctkGH, switch (cgroup.vartype) { case CCTK_VARIABLE_REAL: record_components.at(vi).storeChunkRaw( - static_cast(var_ptr), start, count); + static_cast(var_ptr), start, count); break; case CCTK_VARIABLE_INT: record_components.at(vi).storeChunkRaw( - static_cast(var_ptr), start, count); + static_cast(var_ptr), start, count); break; case CCTK_VARIABLE_COMPLEX: record_components.at(vi).storeChunkRaw( - static_cast(var_ptr), start, - count); + static_cast(var_ptr), start, count); break; default: assert(0 && "Unexpected variable type"); @@ -1880,21 +1879,21 @@ void carpetx_openpmd_t::OutputOpenPMD(const cGH *const cctkGH, case CCTK_VARIABLE_REAL: record_components.at(vi).storeChunk( std::shared_ptr( - static_cast(contig_ptr->data_at(0)), - [=](CCTK_REAL *const) { delete contig_ptr; }), + static_cast(contig_ptr->data_at(0)), + [=](CCTK_REAL *) { delete contig_ptr; }), start, count); break; case CCTK_VARIABLE_INT: record_components.at(vi).storeChunk( std::shared_ptr( - static_cast(contig_ptr->data_at(0)), + static_cast(contig_ptr->data_at(0)), [=](CCTK_INT *const) { delete contig_ptr; }), start, count); break; case CCTK_VARIABLE_COMPLEX: record_components.at(vi).storeChunk( std::shared_ptr( - static_cast(contig_ptr->data_at(0)), + static_cast(contig_ptr->data_at(0)), [=](CCTK_COMPLEX *const) { delete contig_ptr; }), start, count); break;