Update to the last Rust.

This renames lib.rs to nalgebra.rs so that the generated *.so has the right name.
This commit is contained in:
Sébastien Crozet 2013-12-11 16:30:50 +01:00
parent 1e71dc1d0a
commit f83ddde824
3 changed files with 6 additions and 6 deletions

View File

@ -3,20 +3,20 @@ nalgebra_lib_path=lib
nalgebra_doc_path=doc nalgebra_doc_path=doc
all: all:
mkdir -p $(nalgebra_lib_path) mkdir -p $(nalgebra_lib_path)
rustc src/lib.rs --out-dir $(nalgebra_lib_path) --opt-level 3 rustc src/nalgebra.rs --out-dir $(nalgebra_lib_path) --opt-level 3
test: test:
mkdir -p $(nalgebra_lib_path) mkdir -p $(nalgebra_lib_path)
rustc --test src/lib.rs --opt-level 3 -o test~ && ./test~ rustc --test src/nalgebra.rs --opt-level 3 -o test~ && ./test~
rm test~ rm test~
bench: bench:
rustc --test src/lib.rs --opt-level 3 -o bench~ && ./bench~ --bench rustc --test src/nalgebra.rs --opt-level 3 -o bench~ && ./bench~ --bench
rm bench~ rm bench~
doc: doc:
mkdir -p $(nalgebra_doc_path) mkdir -p $(nalgebra_doc_path)
rustdoc src/lib.rs rustdoc src/nalgebra.rs
distcheck: distcheck:
rm -rf $(tmp) rm -rf $(tmp)

View File

@ -18,13 +18,13 @@ macro_rules! at_fast_impl(
($t: ident, $dim: expr) => ( ($t: ident, $dim: expr) => (
impl<N: Clone> $t<N> { impl<N: Clone> $t<N> {
#[inline] #[inline]
unsafe fn at_fast(&self, (i, j): (uint, uint)) -> N { pub unsafe fn at_fast(&self, (i, j): (uint, uint)) -> N {
(*cast::transmute::<&$t<N>, &[N, ..$dim * $dim]>(self) (*cast::transmute::<&$t<N>, &[N, ..$dim * $dim]>(self)
.unsafe_ref(i + j * $dim)).clone() .unsafe_ref(i + j * $dim)).clone()
} }
#[inline] #[inline]
unsafe fn set_fast(&mut self, (i, j): (uint, uint), val: N) { pub unsafe fn set_fast(&mut self, (i, j): (uint, uint), val: N) {
(*cast::transmute::<&mut $t<N>, &mut [N, ..$dim * $dim]>(self) (*cast::transmute::<&mut $t<N>, &mut [N, ..$dim * $dim]>(self)
.unsafe_mut_ref(i + j * $dim)) = val .unsafe_mut_ref(i + j * $dim)) = val
} }