Upgrade to rustc 1.6.0-nightly (d5fde83ae 2015-11-12)

… and libc 0.2 and many other dependencies
This commit is contained in:
Manish Goregaokar 2015-11-07 22:40:18 +05:30 committed by Josh Matthews
parent bc618b0d53
commit dc0e467945
59 changed files with 1092 additions and 978 deletions

556
ports/cef/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -11,7 +11,7 @@ crate-type = ["dylib"]
[dependencies]
log = "*"
url = "*"
libc = "*"
libc = "0.2"
euclid = {version = "0.3", features = ["plugins"]}
gleam = "0.1"

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 u64) 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

@ -4,8 +4,7 @@
use eutil::slice_to_str;
use libc::types::os::arch::c95::wchar_t;
use libc::{self, size_t, c_int, c_ushort, c_void};
use libc::{self, size_t, c_int, c_ushort, c_void, wchar_t};
use std::char;
use std::cmp::Ordering;
use std::mem;
@ -79,7 +78,7 @@ pub extern "C" fn cef_string_utf8_clear(cs: *mut cef_string_utf8_t) {
#[no_mangle]
pub extern "C" fn cef_string_userfree_utf8_alloc() -> *mut cef_string_utf8_t {
unsafe {
libc::calloc(1, mem::size_of::<cef_string_utf8_t>() as u64) as *mut cef_string_utf8_t
libc::calloc(1, mem::size_of::<cef_string_utf8_t>()) as *mut cef_string_utf8_t
}
}
@ -159,7 +158,7 @@ pub extern "C" fn cef_string_utf16_clear(cs: *mut cef_string_utf16_t) {
#[no_mangle]
pub extern "C" fn cef_string_userfree_utf16_alloc() -> *mut cef_string_utf16_t {
unsafe {
libc::calloc(1, mem::size_of::<cef_string_utf16_t>() as u64) as *mut cef_string_utf16_t
libc::calloc(1, mem::size_of::<cef_string_utf16_t>()) as *mut cef_string_utf16_t
}
}
@ -169,7 +168,7 @@ pub extern "C" fn cef_string_utf16_set(src: *const c_ushort, src_len: size_t, ou
unsafe {
if copy != 0 {
if !src.is_null() && src_len > 0 {
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<c_ushort>() as u64) as
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<c_ushort>()) as
*mut u16;
if (*output).str.is_null() {
return 0;
@ -217,7 +216,7 @@ pub extern "C" fn cef_string_wide_clear(cs: *mut cef_string_wide_t) {
#[no_mangle]
pub extern "C" fn cef_string_userfree_wide_alloc() -> *mut cef_string_wide_t {
unsafe {
libc::calloc(1, mem::size_of::<cef_string_wide_t>() as u64) as *mut cef_string_wide_t
libc::calloc(1, mem::size_of::<cef_string_wide_t>()) as *mut cef_string_wide_t
}
}
@ -227,7 +226,7 @@ pub extern "C" fn cef_string_wide_set(src: *const wchar_t, src_len: size_t, outp
unsafe {
if copy != 0 {
if !src.is_null() && src_len > 0 {
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<wchar_t>() as u64) as
(*output).str = libc::calloc(1, (src_len + 1) * mem::size_of::<wchar_t>()) as
*mut wchar_t;
if (*output).str.is_null() {
return 0;

View file

@ -39,7 +39,7 @@ pub extern "C" fn cef_string_list_value(lt: *mut cef_string_list_t, index: c_int
if index as usize > (*lt).len() - 1 { return 0; }
let ref string = (*lt)[index as usize];
let utf16_chars: Vec<u16> = Utf16Encoder::new(string.chars()).collect();
cef_string_utf16_set(utf16_chars.as_ptr(), utf16_chars.len() as u64, value, 1)
cef_string_utf16_set(utf16_chars.as_ptr(), utf16_chars.len(), value, 1)
}
}

View file

@ -61,7 +61,7 @@ pub extern "C" fn cef_string_map_key(sm: *mut cef_string_map_t, index: c_int, va
match (*sm).keys().nth(index as usize) {
Some(k) => {
cef_string_utf16_set(k.as_bytes().as_ptr() as *const u16,
k.len() as u64,
k.len(),
value,
1)
},

View file

@ -85,7 +85,7 @@ pub extern "C" fn cef_string_multimap_key(smm: *mut cef_string_multimap_t, index
for (key, val) in &(*smm) {
if rem < (*val).len() {
return cef_string_utf16_set((*key).as_bytes().as_ptr() as *const u16,
(*key).len() as u64,
(*key).len(),
value,
1);
} else {

View file

@ -2,12 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use libc::{c_uint, c_ushort, c_int, c_double, size_t};
use libc::{c_uint, c_ushort, c_int, c_double, size_t, wchar_t};
#[cfg(target_os="linux")]
use libc::c_ulong;
#[cfg(target_os="macos")]
use libc::c_void;
use libc::types::os::arch::c95::wchar_t;
use net_traits::net_error_list::NetError;

View file

@ -121,6 +121,7 @@ cef_pointer_wrapper!(i32);
cef_pointer_wrapper!(i64);
cef_pointer_wrapper!(u32);
cef_pointer_wrapper!(u64);
cef_pointer_wrapper!(usize);
cef_noop_wrapper!(());
cef_noop_wrapper!(*const cef_geolocation_handler_t);
@ -187,6 +188,7 @@ cef_noop_wrapper!(f64);
cef_noop_wrapper!(i64);
cef_noop_wrapper!(u32);
cef_noop_wrapper!(u64);
cef_noop_wrapper!(usize);
cef_noop_wrapper!(cef_string_list_t);
cef_unimplemented_wrapper!(*const *mut cef_v8value_t, *const CefV8Value);
@ -198,7 +200,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 u64) 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;
@ -206,7 +208,7 @@ impl<'a> CefWrap<*const cef_string_t> for &'a [u16] {
// stack space to create the object in. What a botch.
Box::into_raw(box cef_string_utf16 {
str: ptr,
length: buffer.len() as u64,
length: buffer.len(),
dtor: Some(free_boxed_utf16_string as extern "C" fn(*mut c_ushort)),
}) as *const _
}
@ -267,7 +269,7 @@ impl<'a> CefWrap<cef_string_userfree_t> for String {
boxed_string = libc::malloc(mem::size_of::<cef_string_utf16>() as libc::size_t) as
*mut cef_string_utf16;
ptr::write(&mut (*boxed_string).str, buffer);
ptr::write(&mut (*boxed_string).length, utf16_chars.len() as u64);
ptr::write(&mut (*boxed_string).length, utf16_chars.len());
ptr::write(&mut (*boxed_string).dtor, Some(free_utf16_buffer as extern "C" fn(*mut c_ushort)));
}
boxed_string

View file

@ -14,8 +14,8 @@ headless = ["glutin/headless"]
[dependencies]
time = "0.1.12"
bitflags = "0.3"
libc = "0.1"
url = "0.2"
libc = "0.2"
url = "0.5"
gleam = "0.1"
euclid = {version = "0.3", features = ["plugins"]}

View file

@ -18,6 +18,7 @@ use glutin;
use glutin::{Api, ElementState, Event, GlRequest, MouseButton, VirtualKeyCode, MouseScrollDelta};
use layers::geometry::DevicePixel;
use layers::platform::surface::NativeDisplay;
use libc::c_void;
#[cfg(feature = "window")]
use msg::constellation_msg::{KeyState, NONE, CONTROL, SHIFT, ALT, SUPER};
use msg::constellation_msg::{self, Key};
@ -149,7 +150,7 @@ impl Window {
#[cfg(not(target_os = "android"))]
fn load_gl_functions(window: &glutin::Window) {
gl::load_with(|s| window.get_proc_address(s));
gl::load_with(|s| window.get_proc_address(s) as *const c_void);
}
#[cfg(target_os = "android")]
@ -728,7 +729,7 @@ impl Window {
let headless_context = headless_builder.build().unwrap();
unsafe { headless_context.make_current().expect("Failed to make context current!") };
gl::load_with(|s| headless_context.get_proc_address(s));
gl::load_with(|s| headless_context.get_proc_address(s) as *const c_void);
let window = Window {
context: headless_context,

538
ports/gonk/Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -48,9 +48,9 @@ git = "https://github.com/servo/rust-egl"
[dependencies]
env_logger = "0.3"
url = "0.2.16"
url = "0.5"
time = "0.1.17"
errno = "0.1"
libc = "0.1"
libc = "0.2"
euclid = {version = "0.3", features = ["plugins"]}
gleam = "0.1"