diff options
author | Andrew Waterman <andrew@sifive.com> | 2023-02-06 13:26:48 -0800 |
---|---|---|
committer | Andrew Waterman <andrew@sifive.com> | 2023-02-27 14:54:16 -0800 |
commit | b8e562a58cc5e51a358167cfda3754f1998f8577 (patch) | |
tree | e9a3eb92fe21c2261bbbf4ad7a03cd78b9cbbeea /spike_main | |
parent | b4895800ba91afe9d4add7ad6b60a12446e77e8b (diff) | |
download | riscv-isa-sim-b8e562a58cc5e51a358167cfda3754f1998f8577.zip riscv-isa-sim-b8e562a58cc5e51a358167cfda3754f1998f8577.tar.gz riscv-isa-sim-b8e562a58cc5e51a358167cfda3754f1998f8577.tar.bz2 |
Use size_t, rather than int, for hartids
They aren't signed quantities.
Diffstat (limited to 'spike_main')
-rw-r--r-- | spike_main/spike-log-parser.cc | 2 | ||||
-rw-r--r-- | spike_main/spike.cc | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/spike_main/spike-log-parser.cc b/spike_main/spike-log-parser.cc index cec9c31..9bea5c5 100644 --- a/spike_main/spike-log-parser.cc +++ b/spike_main/spike-log-parser.cc @@ -37,7 +37,7 @@ int main(int UNUSED argc, char** argv) /*default_endianness*/endianness_little, /*default_pmpregions=*/16, /*default_mem_layout=*/std::vector<mem_cfg_t>(), - /*default_hartids=*/std::vector<int>(), + /*default_hartids=*/std::vector<size_t>(), /*default_real_time_clint=*/false, /*default_trigger_count=*/4); diff --git a/spike_main/spike.cc b/spike_main/spike.cc index 9032db4..e7ee03a 100644 --- a/spike_main/spike.cc +++ b/spike_main/spike.cc @@ -291,11 +291,11 @@ static unsigned long atoul_nonzero_safe(const char* s) return res; } -static std::vector<int> parse_hartids(const char *s) +static std::vector<size_t> parse_hartids(const char *s) { std::string const str(s); std::stringstream stream(str); - std::vector<int> hartids; + std::vector<size_t> hartids; int n; while (stream >> n) { @@ -353,7 +353,7 @@ int main(int argc, char** argv) /*default_endianness*/endianness_little, /*default_pmpregions=*/16, /*default_mem_layout=*/parse_mem_layout("2048"), - /*default_hartids=*/std::vector<int>(), + /*default_hartids=*/std::vector<size_t>(), /*default_real_time_clint=*/false, /*default_trigger_count=*/4); @@ -536,7 +536,7 @@ int main(int argc, char** argv) // Set default set of hartids based on nprocs, but don't set the // explicit_hartids flag (which means that downstream code can know that // we've only set the number of harts, not explicitly chosen their IDs). - std::vector<int> default_hartids; + std::vector<size_t> default_hartids; default_hartids.reserve(nprocs()); for (size_t i = 0; i < nprocs(); ++i) { default_hartids.push_back(i); |