diff options
author | Tsukasa OI <research_trasio@irq.a4lg.com> | 2021-12-02 11:29:18 +0900 |
---|---|---|
committer | Tsukasa OI <research_trasio@irq.a4lg.com> | 2021-12-02 11:29:18 +0900 |
commit | 375d55ef441e335660ccfc2d78fb93ceb804478a (patch) | |
tree | 5615934ecbcf062170d3faae8e63a17fda5856c1 /riscv/processor.cc | |
parent | 3090cee163e4c38a2f33c28928fca623f549285c (diff) | |
download | spike-375d55ef441e335660ccfc2d78fb93ceb804478a.zip spike-375d55ef441e335660ccfc2d78fb93ceb804478a.tar.gz spike-375d55ef441e335660ccfc2d78fb93ceb804478a.tar.bz2 |
Use strtolower in parse_varch_string
Diffstat (limited to 'riscv/processor.cc')
-rw-r--r-- | riscv/processor.cc | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/riscv/processor.cc b/riscv/processor.cc index dd3d3fb..ed9042f 100644 --- a/riscv/processor.cc +++ b/riscv/processor.cc @@ -117,12 +117,17 @@ static bool check_pow2(int val) return ((val & (val - 1))) == 0; } -void processor_t::parse_varch_string(const char* s) +static std::string strtolower(const char* str) { - std::string str, tmp; - for (const char *r = s; *r; r++) - str += std::tolower(*r); + std::string res; + for (const char *r = str; *r; r++) + res += std::tolower(*r); + return res; +} +void processor_t::parse_varch_string(const char* s) +{ + std::string str = strtolower(s); size_t pos = 0; size_t len = str.length(); int vlen = 0; @@ -165,14 +170,6 @@ void processor_t::parse_varch_string(const char* s) VU.vstart_alu = vstart_alu; } -static std::string strtolower(const char* str) -{ - std::string res; - for (const char *r = str; *r; r++) - res += std::tolower(*r); - return res; -} - void processor_t::parse_priv_string(const char* str) { std::string lowercase = strtolower(str); |