Fixed vector syntax errors and reordered crate compilation

This commit is contained in:
Margaret Meyerhofer 2012-06-29 11:38:15 -07:00
parent 7d06862ee1
commit e4edb86df9
4 changed files with 10 additions and 9 deletions

View file

@ -31,7 +31,8 @@ SERVO_DEPS = \
$(NULL) $(NULL)
CHECK_DEPS = CHECK_DEPS =
CLEAN_DEPS = CLEAN_DEPS =
AZURE_DEPS = AZURE_DEPS = \
src/rust-geom/libgeom.dummy
ifeq ($(OSTYPE),darwin) ifeq ($(OSTYPE),darwin)
SERVO_DEPS += src/rust-cocoa/libcocoa.dummy SERVO_DEPS += src/rust-cocoa/libcocoa.dummy

@ -1 +1 @@
Subproject commit 577df7b9e475562c38405eef60cda5e38a0840b6 Subproject commit da98863da36697eadafea8a6544f0f4107534579

View file

@ -28,7 +28,7 @@ A font handle. Layout can use this to calculate glyph metrics
and the renderer can use it to render text. and the renderer can use it to render text.
"] "]
class Font { class Font {
let fontbuf: @[u8]; let fontbuf: @~[u8];
let cairo_font: *cairo_scaled_font_t; let cairo_font: *cairo_scaled_font_t;
let font_dtor: fn@(); let font_dtor: fn@();
@ -41,7 +41,7 @@ class Font {
self.font_dtor = font_dtor; self.font_dtor = font_dtor;
} }
fn buf() -> @[u8] { fn buf() -> @~[u8] {
self.fontbuf self.fontbuf
} }
@ -122,7 +122,7 @@ class Font {
} }
} }
fn get_cairo_font(buf: &[u8]) -> (*cairo_scaled_font_t, fn@()) { fn get_cairo_font(buf: &~[u8]) -> (*cairo_scaled_font_t, fn@()) {
import libc::c_double; import libc::c_double;
import azure::cairo; import azure::cairo;
@ -170,7 +170,7 @@ fn get_cairo_font(buf: &[u8]) -> (*cairo_scaled_font_t, fn@()) {
} }
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn get_cairo_face(buf: &[u8]) -> (*cairo_font_face_t, fn@()) { fn get_cairo_face(buf: &~[u8]) -> (*cairo_font_face_t, fn@()) {
import freetype = azure::freetype; import freetype = azure::freetype;
import freetype::{ FT_Error, FT_Library, FT_Face, FT_Long }; import freetype::{ FT_Error, FT_Library, FT_Face, FT_Long };
import freetype::bindgen::{ import freetype::bindgen::{
@ -307,7 +307,7 @@ fn get_cairo_face_should_fail_and_not_leak_if_font_cant_be_created() {
#[test]; #[test];
#[should_fail]; #[should_fail];
get_cairo_face(&[0u8, 1u8, 2u8, 3u8]); get_cairo_face(&~[0u8, 1u8, 2u8, 3u8]);
} }
fn get_cairo_face_should_return_a_new_face_and_dtor() { fn get_cairo_face_should_return_a_new_face_and_dtor() {

View file

@ -65,7 +65,7 @@ class FreeTypeNativeFont/& {
} }
} }
fn create(lib: FT_Library, buf: &[u8]) -> result<FreeTypeNativeFont, ()> { fn create(lib: FT_Library, buf: &~[u8]) -> result<FreeTypeNativeFont, ()> {
assert lib.is_not_null(); assert lib.is_not_null();
let face: FT_Face = null(); let face: FT_Face = null();
ret vec_as_buf(*buf) {|cbuf| ret vec_as_buf(*buf) {|cbuf|
@ -106,7 +106,7 @@ fn with_lib(f: fn@(FT_Library)) {
#[test] #[test]
fn create_should_return_err_if_buf_is_bogus() { fn create_should_return_err_if_buf_is_bogus() {
with_lib { |lib| with_lib { |lib|
let buf = &[]; let buf = &~[];
assert create(lib, buf).is_err(); assert create(lib, buf).is_err();
} }
} }