Skip to content
Snippets Groups Projects
Commit b0f8e31b authored by Tom Almeida's avatar Tom Almeida
Browse files

ran fmt.sh

parent 87ec6dfa
No related branches found
No related tags found
No related merge requests found
...@@ -125,20 +125,23 @@ pub unsafe extern "C" fn strcspn(s1: *const c_char, s2: *const c_char) -> c_ulon ...@@ -125,20 +125,23 @@ pub unsafe extern "C" fn strcspn(s1: *const c_char, s2: *const c_char) -> c_ulon
let s1 = s1 as *const u8; let s1 = s1 as *const u8;
let s2 = s2 as *const u8; let s2 = s2 as *const u8;
// The below logic is effectively ripped from the musl implementation // The below logic is effectively ripped from the musl implementation
let mut byteset = [0u8; 32/mem::size_of::<usize>()]; let mut byteset = [0u8; 32 / mem::size_of::<usize>()];
let mut i = 0; let mut i = 0;
while *s2.offset(i) != 0 { while *s2.offset(i) != 0 {
byteset[(*s2.offset(i) as usize)/(8*mem::size_of::<usize>())] |= 1 << (*s2.offset(i) as usize % (8*mem::size_of::<usize>())); byteset[(*s2.offset(i) as usize) / (8 * mem::size_of::<usize>())] |=
1 << (*s2.offset(i) as usize % (8 * mem::size_of::<usize>()));
i += 1; i += 1;
} }
i = 0; // reset i = 0; // reset
while *s2.offset(i) != 0 { while *s2.offset(i) != 0 {
if byteset[(*s2.offset(i) as usize)/(8*mem::size_of::<usize>())] & 1 << (*s2.offset(i) as usize % (8*mem::size_of::<usize>())) > 0 { if byteset[(*s2.offset(i) as usize) / (8 * mem::size_of::<usize>())]
& 1 << (*s2.offset(i) as usize % (8 * mem::size_of::<usize>())) > 0
{
break; break;
} }
i += 1; i += 1;
...@@ -265,20 +268,23 @@ pub unsafe extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> c_ulong ...@@ -265,20 +268,23 @@ pub unsafe extern "C" fn strspn(s1: *const c_char, s2: *const c_char) -> c_ulong
let s1 = s1 as *const u8; let s1 = s1 as *const u8;
let s2 = s2 as *const u8; let s2 = s2 as *const u8;
// The below logic is effectively ripped from the musl implementation // The below logic is effectively ripped from the musl implementation
let mut byteset = [0u8; 32/mem::size_of::<usize>()]; let mut byteset = [0u8; 32 / mem::size_of::<usize>()];
let mut i = 0; let mut i = 0;
while *s2.offset(i) != 0 { while *s2.offset(i) != 0 {
byteset[(*s2.offset(i) as usize)/(8*mem::size_of::<usize>())] |= 1 << (*s2.offset(i) as usize % (8*mem::size_of::<usize>())); byteset[(*s2.offset(i) as usize) / (8 * mem::size_of::<usize>())] |=
1 << (*s2.offset(i) as usize % (8 * mem::size_of::<usize>()));
i += 1; i += 1;
} }
i = 0; // reset i = 0; // reset
while *s2.offset(i) != 0 { while *s2.offset(i) != 0 {
if byteset[(*s2.offset(i) as usize)/(8*mem::size_of::<usize>())] & 1 << (*s2.offset(i) as usize % (8*mem::size_of::<usize>())) < 1 { if byteset[(*s2.offset(i) as usize) / (8 * mem::size_of::<usize>())]
& 1 << (*s2.offset(i) as usize % (8 * mem::size_of::<usize>())) < 1
{
break; break;
} }
i += 1; i += 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment