Blame 0004-Fix-build-on-32-bit-systems.patch

Igor Raits dd0fb7
From 4d2bb0681fab9ffa019483974a8bca8551ec5d7f Mon Sep 17 00:00:00 2001
Igor Raits dd0fb7
From: Fabian Homborg <FHomborg@gmail.com>
Igor Raits dd0fb7
Date: Sat, 15 Feb 2020 10:10:59 +0100
Igor Raits dd0fb7
Subject: [PATCH 4/4] Fix build on 32-bit systems
Igor Raits dd0fb7
Igor Raits dd0fb7
This was a weird case of the integer converseys.
Igor Raits dd0fb7
Igor Raits dd0fb7
Fixes #6609.
Igor Raits dd0fb7
Igor Raits dd0fb7
(cherry picked from commit 399a71645e76ec103c32dae4caa0778b4bf57eaa)
Igor Raits dd0fb7
---
Igor Raits dd0fb7
 src/wutil.cpp | 5 +++--
Igor Raits dd0fb7
 1 file changed, 3 insertions(+), 2 deletions(-)
Igor Raits dd0fb7
Igor Raits dd0fb7
diff --git a/src/wutil.cpp b/src/wutil.cpp
Igor Raits dd0fb7
index ea7bdf694..1d1f0764a 100644
Igor Raits dd0fb7
--- a/src/wutil.cpp
Igor Raits dd0fb7
+++ b/src/wutil.cpp
Igor Raits dd0fb7
@@ -305,10 +305,11 @@ int fd_check_is_remote(int fd) {
Igor Raits dd0fb7
     }
Igor Raits dd0fb7
     // Linux has constants for these like NFS_SUPER_MAGIC, SMB_SUPER_MAGIC, CIFS_MAGIC_NUMBER but
Igor Raits dd0fb7
     // these are in varying headers. Simply hard code them.
Igor Raits dd0fb7
-    switch (buf.f_type) {
Igor Raits dd0fb7
+    // NOTE: The cast is necessary for 32-bit systems because of the 4-byte CIFS_MAGIC_NUMBER
Igor Raits dd0fb7
+    switch ((unsigned int)buf.f_type) {
Igor Raits dd0fb7
         case 0x6969:      // NFS_SUPER_MAGIC
Igor Raits dd0fb7
         case 0x517B:      // SMB_SUPER_MAGIC
Igor Raits dd0fb7
-        case 0xFF534D42:  // CIFS_MAGIC_NUMBER
Igor Raits dd0fb7
+        case 0xFF534D42u:  // CIFS_MAGIC_NUMBER
Igor Raits dd0fb7
             return 1;
Igor Raits dd0fb7
         default:
Igor Raits dd0fb7
             // Other FSes are assumed local.
Igor Raits dd0fb7
-- 
Igor Raits dd0fb7
2.25.0
Igor Raits dd0fb7