From 7283b3b91d51a1ac07f08e639c662c0331e407dd Mon Sep 17 00:00:00 2001 From: Sergiu Deitsch Date: Fri, 6 Oct 2023 23:51:06 +0200 Subject: [PATCH] fix: eliminate type conversion warnings --- src/base/commandlineflags.h | 4 ++-- src/logging_unittest.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/base/commandlineflags.h b/src/base/commandlineflags.h index c011df411..04cdf5878 100644 --- a/src/base/commandlineflags.h +++ b/src/base/commandlineflags.h @@ -140,9 +140,9 @@ : memchr("tTyY1\0", getenv(envname)[0], 6) != nullptr) #define EnvToInt(envname, dflt) \ - (!getenv(envname) ? (dflt) : strtol(getenv(envname), nullptr, 10)) + (!getenv(envname) ? (dflt) : static_cast(strtol(getenv(envname), nullptr, 10))) #define EnvToUInt(envname, dflt) \ - (!getenv(envname) ? (dflt) : strtoul(getenv(envname), nullptr, 10)) + (!getenv(envname) ? (dflt) : static_cast(strtoul(getenv(envname), nullptr, 10))) #endif // BASE_COMMANDLINEFLAGS_H__ diff --git a/src/logging_unittest.cc b/src/logging_unittest.cc index fff766070..c6aea7b08 100644 --- a/src/logging_unittest.cc +++ b/src/logging_unittest.cc @@ -894,7 +894,7 @@ struct MyLogger : public base::Logger { void Flush() override {} - uint32 LogSize() override { return data.length(); } + uint32 LogSize() override { return static_cast(data.length()); } private: bool* set_on_destruction_;