Skip to content

Commit

Permalink
fix: eliminate type conversion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiud committed Oct 7, 2023
1 parent e17f932 commit eae3ea3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/base/commandlineflags.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,12 @@
: 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<int>(strtol(getenv(envname), nullptr, 10)))

#define EnvToUInt(envname, dflt) \
(!getenv(envname) ? (dflt) : strtoul(getenv(envname), nullptr, 10))
(!getenv(envname) \
? (dflt) \
: static_cast<unsigned>(strtoul(getenv(envname), nullptr, 10)))

#endif // BASE_COMMANDLINEFLAGS_H__
2 changes: 1 addition & 1 deletion src/logging_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ struct MyLogger : public base::Logger {

void Flush() override {}

uint32 LogSize() override { return data.length(); }
uint32 LogSize() override { return static_cast<uint32>(data.length()); }

private:
bool* set_on_destruction_;
Expand Down

0 comments on commit eae3ea3

Please sign in to comment.