mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
auto merge of #4575 : mttr/servo/warnings, r=jdm
Notes: * This adds `#![allow(missing_copy_implementations)]` to components/*/lib.rs. I'm not sure how to approach the missing Copy warnings (are there things for which Copy should NOT be implemented, and how can I tell?) so I stuck this in to make life easier when looking through the warnings. I can easily remove this if necessary. * This leaves the following type of warnings, which I couldn't figure out how to approach (I'll investigate it later if no one else wants to). ``` css/matching.rs:72:23: 72:35 warning: use of deprecated item: Use overloaded core::cmp::PartialEq, #[warn(deprecated)] on by default css/matching.rs:72 this_as_query.equiv(other) ^~~~~~~~~~~~ css/matching.rs:95:10: 95:49 warning: use of deprecated item: Use overloaded core::cmp::PartialEq, #[warn(deprecated)] on by default css/matching.rs:95 impl<'a> Equiv<ApplicableDeclarationsCacheEntry> for ApplicableDeclarationsCacheQuery<'a> { ```
This commit is contained in:
commit
0793137631
36 changed files with 88 additions and 74 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
#![deny(unused_imports)]
|
||||
#![deny(unused_variables)]
|
||||
#![allow(missing_copy_implementations)]
|
||||
|
||||
#![feature(phase)]
|
||||
#[phase(plugin, link)]
|
||||
|
|
|
@ -29,6 +29,7 @@ use servo_util::geometry::{Au, MAX_RECT};
|
|||
use servo_util::opts;
|
||||
use servo_util::range::Range;
|
||||
use std::default::Default;
|
||||
use std::f32;
|
||||
use std::mem;
|
||||
use std::num::{Float, FloatMath};
|
||||
use std::ptr;
|
||||
|
@ -383,13 +384,13 @@ impl<'a> PaintContext<'a> {
|
|||
let box_BR = box_TL + Point2D(bounds.size.width, bounds.size.height);
|
||||
|
||||
let rad_R: AzFloat = 0.;
|
||||
let rad_BR = rad_R + Float::frac_pi_4();
|
||||
let rad_B = rad_BR + Float::frac_pi_4();
|
||||
let rad_BL = rad_B + Float::frac_pi_4();
|
||||
let rad_L = rad_BL + Float::frac_pi_4();
|
||||
let rad_TL = rad_L + Float::frac_pi_4();
|
||||
let rad_T = rad_TL + Float::frac_pi_4();
|
||||
let rad_TR = rad_T + Float::frac_pi_4();
|
||||
let rad_BR = rad_R + f32::consts::FRAC_PI_4;
|
||||
let rad_B = rad_BR + f32::consts::FRAC_PI_4;
|
||||
let rad_BL = rad_B + f32::consts::FRAC_PI_4;
|
||||
let rad_L = rad_BL + f32::consts::FRAC_PI_4;
|
||||
let rad_TL = rad_L + f32::consts::FRAC_PI_4;
|
||||
let rad_T = rad_TL + f32::consts::FRAC_PI_4;
|
||||
let rad_TR = rad_T + f32::consts::FRAC_PI_4;
|
||||
|
||||
fn dx(x: AzFloat) -> Point2D<AzFloat> {
|
||||
Point2D(x, 0.)
|
||||
|
@ -572,29 +573,29 @@ impl<'a> PaintContext<'a> {
|
|||
path_builder.arc(Point2D(bounds.max_x() - radii.top_right,
|
||||
bounds.origin.y + radii.top_right),
|
||||
radii.top_right,
|
||||
1.5f32 * Float::frac_pi_2(),
|
||||
Float::two_pi(),
|
||||
1.5f32 * f32::consts::FRAC_PI_2,
|
||||
f32::consts::PI_2,
|
||||
false); // 3
|
||||
path_builder.line_to(Point2D(bounds.max_x(), bounds.max_y() - radii.bottom_right)); // 4
|
||||
path_builder.arc(Point2D(bounds.max_x() - radii.bottom_right,
|
||||
bounds.max_y() - radii.bottom_right),
|
||||
radii.bottom_right,
|
||||
0.0,
|
||||
Float::frac_pi_2(),
|
||||
f32::consts::FRAC_PI_2,
|
||||
false); // 5
|
||||
path_builder.line_to(Point2D(bounds.origin.x + radii.bottom_left, bounds.max_y())); // 6
|
||||
path_builder.arc(Point2D(bounds.origin.x + radii.bottom_left,
|
||||
bounds.max_y() - radii.bottom_left),
|
||||
radii.bottom_left,
|
||||
Float::frac_pi_2(),
|
||||
Float::pi(),
|
||||
f32::consts::FRAC_PI_2,
|
||||
f32::consts::PI,
|
||||
false); // 7
|
||||
path_builder.line_to(Point2D(bounds.origin.x, bounds.origin.y + radii.top_left)); // 8
|
||||
path_builder.arc(Point2D(bounds.origin.x + radii.top_left,
|
||||
bounds.origin.y + radii.top_left),
|
||||
radii.top_left,
|
||||
Float::pi(),
|
||||
1.5f32 * Float::frac_pi_2(),
|
||||
f32::consts::PI,
|
||||
1.5f32 * f32::consts::FRAC_PI_2,
|
||||
false); // 1
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ use freetype::tt_os2::TT_OS2;
|
|||
use std::mem;
|
||||
use std::num::Float;
|
||||
use std::ptr;
|
||||
use std::string;
|
||||
use std::string::String;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -121,10 +121,10 @@ impl FontHandleMethods for FontHandle {
|
|||
self.font_data.clone()
|
||||
}
|
||||
fn family_name(&self) -> String {
|
||||
unsafe { string::raw::from_buf(&*(*self.face).family_name as *const i8 as *const u8) }
|
||||
unsafe { String::from_raw_buf(&*(*self.face).family_name as *const i8 as *const u8) }
|
||||
}
|
||||
fn face_name(&self) -> String {
|
||||
unsafe { string::raw::from_buf(&*FT_Get_Postscript_Name(self.face) as *const i8 as *const u8) }
|
||||
unsafe { String::from_raw_buf(&*FT_Get_Postscript_Name(self.face) as *const i8 as *const u8) }
|
||||
}
|
||||
fn is_italic(&self) -> bool {
|
||||
unsafe { (*self.face).style_flags & FT_STYLE_FLAG_ITALIC != 0 }
|
||||
|
|
|
@ -23,7 +23,7 @@ use fontconfig::fontconfig::{
|
|||
use libc;
|
||||
use libc::c_int;
|
||||
use std::ptr;
|
||||
use std::string;
|
||||
use std::string::String;
|
||||
|
||||
static FC_FAMILY: &'static [u8] = b"family\0";
|
||||
static FC_FILE: &'static [u8] = b"file\0";
|
||||
|
@ -38,7 +38,7 @@ pub fn get_available_families(callback: |String|) {
|
|||
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);
|
||||
let family_name = String::from_raw_buf(family as *const i8 as *const u8);
|
||||
callback(family_name);
|
||||
v += 1;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ pub fn get_variations_for_family(family_name: &str, callback: |String|) {
|
|||
let font = (*matches).fonts.offset(i);
|
||||
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)
|
||||
String::from_raw_buf(file as *const i8 as *const u8)
|
||||
} else {
|
||||
panic!();
|
||||
};
|
||||
|
@ -112,7 +112,7 @@ pub fn get_system_default_family(generic_name: &str) -> Option<String> {
|
|||
let family_name = if result == FcResultMatch {
|
||||
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);
|
||||
let result = String::from_raw_buf(match_string as *const i8 as *const u8);
|
||||
FcPatternDestroy(family_match);
|
||||
Some(result)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue