diff options
author | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2024-07-19 15:37:58 +0300 |
commit | a990de90fe41456a23e58bd087d2f107d321f3a1 (patch) | |
tree | 15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/serde_json/src/lexical/shift.rs | |
parent | 3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff) | |
download | fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip |
Deleted vendor folder
Diffstat (limited to 'vendor/serde_json/src/lexical/shift.rs')
-rw-r--r-- | vendor/serde_json/src/lexical/shift.rs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/vendor/serde_json/src/lexical/shift.rs b/vendor/serde_json/src/lexical/shift.rs deleted file mode 100644 index a0bae01..0000000 --- a/vendor/serde_json/src/lexical/shift.rs +++ /dev/null @@ -1,46 +0,0 @@ -// Adapted from https://github.com/Alexhuszagh/rust-lexical. - -//! Bit-shift helpers. - -use super::float::ExtendedFloat; -use core::mem; - -// Shift extended-precision float right `shift` bytes. -#[inline] -pub(crate) fn shr(fp: &mut ExtendedFloat, shift: i32) { - let bits: u64 = mem::size_of::<u64>() as u64 * 8; - debug_assert!((shift as u64) < bits, "shr() overflow in shift right."); - - fp.mant >>= shift; - fp.exp += shift; -} - -// Shift extended-precision float right `shift` bytes. -// -// Accepts when the shift is the same as the type size, and -// sets the value to 0. -#[inline] -pub(crate) fn overflowing_shr(fp: &mut ExtendedFloat, shift: i32) { - let bits: u64 = mem::size_of::<u64>() as u64 * 8; - debug_assert!( - (shift as u64) <= bits, - "overflowing_shr() overflow in shift right." - ); - - fp.mant = if shift as u64 == bits { - 0 - } else { - fp.mant >> shift - }; - fp.exp += shift; -} - -// Shift extended-precision float left `shift` bytes. -#[inline] -pub(crate) fn shl(fp: &mut ExtendedFloat, shift: i32) { - let bits: u64 = mem::size_of::<u64>() as u64 * 8; - debug_assert!((shift as u64) < bits, "shl() overflow in shift left."); - - fp.mant <<= shift; - fp.exp -= shift; -} |