diff options
Diffstat (limited to 'absl/base/internal/strerror.cc')
-rw-r--r-- | absl/base/internal/strerror.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/absl/base/internal/strerror.cc b/absl/base/internal/strerror.cc index 0d6226fd..de91c05e 100644 --- a/absl/base/internal/strerror.cc +++ b/absl/base/internal/strerror.cc @@ -66,8 +66,8 @@ constexpr int kSysNerr = 135; std::array<std::string, kSysNerr>* NewStrErrorTable() { auto* table = new std::array<std::string, kSysNerr>; - for (int i = 0; i < static_cast<int>(table->size()); ++i) { - (*table)[i] = StrErrorInternal(i); + for (size_t i = 0; i < table->size(); ++i) { + (*table)[i] = StrErrorInternal(static_cast<int>(i)); } return table; } @@ -77,8 +77,8 @@ std::array<std::string, kSysNerr>* NewStrErrorTable() { std::string StrError(int errnum) { absl::base_internal::ErrnoSaver errno_saver; static const auto* table = NewStrErrorTable(); - if (errnum >= 0 && errnum < static_cast<int>(table->size())) { - return (*table)[errnum]; + if (errnum >= 0 && static_cast<size_t>(errnum) < table->size()) { + return (*table)[static_cast<size_t>(errnum)]; } return StrErrorInternal(errnum); } |