diff --git a/src/mat_macros.rs b/src/mat_macros.rs index 289f070b..bfd84bb8 100644 --- a/src/mat_macros.rs +++ b/src/mat_macros.rs @@ -18,7 +18,7 @@ macro_rules! mat_cast_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl MatCast<$t> for $t { #[inline] - pub fn from(m: $t) -> $t { + fn from(m: $t) -> $t { $t::new(NumCast::from(m.$comp0.clone()) $(, NumCast::from(m.$compN.clone()) )*) } } @@ -29,7 +29,7 @@ macro_rules! add_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> Add<$t, $t> for $t { #[inline] - pub fn add(&self, other: &$t) -> $t { + fn add(&self, other: &$t) -> $t { $t::new(self.$comp0 + other.$comp0 $(, self.$compN + other.$compN )*) } } @@ -40,7 +40,7 @@ macro_rules! sub_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> Sub<$t, $t> for $t { #[inline] - pub fn sub(&self, other: &$t) -> $t { + fn sub(&self, other: &$t) -> $t { $t::new(self.$comp0 - other.$comp0 $(, self.$compN - other.$compN )*) } } @@ -51,12 +51,12 @@ macro_rules! scalar_mul_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> ScalarMul for $t { #[inline] - pub fn scalar_mul(&self, other: &N) -> $t { + fn scalar_mul(&self, other: &N) -> $t { $t::new(self.$comp0 * *other $(, self.$compN * *other )*) } #[inline] - pub fn scalar_mul_inplace(&mut self, other: &N) { + fn scalar_mul_inplace(&mut self, other: &N) { self.$comp0 = self.$comp0 * *other; $(self.$compN = self.$compN * *other; )* } @@ -68,12 +68,12 @@ macro_rules! scalar_div_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> ScalarDiv for $t { #[inline] - pub fn scalar_div(&self, other: &N) -> $t { + fn scalar_div(&self, other: &N) -> $t { $t::new(self.$comp0 / *other $(, self.$compN / *other )*) } #[inline] - pub fn scalar_div_inplace(&mut self, other: &N) { + fn scalar_div_inplace(&mut self, other: &N) { self.$comp0 = self.$comp0 / *other; $(self.$compN = self.$compN / *other; )* } @@ -85,12 +85,12 @@ macro_rules! scalar_add_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> ScalarAdd for $t { #[inline] - pub fn scalar_add(&self, other: &N) -> $t { + fn scalar_add(&self, other: &N) -> $t { $t::new(self.$comp0 + *other $(, self.$compN + *other )*) } #[inline] - pub fn scalar_add_inplace(&mut self, other: &N) { + fn scalar_add_inplace(&mut self, other: &N) { self.$comp0 = self.$comp0 + *other; $(self.$compN = self.$compN + *other; )* } @@ -102,12 +102,12 @@ macro_rules! scalar_sub_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl> ScalarSub for $t { #[inline] - pub fn scalar_sub(&self, other: &N) -> $t { + fn scalar_sub(&self, other: &N) -> $t { $t::new(self.$comp0 - *other $(, self.$compN - *other )*) } #[inline] - pub fn scalar_sub_inplace(&mut self, other: &N) { + fn scalar_sub_inplace(&mut self, other: &N) { self.$comp0 = self.$comp0 - *other; $(self.$compN = self.$compN - *other; )* } @@ -168,21 +168,21 @@ macro_rules! indexable_impl( ($t: ident, $dim: expr) => ( impl Indexable<(uint, uint), N> for $t { #[inline] - pub fn at(&self, (i, j): (uint, uint)) -> N { + fn at(&self, (i, j): (uint, uint)) -> N { unsafe { cast::transmute::<&$t, &[N, ..$dim * $dim]>(self)[i * $dim + j].clone() } } #[inline] - pub fn set(&mut self, (i, j): (uint, uint), val: N) { + fn set(&mut self, (i, j): (uint, uint), val: N) { unsafe { cast::transmute::<&mut $t, &mut [N, ..$dim * $dim]>(self)[i * $dim + j] = val } } #[inline] - pub fn swap(&mut self, (i1, j1): (uint, uint), (i2, j2): (uint, uint)) { + fn swap(&mut self, (i1, j1): (uint, uint), (i2, j2): (uint, uint)) { unsafe { cast::transmute::<&mut $t, &mut [N, ..$dim * $dim]>(self) .swap(i1 * $dim + j1, i2 * $dim + j2) diff --git a/src/traits/sample.rs b/src/traits/sample.rs index 8cad2871..06ff677c 100644 --- a/src/traits/sample.rs +++ b/src/traits/sample.rs @@ -2,10 +2,10 @@ /// approximate a sphere using support mapping functions. pub trait UniformSphereSample { /// Iterate throught the samples. - pub fn sample(&fn(&'static Self)); + fn sample(&fn(&'static Self)); /// Gets the list of all samples. - pub fn sample_list() -> ~[&'static Self] { + fn sample_list() -> ~[&'static Self] { let mut res = ~[]; do UniformSphereSample::sample:: |s| { diff --git a/src/vec0_spec.rs b/src/vec0_spec.rs index f707c2b0..00e0bfd6 100644 --- a/src/vec0_spec.rs +++ b/src/vec0_spec.rs @@ -26,17 +26,17 @@ impl vec::Vec0 { impl Indexable for vec::Vec0 { #[inline] - pub fn at(&self, _: uint) -> N { + fn at(&self, _: uint) -> N { fail!("Cannot index a Vec0.") } #[inline] - pub fn set(&mut self, _: uint, _: N) { + fn set(&mut self, _: uint, _: N) { } #[inline] - pub fn swap(&mut self, _: uint, _: uint) { + fn swap(&mut self, _: uint, _: uint) { } } @@ -72,10 +72,10 @@ impl Dim for vec::Vec0 { impl> Basis for vec::Vec0 { #[inline(always)] - pub fn canonical_basis(_: &fn(vec::Vec0)) { } + fn canonical_basis(_: &fn(vec::Vec0)) { } #[inline(always)] - pub fn orthonormal_subspace_basis(&self, _: &fn(vec::Vec0)) { } + fn orthonormal_subspace_basis(&self, _: &fn(vec::Vec0)) { } } impl> Add, vec::Vec0> for vec::Vec0 { diff --git a/src/vec_macros.rs b/src/vec_macros.rs index e28bb7ae..c602fa7e 100644 --- a/src/vec_macros.rs +++ b/src/vec_macros.rs @@ -95,7 +95,7 @@ macro_rules! vec_cast_impl( ($t: ident, $comp0: ident $(,$compN: ident)*) => ( impl VecCast<$t> for $t { #[inline] - pub fn from(v: $t) -> $t { + fn from(v: $t) -> $t { $t::new(NumCast::from(v.$comp0.clone()) $(, NumCast::from(v.$compN.clone()))*) } } @@ -106,21 +106,21 @@ macro_rules! indexable_impl( ($t: ident, $dim: expr) => ( impl Indexable for $t { #[inline] - pub fn at(&self, i: uint) -> N { + fn at(&self, i: uint) -> N { unsafe { cast::transmute::<&$t, &[N, ..$dim]>(self)[i].clone() } } #[inline] - pub fn set(&mut self, i: uint, val: N) { + fn set(&mut self, i: uint, val: N) { unsafe { cast::transmute::<&mut $t, &mut [N, ..$dim]>(self)[i] = val } } #[inline] - pub fn swap(&mut self, i1: uint, i2: uint) { + fn swap(&mut self, i1: uint, i2: uint) { unsafe { cast::transmute::<&mut $t, &mut [N, ..$dim]>(self).swap(i1, i2) } @@ -185,7 +185,7 @@ macro_rules! basis_impl( ($t: ident, $dim: expr) => ( impl> Basis for $t { #[inline] - pub fn canonical_basis(f: &fn($t)) { + fn canonical_basis(f: &fn($t)) { for i in range(0u, $dim) { let mut basis_element : $t = Zero::zero(); @@ -196,7 +196,7 @@ macro_rules! basis_impl( } #[inline] - pub fn orthonormal_subspace_basis(&self, f: &fn($t)) { + fn orthonormal_subspace_basis(&self, f: &fn($t)) { // compute the basis of the orthogonal subspace using Gram-Schmidt // orthogonalization algorithm let mut basis: ~[$t] = ~[]; diff --git a/src/vec_spec.rs b/src/vec_spec.rs index ce01ccd8..a466a579 100644 --- a/src/vec_spec.rs +++ b/src/vec_spec.rs @@ -144,16 +144,16 @@ static SAMPLES_3_F64: [Vec3, ..42] = [ impl UniformSphereSample for Vec2 { #[inline(always)] - pub fn sample(f: &fn(&'static Vec2)) { - for sample in SAMPLES_2_F64.iter() { - f(sample) - } - } + fn sample(f: &fn(&'static Vec2)) { + for sample in SAMPLES_2_F64.iter() { + f(sample) + } + } } impl UniformSphereSample for Vec3 { #[inline(always)] - pub fn sample(f: &fn(&'static Vec3)) { + fn sample(f: &fn(&'static Vec3)) { for sample in SAMPLES_3_F64.iter() { f(sample) }