From 934642155c036ce6880e57854f095f2863ab80f1 Mon Sep 17 00:00:00 2001 From: Christian Theune Date: Wed, 6 Jan 2016 08:25:58 +0100 Subject: @eelco's feedback: downgrade to regular float for size, remove unused function. --- src/libmain/shared.hh | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src/libmain/shared.hh') diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh index a350f496d..32183d6a6 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/shared.hh @@ -66,29 +66,6 @@ template N getIntArg(const string & opt, return n * multiplier; } -template N getFloatArg(const string & opt, - Strings::iterator & i, const Strings::iterator & end, bool allowUnit) -{ - ++i; - if (i == end) throw UsageError(format("‘%1%’ requires an argument") % opt); - string s = *i; - N multiplier = 1; - if (allowUnit && !s.empty()) { - char u = std::toupper(*s.rbegin()); - if (std::isalpha(u)) { - if (u == 'K') multiplier = 1ULL << 10; - else if (u == 'M') multiplier = 1ULL << 20; - else if (u == 'G') multiplier = 1ULL << 30; - else if (u == 'T') multiplier = 1ULL << 40; - else throw UsageError(format("invalid unit specifier ‘%1%’") % u); - s.resize(s.size() - 1); - } - } - N n; - if (!string2Float(s, n)) - throw UsageError(format("‘%1%’ requires a float argument") % opt); - return n * multiplier; -} /* Show the manual page for the specified program. */ void showManPage(const string & name); -- cgit v1.2.3