From 9541ed763ad9f2ae3c13cad135a08b035b7754d7 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Thu, 2 Sep 2021 00:42:31 +0800 Subject: [PATCH] base: Fix narrowing casting for 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 4eff878e7b..667cf6c4c9 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):