From f31ee6a2257b6612b5c8e6332dc1c50e97bbf62a Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 31 Oct 2019 12:59:54 +0800 Subject: [PATCH] Fix integer narrowing on x86 The f_type is an alias to `int` on 32-bit system and the switch cases uses `unsigned int`. Closes #11427. --- src/base/utils/fs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/utils/fs.cpp b/src/base/utils/fs.cpp index 76cd74179..04ccb12ef 100644 --- a/src/base/utils/fs.cpp +++ b/src/base/utils/fs.cpp @@ -348,7 +348,7 @@ bool Utils::Fs::isNetworkFileSystem(const QString &path) // Magic number references: // 1. /usr/include/linux/magic.h // 2. https://github.com/coreutils/coreutils/blob/master/src/stat.c - switch (buf.f_type) { + switch (static_cast(buf.f_type)) { case 0xFF534D42: // CIFS_MAGIC_NUMBER case 0x6969: // NFS_SUPER_MAGIC case 0x517B: // SMB_SUPER_MAGIC