This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +0
-40
lines changed Expand file tree Collapse file tree 6 files changed +0
-40
lines changed Original file line number Diff line number Diff line change @@ -71,16 +71,6 @@ pub fn unsupported_err() -> crate::io::Error {
7171 )
7272}
7373
74- pub unsafe fn strlen ( start : * const c_char ) -> usize {
75- let mut str = start;
76-
77- while * str != 0 {
78- str = str. offset ( 1 ) ;
79- }
80-
81- ( str as usize ) - ( start as usize )
82- }
83-
8474#[ no_mangle]
8575pub extern "C" fn floor ( x : f64 ) -> f64 {
8676 unsafe { intrinsics:: floorf64 ( x) }
Original file line number Diff line number Diff line change 55#![ deny( unsafe_op_in_unsafe_fn) ]
66
77use crate :: io:: ErrorKind ;
8- use crate :: os:: raw:: c_char;
98use crate :: sync:: atomic:: { AtomicBool , Ordering } ;
109
1110pub mod abi;
@@ -130,15 +129,6 @@ pub fn decode_error_kind(code: i32) -> ErrorKind {
130129 }
131130}
132131
133- pub unsafe fn strlen ( mut s : * const c_char ) -> usize {
134- let mut n = 0 ;
135- while unsafe { * s } != 0 {
136- n += 1 ;
137- s = unsafe { s. offset ( 1 ) } ;
138- }
139- return n;
140- }
141-
142132pub fn abort_internal ( ) -> ! {
143133 abi:: usercalls:: exit ( true )
144134}
Original file line number Diff line number Diff line change @@ -99,5 +99,3 @@ pub fn hashmap_random_keys() -> (u64, u64) {
9999 ( x1, x2)
100100 }
101101}
102-
103- pub use libc:: strlen;
Original file line number Diff line number Diff line change 33use crate :: io:: ErrorKind ;
44
55pub use self :: rand:: hashmap_random_keys;
6- pub use libc:: strlen;
76
87#[ cfg( not( target_os = "espidf" ) ) ]
98#[ macro_use]
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ pub mod memchr {
44 pub use core:: slice:: memchr:: { memchr, memrchr} ;
55}
66
7- // This is not necessarily correct. May want to consider making it part of the
8- // spec definition?
9- use crate :: os:: raw:: c_char;
10-
117// SAFETY: must be called only once during runtime initialization.
128// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
139pub unsafe fn init ( _argc : isize , _argv : * const * const u8 ) { }
@@ -38,15 +34,3 @@ pub fn abort_internal() -> ! {
3834pub fn hashmap_random_keys ( ) -> ( u64 , u64 ) {
3935 ( 1 , 2 )
4036}
41-
42- pub unsafe fn strlen ( mut s : * const c_char ) -> usize {
43- // SAFETY: The caller must guarantee `s` points to a valid 0-terminated string.
44- unsafe {
45- let mut n = 0 ;
46- while * s != 0 {
47- n += 1 ;
48- s = s. offset ( 1 ) ;
49- }
50- n
51- }
52- }
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ use crate::path::PathBuf;
77use crate :: time:: Duration ;
88
99pub use self :: rand:: hashmap_random_keys;
10- pub use libc:: strlen;
1110
1211#[ macro_use]
1312pub mod compat;
You can’t perform that action at this time.
0 commit comments