Skip to content

Commit

Permalink
CarpetX: add const in cast for output
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaas80 committed Dec 30, 2024
1 parent 016fec7 commit 4704af8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CarpetX/src/io_tsv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ void WriteTSVScalars(const cGH *restrict cctkGH, const std::string &filename,
for (int vi = 0; vi < arraygroupdata.numvars; ++vi)
switch (cgroup.vartype) {
case CCTK_VARIABLE_REAL:
file << sep << *(CCTK_REAL *)arraygroupdata.data.at(tl).data_at(vi);
file << sep << *(const CCTK_REAL *)arraygroupdata.data.at(tl).data_at(vi);
break;
case CCTK_VARIABLE_INT:
file << sep << *(CCTK_INT *)arraygroupdata.data.at(tl).data_at(vi);
file << sep << *(const CCTK_INT *)arraygroupdata.data.at(tl).data_at(vi);
break;
case CCTK_VARIABLE_COMPLEX: {
CCTK_COMPLEX value =
*(CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(vi);
*(const CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(vi);
file << sep << value.real() << sep << value.imag();
} break;
default:
Expand Down Expand Up @@ -247,17 +247,17 @@ void WriteTSVArrays(const cGH *restrict cctkGH, const std::string &filename,
switch (cgroup.vartype) {
case CCTK_VARIABLE_REAL:
file << sep
<< *(CCTK_REAL *)arraygroupdata.data.at(tl).data_at(
<< *(const CCTK_REAL *)arraygroupdata.data.at(tl).data_at(
np * vi + DI[out_dir] * i);
break;
case CCTK_VARIABLE_INT:
file << sep
<< *(CCTK_INT *)arraygroupdata.data.at(tl).data_at(
<< *(const CCTK_INT *)arraygroupdata.data.at(tl).data_at(
np * vi + DI[out_dir] * i);
break;
case CCTK_VARIABLE_COMPLEX: {
CCTK_COMPLEX value =
*(CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(
*(const CCTK_COMPLEX *)arraygroupdata.data.at(tl).data_at(
np * vi + DI[out_dir] * i);
file << sep << value.real() << sep << value.imag();
} break;
Expand Down

0 comments on commit 4704af8

Please sign in to comment.