diff options
Diffstat (limited to 'libartbase/base/utils.cc')
-rw-r--r-- | libartbase/base/utils.cc | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc index b989d9e495..30423a47a7 100644 --- a/libartbase/base/utils.cc +++ b/libartbase/base/utils.cc @@ -190,45 +190,6 @@ void GetTaskStats(pid_t tid, char* state, int* utime, int* stime, int* task_cpu) #endif } -static void ParseStringAfterChar(const std::string& s, - char c, - std::string* parsed_value, - UsageFn Usage) { - std::string::size_type colon = s.find(c); - if (colon == std::string::npos) { - Usage("Missing char %c in option %s\n", c, s.c_str()); - } - // Add one to remove the char we were trimming until. - *parsed_value = s.substr(colon + 1); -} - -void ParseDouble(const std::string& option, - char after_char, - double min, - double max, - double* parsed_value, - UsageFn Usage) { - std::string substring; - ParseStringAfterChar(option, after_char, &substring, Usage); - bool sane_val = true; - double value; - if ((false)) { - // TODO: this doesn't seem to work on the emulator. b/15114595 - std::stringstream iss(substring); - iss >> value; - // Ensure that we have a value, there was no cruft after it and it satisfies a sensible range. - sane_val = iss.eof() && (value >= min) && (value <= max); - } else { - char* end = nullptr; - value = strtod(substring.c_str(), &end); - sane_val = *end == '\0' && value >= min && value <= max; - } - if (!sane_val) { - Usage("Invalid double value %s for option %s\n", substring.c_str(), option.c_str()); - } - *parsed_value = value; -} - void SleepForever() { while (true) { usleep(1000000); |