Home
last modified time | relevance | path

Searched refs:rhs (Results 1 – 6 of 6) sorted by relevance

/bootable/libbootloader/gbl/libsafemath/src/
Dlib.rs169 pub fn round_down<T>(self, rhs: T) -> Self in round_down()
173 self - (self % rhs) in round_down()
178 pub fn round_up<T>(self, rhs: T) -> Self in round_up()
183 ((self + rhs) - 1).round_down(rhs) in round_up()
240 fn $op(self, rhs: T) -> Self {
241 let rhs: Self = rhs.into(); localVariable
243 match (self.0, rhs.0) {
245 (_, Err(_)) => rhs,
246 (Ok(lhs), Ok(rhs)) => Self(lhs.$func(rhs).ok_or_else(Location::caller)),
256 fn $assign_op(&mut self, rhs: T) {
[all …]
/bootable/libbootloader/gbl/libavb/src/
Dlib.rs111 let (lhs, rhs) = unsafe { in avb_memcmp()
117 Ord::cmp(lhs, rhs) as i32 in avb_memcmp()
127 let (lhs, rhs) = unsafe { (CStr::from_ptr(s1 as *const _), CStr::from_ptr(s2 as *const _)) }; in avb_strcmp()
128 Ord::cmp(lhs, rhs) as i32 in avb_strcmp()
139 let (lhs, rhs) = unsafe { (CStr::from_ptr(s1 as *const _), CStr::from_ptr(s2 as *const _)) }; in avb_strncmp()
140 let cmp_size = min(min(lhs.to_bytes().len(), rhs.to_bytes().len()), n); in avb_strncmp()
141 Ord::cmp(&lhs.to_bytes()[..cmp_size], &rhs.to_bytes()[..cmp_size]) as i32 in avb_strncmp()
/bootable/libbootloader/gbl/efi/src/
Dutils.rs44 pub fn usize_roundup<L: TryInto<usize>, R: TryInto<usize>>(lhs: L, rhs: R) -> Result<usize> { in usize_roundup()
47 let rhs = to_usize(rhs)?; in usize_roundup() localVariable
48 let compute = || lhs.checked_add(rhs.checked_sub(1)?)?.checked_div(rhs)?.checked_mul(rhs); in usize_roundup()
53 pub fn usize_add<L: TryInto<usize>, R: TryInto<usize>>(lhs: L, rhs: R) -> Result<usize> { in usize_add()
54 Ok(to_usize(lhs)?.checked_add(to_usize(rhs)?).ok_or_else(|| EfiAppError::ArithmeticOverflow)?) in usize_add()
Dnet.rs288 .min_by(|lhs, rhs| Ord::cmp(lhs.1.text().unwrap(), rhs.1.text().unwrap())) in find_net_device()
/bootable/libbootloader/gbl/libgbl/src/fastboot/
Dsparse.rs257 fn usize_add<L: TryInto<usize>, R: TryInto<usize>>(lhs: L, rhs: R) -> Result<usize, CommandError> { in usize_add()
258 Ok(to_usize(lhs)?.checked_add(to_usize(rhs)?).ok_or(ERR_ARITHMETIC_OVERFLOW)?) in usize_add()
267 fn u64_add<L: TryInto<u64>, R: TryInto<u64>>(lhs: L, rhs: R) -> Result<u64, CommandError> { in u64_add()
268 Ok(to_u64(lhs)?.checked_add(to_u64(rhs)?).ok_or(ERR_ARITHMETIC_OVERFLOW)?) in u64_add()
272 fn u64_mul<L: TryInto<u64>, R: TryInto<u64>>(lhs: L, rhs: R) -> Result<u64, CommandError> { in u64_mul()
273 Ok(to_u64(lhs)?.checked_mul(to_u64(rhs)?).ok_or(ERR_ARITHMETIC_OVERFLOW)?) in u64_mul()
Dmod.rs256 fn add(lhs: u64, rhs: u64) -> Result<u64, CommandError> { in add()
257 lhs.checked_add(rhs).ok_or("Overflow".into()) in add()
261 fn sub(lhs: u64, rhs: u64) -> Result<u64, CommandError> { in sub()
262 lhs.checked_sub(rhs).ok_or("Overflow".into()) in sub()