about summary refs log tree commit diff
path: root/src/libserialize
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-04-14 20:04:14 +1000
committerAlex Crichton <alex@alexcrichton.com>2014-04-15 19:45:00 -0700
commit54ec04f1c12c7fb4dbe5f01fdeb73d1079fef53d (patch)
treeefe91e930ac4527e3057fe65571df112ef5b8607 /src/libserialize
parent93dc55518840ee3cbd570c0d85aa7a445752af8b (diff)
downloadrust-54ec04f1c12c7fb4dbe5f01fdeb73d1079fef53d.tar.gz
rust-54ec04f1c12c7fb4dbe5f01fdeb73d1079fef53d.zip
Use the unsigned integer types for bitwise intrinsics.
Exposing ctpop, ctlz, cttz and bswap as taking signed i8/i16/... is just
exposing the internal LLVM names pointlessly (LLVM doesn't have "signed
integers" or "unsigned integers", it just has sized integer types
with (un)signed *operations*).

These operations are semantically working with raw bytes, which the
unsigned types model better.
Diffstat (limited to 'src/libserialize')
-rw-r--r--src/libserialize/ebml.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserialize/ebml.rs b/src/libserialize/ebml.rs
index 9b2df307b99..0efa93011fc 100644
--- a/src/libserialize/ebml.rs
+++ b/src/libserialize/ebml.rs
@@ -179,8 +179,8 @@ pub mod reader {
         ];
 
         unsafe {
-            let ptr = data.as_ptr().offset(start as int) as *i32;
-            let val = from_be32(*ptr) as u32;
+            let ptr = data.as_ptr().offset(start as int) as *u32;
+            let val = from_be32(*ptr);
 
             let i = (val >> 28u) as uint;
             let (shift, mask) = SHIFT_MASK_TABLE[i];