From 841a6bf6475107bcf5ce39a8fd9e90de3965dce1 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Tue, 10 Jun 2014 05:10:08 -0400 Subject: [PATCH] Update submodules and ~str/String, to_owned/to_string, & cast/mem to get android building. --- Makefile.in | 2 +- src/components/gfx/platform/android/font.rs | 18 +++++++++--------- .../gfx/platform/android/font_context.rs | 4 ++-- .../gfx/platform/android/font_list.rs | 6 +++--- .../main/platform/common/glut_windowing.rs | 4 ++-- src/components/main/servo.rs | 2 +- src/components/msg/platform/android/surface.rs | 4 ++-- src/support/alert/rust-alert | 2 +- src/support/egl/rust-egl | 2 +- src/support/glut/rust-glut | 2 +- src/support/layers/rust-layers | 2 +- src/test/harness/reftest/reftest.rs | 2 +- 12 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Makefile.in b/Makefile.in index 41042f63c92..e9ea6748d04 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,7 +111,7 @@ rust: $(CFG_RUSTC) # These arguments are automatically provided by the Rust compiler's build process to # itself, so they must be specified later for our Rust modules. ifeq ($(CFG_OSTYPE),linux-androideabi) - CFG_RUSTC_FLAGS += --target arm-linux-androideabi -C android-cross-path=$(CFG_ANDROID_CROSS_PATH) + CFG_RUSTC_FLAGS += --target arm-linux-androideabi -C linker=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++ -C ar=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar endif # Strip off submodule paths to determine "raw" submodule names. diff --git a/src/components/gfx/platform/android/font.rs b/src/components/gfx/platform/android/font.rs index 4c5f5245384..e0dd18d8b55 100644 --- a/src/components/gfx/platform/android/font.rs +++ b/src/components/gfx/platform/android/font.rs @@ -24,7 +24,7 @@ use freetype::freetype::{FT_SizeRec, FT_UInt, FT_Size_Metrics}; use freetype::freetype::{ft_sfnt_os2}; use freetype::tt_os2::TT_OS2; -use std::cast; +use std::mem; use std::ptr; use std::str; @@ -48,7 +48,7 @@ impl FontTableMethods for FontTable { enum FontSource { FontSourceMem(Vec), - FontSourceFile(~str) + FontSourceFile(String) } pub struct FontHandle { @@ -117,15 +117,15 @@ impl FontHandleMethods for FontHandle { } // an identifier usable by FontContextHandle to recreate this FontHandle. - fn face_identifier(&self) -> ~str { + fn face_identifier(&self) -> String { /* FT_Get_Postscript_Name seems like a better choice here, but it doesn't give usable results for fontconfig when deserializing. */ unsafe { str::raw::from_c_str((*self.face).family_name) } } - fn family_name(&self) -> ~str { + fn family_name(&self) -> String { unsafe { str::raw::from_c_str((*self.face).family_name) } } - fn face_name(&self) -> ~str { + fn face_name(&self) -> String { unsafe { str::raw::from_c_str(FT_Get_Postscript_Name(self.face)) } } fn is_italic(&self) -> bool { @@ -168,7 +168,7 @@ impl FontHandleMethods for FontHandle { FontHandleMethods::new_from_buffer(fctx, buf.clone(), style) } FontSourceFile(ref file) => { - FontHandle::new_from_file(fctx, (*file).clone(), style) + FontHandle::new_from_file(fctx, file.as_slice(), style) } } } @@ -194,7 +194,7 @@ impl FontHandleMethods for FontHandle { let res = FT_Load_Glyph(self.face, glyph as FT_UInt, 0); if res.succeeded() { let void_glyph = (*self.face).glyph; - let slot: FT_GlyphSlot = cast::transmute(void_glyph); + let slot: FT_GlyphSlot = mem::transmute(void_glyph); assert!(slot.is_not_null()); debug!("metrics: {:?}", (*slot).metrics); let advance = (*slot).metrics.horiAdvance; @@ -303,7 +303,7 @@ impl<'a> FontHandle { } } - pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: ~str) + pub fn new_from_file_unstyled(fctx: &FontContextHandle, file: String) -> Result { unsafe { let ft_ctx: FT_Library = fctx.ctx.ctx; @@ -338,7 +338,7 @@ impl<'a> FontHandle { // face.size is a *c_void in the bindings, presumably to avoid // recursive structural types - let size: &FT_SizeRec = unsafe { cast::transmute(&(*face.size)) }; + let size: &FT_SizeRec = unsafe { mem::transmute(&(*face.size)) }; let metrics: &FT_Size_Metrics = &(*size).metrics; let em_size = face.units_per_EM as f64; diff --git a/src/components/gfx/platform/android/font_context.rs b/src/components/gfx/platform/android/font_context.rs index af65a30aa22..cea1cbf5cb0 100644 --- a/src/components/gfx/platform/android/font_context.rs +++ b/src/components/gfx/platform/android/font_context.rs @@ -44,12 +44,12 @@ impl FontContextHandle { } impl FontContextHandleMethods for FontContextHandle { - fn create_font_from_identifier(&self, name: ~str, style: UsedFontStyle) + fn create_font_from_identifier(&self, name: String, style: UsedFontStyle) -> Result { debug!("Creating font handle for {:s}", name); path_from_identifier(name, &style).and_then(|file_name| { debug!("Opening font face {:s}", file_name); - FontHandle::new_from_file(self, file_name.to_string(), &style) + FontHandle::new_from_file(self, file_name.as_slice(), &style) }) } } diff --git a/src/components/gfx/platform/android/font_list.rs b/src/components/gfx/platform/android/font_list.rs index 52a173d45bd..150646c9840 100644 --- a/src/components/gfx/platform/android/font_list.rs +++ b/src/components/gfx/platform/android/font_list.rs @@ -53,7 +53,7 @@ impl FontListHandle { while FcPatternGetString(*font, FC_FAMILY, v, &family) == FcResultMatch { let family_name = str::raw::from_c_str(family as *c_char); debug!("Creating new FontFamily for family: {:s}", family_name); - let new_family = FontFamily::new(family_name); + let new_family = FontFamily::new(family_name.as_slice()); family_map.insert(family_name, new_family); v += 1; } @@ -129,7 +129,7 @@ impl FontListHandle { } } - pub fn get_last_resort_font_families() -> Vec<~str> { + pub fn get_last_resort_font_families() -> Vec { vec!("Roboto".to_string()) } } @@ -146,7 +146,7 @@ impl Drop for AutoPattern { } } -pub fn path_from_identifier(name: ~str, style: &UsedFontStyle) -> Result<~str, ()> { +pub fn path_from_identifier(name: String, style: &UsedFontStyle) -> Result { unsafe { let config = FcConfigGetCurrent(); let wrapper = AutoPattern { pattern: FcPatternCreate() }; diff --git a/src/components/main/platform/common/glut_windowing.rs b/src/components/main/platform/common/glut_windowing.rs index 4d6a88c9bc2..a38521207e4 100644 --- a/src/components/main/platform/common/glut_windowing.rs +++ b/src/components/main/platform/common/glut_windowing.rs @@ -98,7 +98,7 @@ impl WindowMethods for Window { impl glut::ReshapeCallback for ReshapeCallbackState { fn call(&self, width: c_int, height: c_int) { let tmp = local_window(); - tmp.event_queue.borrow_mut().push(ResizeWindowEvent(width as uint, height as uint)) + tmp.event_queue.borrow_mut().push(ResizeWindowEvent(TypedSize2D(width as uint, height as uint))) } } glut::reshape_func(glut_window, box ReshapeCallbackState); @@ -279,7 +279,7 @@ impl Window { alert.add_prompt(); alert.run(); let value = alert.prompt_value(); - if "" == value { // To avoid crashing on Linux. + if "" == value.as_slice() { // To avoid crashing on Linux. self.event_queue.borrow_mut().push(LoadUrlWindowEvent("http://purple.com/".to_string())) } else { self.event_queue.borrow_mut().push(LoadUrlWindowEvent(value.clone())) diff --git a/src/components/main/servo.rs b/src/components/main/servo.rs index 543244de0ba..c7a2a6150b7 100644 --- a/src/components/main/servo.rs +++ b/src/components/main/servo.rs @@ -142,7 +142,7 @@ fn start(argc: int, argv: **u8) -> int { #[allow(dead_code)] pub extern "C" fn android_start(argc: int, argv: **u8) -> int { native::start(argc, argv, proc() { - let mut args: Vec<~str> = vec!(); + let mut args: Vec = vec!(); for i in range(0u, argc as uint) { unsafe { args.push(str::raw::from_c_str(*argv.offset(i as int) as *i8)); diff --git a/src/components/msg/platform/android/surface.rs b/src/components/msg/platform/android/surface.rs index 04719ffdc39..6f2e962d804 100644 --- a/src/components/msg/platform/android/surface.rs +++ b/src/components/msg/platform/android/surface.rs @@ -8,12 +8,12 @@ use platform::surface::NativeSurfaceAzureMethods; use azure::AzSkiaGrGLSharedSurfaceRef; use layers::platform::surface::NativeSurface; -use std::cast; +use std::mem; impl NativeSurfaceAzureMethods for NativeSurface { fn from_azure_surface(surface: AzSkiaGrGLSharedSurfaceRef) -> NativeSurface { unsafe { - NativeSurface::from_image_khr(cast::transmute(surface)) + NativeSurface::from_image_khr(mem::transmute(surface)) } } } diff --git a/src/support/alert/rust-alert b/src/support/alert/rust-alert index 6b86f1f01ec..b9f00f05f93 160000 --- a/src/support/alert/rust-alert +++ b/src/support/alert/rust-alert @@ -1 +1 @@ -Subproject commit 6b86f1f01ecb4623942369d25e0dd941adb091de +Subproject commit b9f00f05f931b445c22df85d94d4afd24e225e55 diff --git a/src/support/egl/rust-egl b/src/support/egl/rust-egl index 89b30aee451..0da3a639409 160000 --- a/src/support/egl/rust-egl +++ b/src/support/egl/rust-egl @@ -1 +1 @@ -Subproject commit 89b30aee451af87579b2d3f0c46ed739cc4dcc19 +Subproject commit 0da3a63940928060d0d76ed40206ebc06e7094cc diff --git a/src/support/glut/rust-glut b/src/support/glut/rust-glut index 4257b7b8400..9f77014d418 160000 --- a/src/support/glut/rust-glut +++ b/src/support/glut/rust-glut @@ -1 +1 @@ -Subproject commit 4257b7b8400a09a5e5de2bb16a4621776a62328a +Subproject commit 9f77014d418e8a4b228ef796149ccc759f79065d diff --git a/src/support/layers/rust-layers b/src/support/layers/rust-layers index 2fd4c58480e..5004481eb0b 160000 --- a/src/support/layers/rust-layers +++ b/src/support/layers/rust-layers @@ -1 +1 @@ -Subproject commit 2fd4c58480e7c8aa8000a3cbe5d935c59b94eaef +Subproject commit 5004481eb0b5fdbb24d2ca56fd47767be7690057 diff --git a/src/test/harness/reftest/reftest.rs b/src/test/harness/reftest/reftest.rs index 255b2b55672..34da93d3731 100644 --- a/src/test/harness/reftest/reftest.rs +++ b/src/test/harness/reftest/reftest.rs @@ -133,7 +133,7 @@ fn make_test(reftest: Reftest) -> TestDescAndFn { fn capture(reftest: &Reftest, side: uint) -> png::Image { let filename = format!("/tmp/servo-reftest-{:06u}-{:u}.png", reftest.id, side); let mut args = reftest.servo_args.clone(); - args.push_all_move(vec!("-f".to_owned(), "-o".to_owned(), filename.clone(), reftest.files[side].clone())); + args.push_all_move(vec!("-f".to_string(), "-o".to_string(), filename.clone(), reftest.files[side].clone())); let retval = match Command::new("./servo").args(args.as_slice()).status() { Ok(status) => status,