Commit 858d63f7 authored by John Hodge (bugs)'s avatar John Hodge (bugs)

Bump version, fix error in win64

parent 0cf72349
[package] [package]
name = "va_list" name = "va_list"
version = "0.0.3" version = "0.1.0"
authors = [ "John Hodge <tpg@mutabah.net>" ] authors = [ "John Hodge <tpg@mutabah.net>" ]
description = "Provides a rust implementation of the 'va_list' type for a small set of ABIs. Allowing rust implementations of functions like vprintf." description = "Provides a rust implementation of the 'va_list' type for a small set of ABIs. Allowing rust implementations of functions like vprintf."
repository = "https://github.com/thepowersgang/va_list-rs" repository = "https://github.com/thepowersgang/va_list-rs"
......
...@@ -9,10 +9,6 @@ pub struct VaList(*const u8); ...@@ -9,10 +9,6 @@ pub struct VaList(*const u8);
impl VaList impl VaList
{ {
pub unsafe fn get<T: VaPrimitive>(&mut self) -> T {
T::get(self)
}
// Read a raw value from the list // Read a raw value from the list
unsafe fn get_raw<T: 'static>(&mut self) -> T { unsafe fn get_raw<T: 'static>(&mut self) -> T {
assert_eq!(self.0 as usize % mem::align_of::<T>(), 0); assert_eq!(self.0 as usize % mem::align_of::<T>(), 0);
...@@ -32,8 +28,8 @@ impl VaPrimitive for usize { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() ...@@ -32,8 +28,8 @@ impl VaPrimitive for usize { unsafe fn get(l: &mut VaList) -> Self { l.get_raw()
impl VaPrimitive for isize { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } } impl VaPrimitive for isize { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } }
impl VaPrimitive for u64 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } } impl VaPrimitive for u64 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } }
impl VaPrimitive for i64 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } } impl VaPrimitive for i64 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } }
impl VaPrimitive for u32 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw::<u64>() as _ } } impl VaPrimitive for u32 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw::<u64>() as u32 } }
impl VaPrimitive for i32 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw::<i64>() as _ } } impl VaPrimitive for i32 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw::<i64>() as i32 } }
//impl VaPrimitive for u16 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } } //impl VaPrimitive for u16 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } }
//impl VaPrimitive for i16 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } } //impl VaPrimitive for i16 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } }
//impl VaPrimitive for u8 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } } //impl VaPrimitive for u8 { unsafe fn get(l: &mut VaList) -> Self { l.get_raw() } }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment