common/strtol.cc: refactor strict_si_cast() to silence warnings
to silence warnings like
../src/common/strtol.cc:286:7: warning: implicit conversion from 'promoted_t' (aka 'long long') to 'double' changes value from
9223372036854775807 to
9223372036854775808
[-Wimplicit-int-float-conversion]
static_cast<promoted_t>(std::numeric_limits<T>::max()) / pow (10, m)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
../src/common/strtol.cc:294:15: note: in instantiation of function template specialization 'strict_si_cast<long>' requested here
template long strict_si_cast<long>(std::string_view str, std::string *err);
^
Signed-off-by: Kefu Chai <kchai@redhat.com>