From 8010b2661ae37c4782ed13f9c51785c06268bbe5 Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sat, 5 Mar 2022 18:42:40 +0000 Subject: [PATCH] Add inlines for basic functions in fixnum which weren't being inlined --- agb-fixnum/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/agb-fixnum/src/lib.rs b/agb-fixnum/src/lib.rs index d093dba3..2385fc36 100644 --- a/agb-fixnum/src/lib.rs +++ b/agb-fixnum/src/lib.rs @@ -68,15 +68,19 @@ pub trait FixedWidthSignedInteger: FixedWidthUnsignedInteger + Neg { impl FixedWidthUnsignedInteger for $T { + #[inline(always)] fn zero() -> Self { 0 } + #[inline(always)] fn one() -> Self { 1 } + #[inline(always)] fn ten() -> Self { 10 } + #[inline(always)] fn from_as_i32(v: i32) -> Self { v as $T } @@ -87,6 +91,7 @@ macro_rules! fixed_width_unsigned_integer_impl { macro_rules! fixed_width_signed_integer_impl { ($T: ty) => { impl FixedWidthSignedInteger for $T { + #[inline(always)] fn fixed_abs(self) -> Self { self.abs() }