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 {
71
71
)
72
72
}
73
73
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
-
84
74
#[no_mangle]
85
75
pub extern "C" fn floor(x: f64) -> f64 {
86
76
unsafe { intrinsics::floorf64(x) }
Original file line number Diff line number Diff line change 5
5
#![deny(unsafe_op_in_unsafe_fn)]
6
6
7
7
use crate::io::ErrorKind;
8
- use crate::os::raw::c_char;
9
8
use crate::sync::atomic::{AtomicBool, Ordering};
10
9
11
10
pub mod abi;
@@ -130,15 +129,6 @@ pub fn decode_error_kind(code: i32) -> ErrorKind {
130
129
}
131
130
}
132
131
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
-
142
132
pub fn abort_internal() -> ! {
143
133
abi::usercalls::exit(true)
144
134
}
Original file line number Diff line number Diff line change @@ -99,5 +99,3 @@ pub fn hashmap_random_keys() -> (u64, u64) {
99
99
(x1, x2)
100
100
}
101
101
}
102
-
103
- pub use libc::strlen;
Original file line number Diff line number Diff line change 3
3
use crate::io::ErrorKind;
4
4
5
5
pub use self::rand::hashmap_random_keys;
6
- pub use libc::strlen;
7
6
8
7
#[cfg(not(target_os = "espidf"))]
9
8
#[macro_use]
Original file line number Diff line number Diff line change @@ -4,10 +4,6 @@ pub mod memchr {
4
4
pub use core::slice::memchr::{memchr, memrchr};
5
5
}
6
6
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
-
11
7
// SAFETY: must be called only once during runtime initialization.
12
8
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
13
9
pub unsafe fn init(_argc: isize, _argv: *const *const u8) {}
@@ -38,15 +34,3 @@ pub fn abort_internal() -> ! {
38
34
pub fn hashmap_random_keys() -> (u64, u64) {
39
35
(1, 2)
40
36
}
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;
7
7
use crate::time::Duration;
8
8
9
9
pub use self::rand::hashmap_random_keys;
10
- pub use libc::strlen;
11
10
12
11
#[macro_use]
13
12
pub mod compat;
You can’t perform that action at this time.
0 commit comments