Verified Commit 99ecdced authored by jD91mZM2's avatar jD91mZM2

Add mutable pointers

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