Commit 1e7a8b6b authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'master' into 'master'

Add mutable pointers

See merge request !2
parents ba5a07a7 99ecdced
......@@ -42,6 +42,11 @@ impl<T: 'static> VaPrimitive for *const T {
<usize>::get(list) as *const T
}
}
impl<T: 'static> VaPrimitive for *mut T {
unsafe fn get(list: &mut VaList) -> Self {
<usize>::get(list) as *mut T
}
}
macro_rules! impl_va_prim_gr {
($u: ty, $s: ty) => {
......
......@@ -26,6 +26,11 @@ impl<T: 'static> VaPrimitive for *const T {
<usize>::get(list) as *const T
}
}
impl<T: 'static> VaPrimitive for *const T {
unsafe fn get(list: &mut VaList) -> Self {
<usize>::get(list) as *mut T
}
}
impl VaPrimitive for usize {
unsafe fn get(l: &mut VaList) -> Self {
l.get_raw()
......
......@@ -26,6 +26,11 @@ impl<T: 'static> VaPrimitive for *const T {
<usize>::get(list) as *const T
}
}
impl<T: 'static> VaPrimitive for *mut T {
unsafe fn get(list: &mut VaList) -> Self {
<usize>::get(list) as *mut T
}
}
impl VaPrimitive for usize {
unsafe fn get(l: &mut VaList) -> Self {
l.get_raw()
......
......@@ -73,6 +73,11 @@ impl<T: 'static> VaPrimitive for *const T {
<usize>::get(list) as *const T
}
}
impl<T: 'static> VaPrimitive for *mut T {
unsafe fn get(list: &mut VaList) -> Self {
<usize>::get(list) as *mut T
}
}
macro_rules! impl_va_prim {
($u: ty, $s: ty) => {
......
......@@ -22,6 +22,11 @@ impl<T: 'static> VaPrimitive for *const T {
<usize>::get(list) as *const T
}
}
impl<T: 'static> VaPrimitive for *mut T {
unsafe fn get(list: &mut VaList) -> Self {
<usize>::get(list) as *mut T
}
}
impl VaPrimitive for usize {
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