Remove misc unneeded modifications in libchrome.
Bug: 73270448
Test: Built locally. Treehugger.
Change-Id: I2c3f193e1677e4a673ab0b3b60c0c3b40a57987b
(Reconstructed from 31babce11bb4f466b4754956e05cf62f48060fa4)
diff --git a/base/macros.h b/base/macros.h
index 0afcf4a..d888702 100644
--- a/base/macros.h
+++ b/base/macros.h
@@ -12,6 +12,8 @@
#include <stddef.h> // For size_t.
+// We define following macros conditionally as they may be defined by another libraries.
+
// Distinguish mips32.
#if defined(__mips__) && (_MIPS_SIM == _ABIO32) && !defined(__mips32__)
#define __mips32__
diff --git a/base/sys_info_posix.cc b/base/sys_info_posix.cc
index f6fcd10..70d4fba 100644
--- a/base/sys_info_posix.cc
+++ b/base/sys_info_posix.cc
@@ -90,7 +90,10 @@
if (HANDLE_EINTR(statfs(path.value().c_str(), &stats)) != 0)
return false;
- switch (stats.f_type) {
+ // In some platforms, |statfs_buf.f_type| is declared as signed, but some of
+ // the values will overflow it, causing narrowing warnings. Cast to the
+ // largest possible unsigned integer type to avoid it.
+ switch (static_cast<uintmax_t>(stats.f_type)) {
case TMPFS_MAGIC:
case HUGETLBFS_MAGIC:
case RAMFS_MAGIC: