]> git.lizzy.rs Git - rust.git/commitdiff
`memcmp` returns `i32`
authorOliver Schneider <github35764891676564198441@oli-obk.de>
Wed, 30 May 2018 12:29:32 +0000 (14:29 +0200)
committerOliver Schneider <github35764891676564198441@oli-obk.de>
Sun, 3 Jun 2018 11:08:51 +0000 (13:08 +0200)
src/fn_call.rs
src/lib.rs

index ea0c5eb8b26e993fe3613061a0f42e5129777cf2..6a2255e577724d263bda21ae0a8520f7f8d6dc51 100644 (file)
@@ -289,7 +289,7 @@ fn call_c_abi(
 
                     use std::cmp::Ordering::*;
                     match left_bytes.cmp(right_bytes) {
-                        Less => -1i8,
+                        Less => -1i32,
                         Equal => 0,
                         Greater => 1,
                     }
@@ -297,7 +297,7 @@ fn call_c_abi(
 
                 self.write_scalar(
                     dest,
-                    Scalar::from_i8(result),
+                    Scalar::from_i32(result),
                     dest_ty,
                 )?;
             }
index e3c83c284db998b668a59f79c7c2fb5f6028206f..079560c0ca9555e73bf2f7337b4f356a836fd2a4 100644 (file)
@@ -55,7 +55,7 @@
 
 pub trait ScalarExt {
     fn null() -> Self;
-    fn from_i8(i: i8) -> Self;
+    fn from_i32(i: i32) -> Self;
     fn from_u128(i: u128) -> Self;
     fn from_i128(i: i128) -> Self;
     fn from_usize(i: u64, ptr_size: Size) -> Self;
@@ -72,8 +72,8 @@ fn null() -> Self {
         Scalar::Bits { bits: 0, defined: 128 }
     }
 
-    fn from_i8(i: i8) -> Self {
-        Scalar::Bits { bits: i as i128 as u128, defined: 8 }
+    fn from_i32(i: i32) -> Self {
+        Scalar::Bits { bits: i as u32 as u128, defined: 32 }
     }
 
     fn from_u128(i: u128) -> Self {