base: Fix narrowing casting for Musl

This commit is contained in:
klzgrad 2021-09-02 00:42:31 +08:00
parent 0cb647b4c2
commit 15c431ff5e
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ bool GetFileSystemType(const FilePath& path, FileSystemType* type) {
// Not all possible |statfs_buf.f_type| values are in linux/magic.h. // Not all possible |statfs_buf.f_type| values are in linux/magic.h.
// Missing values are copied from the statfs man page. // Missing values are copied from the statfs man page.
switch (statfs_buf.f_type) { switch (static_cast<int>(statfs_buf.f_type)) {
case 0: case 0:
*type = FILE_SYSTEM_0; *type = FILE_SYSTEM_0;
break; break;

View File

@ -100,7 +100,7 @@ bool IsStatsZeroIfUnlimited(const base::FilePath& path) {
if (HANDLE_EINTR(statfs(path.value().c_str(), &stats)) != 0) if (HANDLE_EINTR(statfs(path.value().c_str(), &stats)) != 0)
return false; return false;
switch (stats.f_type) { switch (static_cast<int>(stats.f_type)) {
case TMPFS_MAGIC: case TMPFS_MAGIC:
case static_cast<int>(HUGETLBFS_MAGIC): case static_cast<int>(HUGETLBFS_MAGIC):
case static_cast<int>(RAMFS_MAGIC): case static_cast<int>(RAMFS_MAGIC):