@@ -847,18 +847,18 @@ pub mod raw {
847
847
use vec:: MutableVector ;
848
848
849
849
/// Create a Rust string from a null-terminated *u8 buffer
850
- pub unsafe fn from_buf ( buf : * u8 ) -> ~str {
850
+ pub unsafe fn from_buf ( buf : * const u8 ) -> ~str {
851
851
let mut curr = buf;
852
852
let mut i = 0 u;
853
853
while * curr != 0u8 {
854
854
i += 1 u;
855
- curr = ptr:: offset ( buf, i) ;
855
+ curr = ptr:: const_offset ( buf, i) ;
856
856
}
857
857
return from_buf_len ( buf, i) ;
858
858
}
859
859
860
860
/// Create a Rust string from a *u8 buffer of the given length
861
- pub unsafe fn from_buf_len ( buf : * u8 , len : uint ) -> ~str {
861
+ pub unsafe fn from_buf_len ( buf : * const u8 , len : uint ) -> ~str {
862
862
let mut v: ~[ u8 ] = vec:: with_capacity ( len + 1 ) ;
863
863
v. as_mut_buf ( |vbuf, _len| {
864
864
ptr:: copy_memory ( vbuf, buf as * u8 , len)
@@ -871,12 +871,12 @@ pub mod raw {
871
871
}
872
872
873
873
/// Create a Rust string from a null-terminated C string
874
- pub unsafe fn from_c_str ( c_str : * libc:: c_char ) -> ~str {
874
+ pub unsafe fn from_c_str ( c_str : * const libc:: c_char ) -> ~str {
875
875
from_buf ( :: cast:: transmute ( c_str) )
876
876
}
877
877
878
878
/// Create a Rust string from a `*c_char` buffer of the given length
879
- pub unsafe fn from_c_str_len ( c_str : * libc:: c_char , len : uint ) -> ~str {
879
+ pub unsafe fn from_c_str_len ( c_str : * const libc:: c_char , len : uint ) -> ~str {
880
880
from_buf_len ( :: cast:: transmute ( c_str) , len)
881
881
}
882
882
0 commit comments