mirror of
https://github.com/simonask/libyaml-safer
synced 2025-02-17 04:48:29 +00:00
Simplify MOVE macro
This commit is contained in:
parent
c5de022daa
commit
924ba2d634
1 changed files with 1 additions and 13 deletions
|
@ -333,19 +333,7 @@ macro_rules! WIDTH {
|
|||
|
||||
macro_rules! MOVE {
|
||||
($string:expr) => {
|
||||
$string.pointer = $string.pointer.wrapping_offset(
|
||||
(if *$string.pointer as libc::c_int & 0x80_i32 == 0_i32 {
|
||||
1_i32
|
||||
} else if *$string.pointer as libc::c_int & 0xe0_i32 == 0xc0_i32 {
|
||||
2_i32
|
||||
} else if *$string.pointer as libc::c_int & 0xf0_i32 == 0xe0_i32 {
|
||||
3_i32
|
||||
} else if *$string.pointer as libc::c_int & 0xf8_i32 == 0xf0_i32 {
|
||||
4_i32
|
||||
} else {
|
||||
0_i32
|
||||
}) as isize,
|
||||
)
|
||||
$string.pointer = $string.pointer.wrapping_offset(WIDTH!($string) as isize)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue