mirror of
https://github.com/servo/servo.git
synced 2025-08-12 17:05:33 +01:00
Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)
This commit is contained in:
parent
8a7eefefd5
commit
a640a7c5c3
74 changed files with 459 additions and 449 deletions
|
@ -3,7 +3,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use azure::AzFloat;
|
||||
use AzColor = azure::azure_hl::Color;
|
||||
use azure::azure_hl::Color as AzColor;
|
||||
|
||||
pub type Color = AzColor;
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ impl ScaledFontExtensionMethods for ScaledFont {
|
|||
&mut glyphbuf,
|
||||
azure_pattern,
|
||||
&mut options,
|
||||
ptr::mut_null());
|
||||
ptr::null_mut());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,11 +22,11 @@ extern crate stb_image;
|
|||
extern crate png;
|
||||
extern crate serialize;
|
||||
#[phase(plugin)]
|
||||
extern crate servo_macros = "macros";
|
||||
extern crate servo_net = "net";
|
||||
extern crate "macros" as servo_macros;
|
||||
extern crate "net" as servo_net;
|
||||
#[phase(plugin, link)]
|
||||
extern crate servo_util = "util";
|
||||
extern crate servo_msg = "msg";
|
||||
extern crate "util" as servo_util;
|
||||
extern crate "msg" as servo_msg;
|
||||
extern crate style;
|
||||
extern crate sync;
|
||||
extern crate url;
|
||||
|
|
|
@ -96,7 +96,7 @@ impl FontHandleMethods for FontHandle {
|
|||
fn create_face_from_buffer(lib: FT_Library, cbuf: *const u8, cbuflen: uint, pt_size: Option<f64>)
|
||||
-> Result<FT_Face, ()> {
|
||||
unsafe {
|
||||
let mut face: FT_Face = ptr::mut_null();
|
||||
let mut face: FT_Face = ptr::null_mut();
|
||||
let face_index = 0 as FT_Long;
|
||||
let result = FT_New_Memory_Face(lib, cbuf, cbuflen as FT_Long,
|
||||
face_index, &mut face);
|
||||
|
|
|
@ -61,13 +61,13 @@ impl FontContextHandle {
|
|||
let ptr = libc::malloc(mem::size_of::<struct_FT_MemoryRec_>() as size_t);
|
||||
let allocator: &mut struct_FT_MemoryRec_ = mem::transmute(ptr);
|
||||
ptr::write(allocator, struct_FT_MemoryRec_ {
|
||||
user: ptr::mut_null(),
|
||||
user: ptr::null_mut(),
|
||||
alloc: ft_alloc,
|
||||
free: ft_free,
|
||||
realloc: ft_realloc,
|
||||
});
|
||||
|
||||
let mut ctx: FT_Library = ptr::mut_null();
|
||||
let mut ctx: FT_Library = ptr::null_mut();
|
||||
|
||||
let result = FT_New_Library(ptr as FT_Memory, &mut ctx);
|
||||
if !result.succeeded() { fail!("Unable to initialize FreeType library"); }
|
||||
|
|
|
@ -35,7 +35,7 @@ pub fn get_available_families(callback: |String|) {
|
|||
let fontSet = FcConfigGetFonts(config, FcSetSystem);
|
||||
for i in range(0, (*fontSet).nfont as int) {
|
||||
let font = (*fontSet).fonts.offset(i);
|
||||
let mut family: *mut FcChar8 = ptr::mut_null();
|
||||
let mut family: *mut FcChar8 = ptr::null_mut();
|
||||
let mut v: c_int = 0;
|
||||
while FcPatternGetString(*font, FC_FAMILY.as_ptr() as *mut i8, v, &mut family) == FcResultMatch {
|
||||
let family_name = string::raw::from_buf(family as *const i8 as *const u8);
|
||||
|
@ -71,7 +71,7 @@ pub fn get_variations_for_family(family_name: &str, callback: |String|) {
|
|||
|
||||
for i in range(0, (*matches).nfont as int) {
|
||||
let font = (*matches).fonts.offset(i);
|
||||
let mut file: *mut FcChar8 = ptr::mut_null();
|
||||
let mut file: *mut FcChar8 = ptr::null_mut();
|
||||
let file = if FcPatternGetString(*font, FC_FILE.as_ptr() as *mut i8, 0, &mut file) == FcResultMatch {
|
||||
string::raw::from_buf(file as *const i8 as *const u8)
|
||||
} else {
|
||||
|
@ -103,14 +103,14 @@ pub fn get_system_default_family(generic_name: &str) -> Option<String> {
|
|||
unsafe {
|
||||
let pattern = FcNameParse(generic_name_ptr as *mut FcChar8);
|
||||
|
||||
FcConfigSubstitute(ptr::mut_null(), pattern, FcMatchPattern);
|
||||
FcConfigSubstitute(ptr::null_mut(), pattern, FcMatchPattern);
|
||||
FcDefaultSubstitute(pattern);
|
||||
|
||||
let mut result = 0;
|
||||
let family_match = FcFontMatch(ptr::mut_null(), pattern, &mut result);
|
||||
let family_match = FcFontMatch(ptr::null_mut(), pattern, &mut result);
|
||||
|
||||
let family_name = if result == FcResultMatch {
|
||||
let mut match_string: *mut FcChar8 = ptr::mut_null();
|
||||
let mut match_string: *mut FcChar8 = ptr::null_mut();
|
||||
FcPatternGetString(family_match, FC_FAMILY.as_ptr() as *mut i8, 0, &mut match_string);
|
||||
let result = string::raw::from_buf(match_string as *const i8 as *const u8);
|
||||
FcPatternDestroy(family_match);
|
||||
|
|
|
@ -138,7 +138,7 @@ impl FontHandleMethods for FontHandle {
|
|||
let glyphs = [glyph as CGGlyph];
|
||||
let advance = self.ctfont.get_advances_for_glyphs(kCTFontDefaultOrientation,
|
||||
&glyphs[0],
|
||||
ptr::mut_null(),
|
||||
ptr::null_mut(),
|
||||
1);
|
||||
Some(advance as FractionalPixel)
|
||||
}
|
||||
|
|
|
@ -175,9 +175,9 @@ impl Shaper {
|
|||
// configure static function callbacks.
|
||||
// NB. This funcs structure could be reused globally, as it never changes.
|
||||
let hb_funcs: *mut hb_font_funcs_t = hb_font_funcs_create();
|
||||
hb_font_funcs_set_glyph_func(hb_funcs, glyph_func, ptr::mut_null(), None);
|
||||
hb_font_funcs_set_glyph_h_advance_func(hb_funcs, glyph_h_advance_func, ptr::mut_null(), None);
|
||||
hb_font_funcs_set_glyph_h_kerning_func(hb_funcs, glyph_h_kerning_func, ptr::mut_null(), ptr::mut_null());
|
||||
hb_font_funcs_set_glyph_func(hb_funcs, glyph_func, ptr::null_mut(), None);
|
||||
hb_font_funcs_set_glyph_h_advance_func(hb_funcs, glyph_h_advance_func, ptr::null_mut(), None);
|
||||
hb_font_funcs_set_glyph_h_kerning_func(hb_funcs, glyph_h_kerning_func, ptr::null_mut(), ptr::null_mut());
|
||||
hb_font_set_funcs(hb_font, hb_funcs, font_ptr as *mut c_void, None);
|
||||
|
||||
Shaper {
|
||||
|
@ -211,7 +211,7 @@ impl ShaperMethods for Shaper {
|
|||
0,
|
||||
text.len() as c_int);
|
||||
|
||||
hb_shape(self.hb_font, hb_buffer, ptr::mut_null(), 0);
|
||||
hb_shape(self.hb_font, hb_buffer, ptr::null_mut(), 0);
|
||||
self.save_glyph_results(text, glyphs, hb_buffer);
|
||||
hb_buffer_destroy(hb_buffer);
|
||||
}
|
||||
|
@ -511,11 +511,11 @@ extern fn get_font_table_func(_: *mut hb_face_t, tag: hb_tag_t, user_data: *mut
|
|||
|
||||
// TODO(Issue #197): reuse font table data, which will change the unsound trickery here.
|
||||
match (*font).get_table_for_tag(tag as FontTableTag) {
|
||||
None => ptr::mut_null(),
|
||||
None => ptr::null_mut(),
|
||||
Some(ref font_table) => {
|
||||
let skinny_font_table_ptr: *const FontTable = font_table; // private context
|
||||
|
||||
let mut blob: *mut hb_blob_t = ptr::mut_null();
|
||||
let mut blob: *mut hb_blob_t = ptr::null_mut();
|
||||
(*skinny_font_table_ptr).with_buffer(|buf: *const u8, len: uint| {
|
||||
// HarfBuzz calls `destroy_blob_func` when the buffer is no longer needed.
|
||||
blob = hb_blob_create(buf as *const c_char,
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
use text::glyph::GlyphStore;
|
||||
|
||||
pub use Shaper = text::shaping::harfbuzz::Shaper;
|
||||
pub use text::shaping::harfbuzz::Shaper;
|
||||
|
||||
pub mod harfbuzz;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue