From 7dbb70417240f9b463d9ea2b8514c87f8982f4b8 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 2 Sep 2021 00:42:31 +0800 Subject: [PATCH] base: Fix narrowing casting on Musl --- src/base/files/file_util_linux.cc | 2 +- src/base/system/sys_info_posix.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/base/files/file_util_linux.cc b/src/base/files/file_util_linux.cc index b123dd2a3d..3000a9fb46 100644 --- a/src/base/files/file_util_linux.cc +++ b/src/base/files/file_util_linux.cc @@ -23,7 +23,7 @@ bool GetFileSystemType(const FilePath& path, FileSystemType* type) { // Not all possible |statfs_buf.f_type| values are in linux/magic.h. // Missing values are copied from the statfs man page. - switch (statfs_buf.f_type) { + switch (static_cast(statfs_buf.f_type)) { case 0: *type = FILE_SYSTEM_0; break; diff --git a/src/base/system/sys_info_posix.cc b/src/base/system/sys_info_posix.cc index 672c72f12a..94bcf6973c 100644 --- a/src/base/system/sys_info_posix.cc +++ b/src/base/system/sys_info_posix.cc @@ -100,7 +100,7 @@ bool IsStatsZeroIfUnlimited(const base::FilePath& path) { if (HANDLE_EINTR(statfs(path.value().c_str(), &stats)) != 0) return false; - switch (stats.f_type) { + switch (static_cast(stats.f_type)) { case TMPFS_MAGIC: case static_cast(HUGETLBFS_MAGIC): case static_cast(RAMFS_MAGIC):