From a14174b6cdbb156daea37d7ff0791e144204ec69 Mon Sep 17 00:00:00 2001 From: Max Katz Date: Mon, 9 Oct 2023 20:26:58 -0400 Subject: [PATCH] Silence a std::string warning in radiation (#2627) --- Source/driver/Castro_setup.cpp | 4 ++-- Source/radiation/energy_diagnostics.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/driver/Castro_setup.cpp b/Source/driver/Castro_setup.cpp index 8e72d715cb..ef74b4ab07 100644 --- a/Source/driver/Castro_setup.cpp +++ b/Source/driver/Castro_setup.cpp @@ -685,7 +685,7 @@ Castro::variableSetUp () std::cout << "Radiation::nGroups = " << Radiation::nGroups << std::endl; } - char rad_name[10]; + std::string rad_name; if (!Radiation::do_multigroup) { desc_lst .setComponent(Rad_Type, Rad, "rad", bc, @@ -693,7 +693,7 @@ Castro::variableSetUp () } else { for (int i = 0; i < Radiation::nGroups; i++) { - sprintf(rad_name, "rad%d", i); + rad_name = "rad" + std::to_string(i); desc_lst .setComponent(Rad_Type, i, rad_name, bc, genericBndryFunc); diff --git a/Source/radiation/energy_diagnostics.cpp b/Source/radiation/energy_diagnostics.cpp index cf47a27127..c38a96f5aa 100644 --- a/Source/radiation/energy_diagnostics.cpp +++ b/Source/radiation/energy_diagnostics.cpp @@ -32,9 +32,9 @@ Castro::do_energy_diagnostics() r += getLevel(lev).volWgtSum("rad", prev_time + dt); } else { - char rad_name[10]; + std::string rad_name; for (int igroup = 0; igroup < Radiation::nGroups; igroup++) { - sprintf(rad_name, "rad%d", igroup); + rad_name = "rad" + std::to_string(igroup); r += getLevel(lev).volWgtSum(rad_name, prev_time + dt); } }