Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 8755986

Browse files
committed
Move non-public functions to pub(crate)
Remove exceptions from the test list after doing so
1 parent 2c1ec98 commit 8755986

File tree

12 files changed

+12
-25
lines changed

12 files changed

+12
-25
lines changed

build.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,7 @@ mod musl_reference_tests {
2727
// These files are all internal functions or otherwise miscellaneous, not
2828
// defining a function we want to test.
2929
const IGNORED_FILES: &[&str] = &[
30-
"expo2.rs", // kernel, private
3130
"fenv.rs",
32-
"k_cos.rs", // kernel, private
33-
"k_cosf.rs", // kernel, private
34-
"k_expo2.rs", // kernel, private
35-
"k_expo2f.rs", // kernel, private
36-
"k_sin.rs", // kernel, private
37-
"k_sinf.rs", // kernel, private
38-
"k_tan.rs", // kernel, private
39-
"k_tanf.rs", // kernel, private
40-
"mod.rs",
41-
"rem_pio2.rs", // kernel, private
42-
"rem_pio2_large.rs", // kernel, private
43-
"rem_pio2f.rs", // kernel, private
4431
"sincos.rs", // more than 1 result
4532
"sincosf.rs", // more than 1 result
4633
"jn.rs", // passed, but very slow

src/math/expo2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::{combine_words, exp};
33
/* exp(x)/2 for x >= log(DBL_MAX), slightly better than 0.5*exp(x/2)*exp(x/2) */
44
#[inline]
55
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
6-
pub fn expo2(x: f64) -> f64 {
6+
pub(crate) fn expo2(x: f64) -> f64 {
77
/* k is such that k*ln2 has minimal relative error and x - kln2 > log(DBL_MIN) */
88
const K: i32 = 2043;
99
let kln2 = f64::from_bits(0x40962066151add8b);

src/math/k_cos.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const C6: f64 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */
5353
// any extra precision in w.
5454
#[inline]
5555
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
56-
pub fn k_cos(x: f64, y: f64) -> f64 {
56+
pub(crate) fn k_cos(x: f64, y: f64) -> f64 {
5757
let z = x * x;
5858
let w = z * z;
5959
let r = z * (C1 + z * (C2 + z * C3)) + w * w * (C4 + z * (C5 + z * C6));

src/math/k_cosf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const C3: f64 = 0.0000243904487962774090654; /* 0x199342e0ee5069.0p-68 */
2222

2323
#[inline]
2424
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
25-
pub fn k_cosf(x: f64) -> f32 {
25+
pub(crate) fn k_cosf(x: f64) -> f32 {
2626
let z = x * x;
2727
let w = z * z;
2828
let r = C2 + z * C3;

src/math/k_expo2f.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const K: i32 = 235;
66
/* expf(x)/2 for x >= log(FLT_MAX), slightly better than 0.5f*expf(x/2)*expf(x/2) */
77
#[inline]
88
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
9-
pub fn k_expo2f(x: f32) -> f32 {
9+
pub(crate) fn k_expo2f(x: f32) -> f32 {
1010
let k_ln2 = f32::from_bits(0x4322e3bc);
1111
/* note that k is odd and scale*scale overflows */
1212
let scale = f32::from_bits(((0x7f + K / 2) as u32) << 23);

src/math/k_sin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const S6: f64 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */
4545
// sin(x) = x + (S1*x + (x *(r-y/2)+y))
4646
#[inline]
4747
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
48-
pub fn k_sin(x: f64, y: f64, iy: i32) -> f64 {
48+
pub(crate) fn k_sin(x: f64, y: f64, iy: i32) -> f64 {
4949
let z = x * x;
5050
let w = z * z;
5151
let r = S2 + z * (S3 + z * S4) + z * w * (S5 + z * S6);

src/math/k_sinf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const S4: f64 = 0.0000027183114939898219064; /* 0x16cd878c3b46a7.0p-71 */
2222

2323
#[inline]
2424
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
25-
pub fn k_sinf(x: f64) -> f32 {
25+
pub(crate) fn k_sinf(x: f64) -> f32 {
2626
let z = x * x;
2727
let w = z * z;
2828
let r = S3 + z * S4;

src/math/k_tan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const PIO4_LO: f64 = 3.06161699786838301793e-17; /* 3C81A626, 33145C07 */
6060

6161
#[inline]
6262
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
63-
pub fn k_tan(mut x: f64, mut y: f64, odd: i32) -> f64 {
63+
pub(crate) fn k_tan(mut x: f64, mut y: f64, odd: i32) -> f64 {
6464
let hx = (f64::to_bits(x) >> 32) as u32;
6565
let big = (hx & 0x7fffffff) >= 0x3FE59428; /* |x| >= 0.6744 */
6666
if big {

src/math/k_tanf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const T: [f64; 6] = [
2121

2222
#[inline]
2323
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
24-
pub fn k_tanf(x: f64, odd: bool) -> f32 {
24+
pub(crate) fn k_tanf(x: f64, odd: bool) -> f32 {
2525
let z = x * x;
2626
/*
2727
* Split up the polynomial into small independent terms to give

src/math/rem_pio2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const PIO2_3T: f64 = 8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
4343
// caller must handle the case when reduction is not needed: |x| ~<= pi/4 */
4444
#[inline]
4545
#[cfg_attr(all(test, assert_no_panic), no_panic::no_panic)]
46-
pub fn rem_pio2(x: f64) -> (i32, f64, f64) {
46+
pub(crate) fn rem_pio2(x: f64) -> (i32, f64, f64) {
4747
let x1p24 = f64::from_bits(0x4170000000000000);
4848

4949
let sign = (f64::to_bits(x) >> 63) as i32;

0 commit comments

Comments
 (0)