Browse Source

Replace `i32` with `c_int` in `memcmp`

As per the comments from jD91mZM2 on the merge request.
Benedikt Rascher-Friesenhausen 6 years ago
parent
commit
8e2b7c11b4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/header/string/mod.rs

+ 2 - 2
src/header/string/mod.rs

@@ -82,7 +82,7 @@ pub unsafe extern "C" fn memcmp(s1: *const c_void, s2: *const c_void, n: usize)
                 let c = *(a as *const u8).offset(i as isize);
                 let d = *(b as *const u8).offset(i as isize);
                 if c != d {
-                    return c as i32 - d as i32;
+                    return c as c_int - d as c_int;
                 }
             }
             unreachable!()
@@ -95,7 +95,7 @@ pub unsafe extern "C" fn memcmp(s1: *const c_void, s2: *const c_void, n: usize)
     let mut b = b as *const u8;
     for _ in 0..rem {
         if *a != *b {
-            return a as i32 - b as i32;
+            return a as c_int - b as c_int;
         }
         a = a.offset(1);
         b = b.offset(1);