Fix some "unnecessary parentheses" warnings

This commit is contained in:
Simon Sapin 2018-01-21 09:02:56 +01:00
parent 6e3fba97bd
commit 897a5b39c5
8 changed files with 9 additions and 9 deletions

View file

@ -30,7 +30,7 @@ pub fn slice_to_str<F>(s: *const u8, l: usize, f: F) -> c_int where F: FnOnce(&s
/// All fields are initialized to zero. It is the caller's responsibility to ensure that the given
/// type is a CEF type with `cef_base_t` as its first member.
pub unsafe fn create_cef_object<Base,Extra>(size: size_t) -> *mut Base {
let object = libc::calloc(1, (mem::size_of::<Base>() + mem::size_of::<Extra>())) as
let object = libc::calloc(1, mem::size_of::<Base>() + mem::size_of::<Extra>()) as
*mut cef_base_t;
(*object).size = size;
(*object).add_ref = Some(servo_add_ref as extern "C" fn(*mut cef_base_t) -> c_int);

View file

@ -199,7 +199,7 @@ cef_unimplemented_wrapper!(cef_string_t, String);
impl<'a> CefWrap<*const cef_string_t> for &'a [u16] {
fn to_c(buffer: &'a [u16]) -> *const cef_string_t {
unsafe {
let ptr = libc::malloc(((buffer.len() + 1) * 2)) as *mut c_ushort;
let ptr = libc::malloc((buffer.len() + 1) * 2) as *mut c_ushort;
ptr::copy(buffer.as_ptr(), ptr, buffer.len());
*ptr.offset(buffer.len() as isize) = 0;

View file

@ -4396,7 +4396,7 @@ pub extern "C" fn Servo_GetCustomPropertyValue(
None => return false,
};
let name = unsafe { Atom::from((&*name)) };
let name = unsafe { Atom::from(&*name) };
let computed_value = match custom_properties.get(&name) {
Some(v) => v,
None => return false,