Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000)

This commit is contained in:
Keegan McAllister 2014-09-16 13:00:18 -07:00
parent 8a7eefefd5
commit a640a7c5c3
74 changed files with 459 additions and 449 deletions

View file

@ -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);

View file

@ -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"); }

View file

@ -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);

View file

@ -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)
}