forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-02-13 e440ec23c5a540cdd3f7464e8779219be6fd3d95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Fix additional compiler warnings
 
Fixes
../../base/files/file_util_linux.cc:33:10: error: case value evaluates to -1859950530, which cannot be narrowed to type 'unsigned long' [-Wc++11-narrowing]                                                         case static_cast<int>(BTRFS_SUPER_MAGIC):
         ^
 
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
 
--- a/base/files/file_util_linux.cc
+++ b/base/files/file_util_linux.cc
@@ -30,7 +30,7 @@ bool GetFileSystemType(const FilePath& p
     case EXT2_SUPER_MAGIC:  // Also ext3 and ext4
     case MSDOS_SUPER_MAGIC:
     case REISERFS_SUPER_MAGIC:
-    case static_cast<int>(BTRFS_SUPER_MAGIC):
+    case static_cast<unsigned int>(BTRFS_SUPER_MAGIC):
     case 0x5346544E:  // NTFS
     case 0x58465342:  // XFS
     case 0x3153464A:  // JFS
@@ -40,14 +40,14 @@ bool GetFileSystemType(const FilePath& p
       *type = FILE_SYSTEM_NFS;
       break;
     case SMB_SUPER_MAGIC:
-    case static_cast<int>(0xFF534D42):  // CIFS
+    case static_cast<unsigned int>(0xFF534D42):  // CIFS
       *type = FILE_SYSTEM_SMB;
       break;
     case CODA_SUPER_MAGIC:
       *type = FILE_SYSTEM_CODA;
       break;
-    case static_cast<int>(HUGETLBFS_MAGIC):
-    case static_cast<int>(RAMFS_MAGIC):
+    case static_cast<unsigned int>(HUGETLBFS_MAGIC):
+    case static_cast<unsigned int>(RAMFS_MAGIC):
     case TMPFS_MAGIC:
       *type = FILE_SYSTEM_MEMORY;
       break;
--- a/base/system/sys_info_posix.cc
+++ b/base/system/sys_info_posix.cc
@@ -102,8 +102,8 @@ bool IsStatsZeroIfUnlimited(const base::
 
   switch (stats.f_type) {
     case TMPFS_MAGIC:
-    case static_cast<int>(HUGETLBFS_MAGIC):
-    case static_cast<int>(RAMFS_MAGIC):
+    case static_cast<unsigned int>(HUGETLBFS_MAGIC):
+    case static_cast<unsigned int>(RAMFS_MAGIC):
       return true;
   }
   return false;