aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2024-08-01 17:06:49 -0700
committerAndrew Waterman <andrew@sifive.com>2024-08-01 17:07:49 -0700
commitb9ecc1d4e5b9cc4e4c3e6793516e1809aec76762 (patch)
tree285a22b2f02221ae9db1df5d79cc70db13b0deaf
parentd9f21fc2db310716df08c628c7e037d575836315 (diff)
downloadriscv-isa-sim-b9ecc1d4e5b9cc4e4c3e6793516e1809aec76762.zip
riscv-isa-sim-b9ecc1d4e5b9cc4e4c3e6793516e1809aec76762.tar.gz
riscv-isa-sim-b9ecc1d4e5b9cc4e4c3e6793516e1809aec76762.tar.bz2
In dtc_compile, use c string instead of stl string
-rw-r--r--riscv/dts.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/riscv/dts.cc b/riscv/dts.cc
index 48e5382..9751ffe 100644
--- a/riscv/dts.cc
+++ b/riscv/dts.cc
@@ -101,8 +101,8 @@ std::string make_dts(size_t insns_per_rtc_tick, size_t cpu_hz,
static std::string dtc_compile(const std::string& dtc_input, bool compile)
{
- const std::string input_type = compile ? "dts" : "dtb";
- const std::string output_type = compile ? "dtb" : "dts";
+ const char* input_type = compile ? "dts" : "dtb";
+ const char* output_type = compile ? "dtb" : "dts";
int dtc_input_pipe[2];
pid_t dtc_input_pid;
@@ -144,7 +144,7 @@ static std::string dtc_compile(const std::string& dtc_input, bool compile)
close(dtc_input_pipe[1]);
close(dtc_output_pipe[0]);
close(dtc_output_pipe[1]);
- execlp(DTC, DTC, "-O", output_type.c_str(), "-I", input_type.c_str(), (char *)0);
+ execlp(DTC, DTC, "-O", output_type, "-I", input_type, nullptr);
std::cerr << "Failed to run " DTC ": " << strerror(errno) << std::endl;
exit(1);
}