From a0af9422559d3e50c700eb615bfc28ec46bd5e55 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Wed, 31 Mar 2021 10:25:11 -0400 Subject: [PATCH] use inline, not inline(always) --- src/math.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/math.rs b/src/math.rs index a2739b2..90e4e76 100644 --- a/src/math.rs +++ b/src/math.rs @@ -1,7 +1,7 @@ // Previously from trig.rs // From https://bits.stephan-brumme.com/absFloat.html #[allow(dead_code)] -#[inline(always)] +#[inline] fn abs(x: f32) -> f32 { return f32::from_bits(x.to_bits() & 0x7FFF_FFFF); } @@ -9,7 +9,7 @@ fn abs(x: f32) -> f32 { // Previously from trig.rs // Branchless floor implementation #[allow(dead_code)] -#[inline(always)] +#[inline] fn floor(x: f32) -> f32 { let mut x_trunc = (x as i32) as f32; x_trunc -= (x < x_trunc) as i32 as f32; @@ -20,7 +20,7 @@ fn floor(x: f32) -> f32 { // Approximates `cos(x)` in radians with the maximum error of `0.002` // https://stackoverflow.com/posts/28050328/revisions #[allow(dead_code)] -#[inline(always)] +#[inline] pub fn cos(mut x: f32) -> f32 { const ALPHA: f32 = 0.5 * std::f32::consts::FRAC_1_PI; x *= ALPHA; @@ -33,7 +33,7 @@ pub fn cos(mut x: f32) -> f32 { // Previously from trig.rs // Approximates `sin(x)` in radians with the maximum error of `0.002` #[allow(dead_code)] -#[inline(always)] +#[inline] pub fn sin(x: f32) -> f32 { return cos(x - std::f32::consts::FRAC_PI_2); }