зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #5661 - Stop using int/uint in CEF (from Ms2ger:cef); r=jdm
Source-Repo: https://github.com/servo/servo Source-Revision: c42c2ae9b57b5960ce617e5b4c0ab75959e46957
This commit is contained in:
Родитель
e9817abe10
Коммит
ab055a7596
|
@ -86,7 +86,7 @@ pub struct ServoCefBrowser {
|
|||
/// Whether the on-created callback has fired yet.
|
||||
pub callback_executed: Cell<bool>,
|
||||
|
||||
id: int,
|
||||
id: isize,
|
||||
servo_browser: RefCell<ServoBrowser>,
|
||||
message_queue: RefCell<Vec<WindowEvent>>,
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ fn command_line_new() -> *mut command_line_t {
|
|||
pub fn command_line_init(argc: c_int, argv: *const *const u8) {
|
||||
unsafe {
|
||||
let mut a: Vec<String> = vec!();
|
||||
for i in 0u..(argc as uint) {
|
||||
let slice = ffi::CStr::from_ptr(*argv.offset(i as int) as *const c_char);
|
||||
for i in 0..(argc as usize) {
|
||||
let slice = ffi::CStr::from_ptr(*argv.offset(i as isize) as *const c_char);
|
||||
let s = str::from_utf8(slice.to_bytes()).unwrap();
|
||||
a.push(String::from_str(s));
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ use std::ffi;
|
|||
use std::str;
|
||||
use browser;
|
||||
|
||||
const MAX_RENDERING_THREADS: uint = 128;
|
||||
const MAX_RENDERING_THREADS: usize = 128;
|
||||
|
||||
// TODO(pcwalton): Get the home page via the CEF API.
|
||||
static HOME_URL: &'static str = "http://s27.postimg.org/vqbtrolyr/servo.jpg";
|
||||
|
@ -60,12 +60,12 @@ pub extern "C" fn cef_initialize(args: *const cef_main_args_t,
|
|||
}
|
||||
|
||||
let rendering_threads = unsafe {
|
||||
if ((*settings).rendering_threads as uint) < 1 {
|
||||
if ((*settings).rendering_threads as usize) < 1 {
|
||||
1
|
||||
} else if (*settings).rendering_threads as uint > MAX_RENDERING_THREADS {
|
||||
} else if (*settings).rendering_threads as usize > MAX_RENDERING_THREADS {
|
||||
MAX_RENDERING_THREADS
|
||||
} else {
|
||||
(*settings).rendering_threads as uint
|
||||
(*settings).rendering_threads as usize
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ pub trait Downcast<Class> {
|
|||
fn downcast(&self) -> &Class;
|
||||
}
|
||||
|
||||
pub fn slice_to_str<F>(s: *const u8, l: uint, f: F) -> c_int where F: FnOnce(&str) -> c_int {
|
||||
pub fn slice_to_str<F>(s: *const u8, l: usize, f: F) -> c_int where F: FnOnce(&str) -> c_int {
|
||||
unsafe {
|
||||
let s = slice::from_raw_parts(s, l);
|
||||
str::from_utf8(s).map(f).unwrap_or(0)
|
||||
|
@ -41,9 +41,9 @@ pub unsafe fn create_cef_object<Base,Extra>(size: size_t) -> *mut Base {
|
|||
|
||||
/// Returns a pointer to the Servo-specific reference count for the given object. This only works
|
||||
/// on objects that Servo created!
|
||||
unsafe fn ref_count(object: *mut cef_base_t) -> *mut uint {
|
||||
unsafe fn ref_count(object: *mut cef_base_t) -> *mut usize {
|
||||
// The reference count should be the first field of the extra data.
|
||||
(object as *mut u8).offset((*object).size as int) as *mut uint
|
||||
(object as *mut u8).offset((*object).size as isize) as *mut usize
|
||||
}
|
||||
|
||||
/// Increments the reference count on a CEF object. This only works on objects that Servo created!
|
||||
|
|
|
@ -106,7 +106,7 @@ pub struct _cef_app_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -71,7 +71,7 @@ pub struct _cef_auth_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -186,7 +186,7 @@ pub struct _cef_browser_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -623,7 +623,7 @@ pub struct _cef_run_file_dialog_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -1118,7 +1118,7 @@ pub struct _cef_browser_host_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -96,7 +96,7 @@ pub struct _cef_browser_process_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -68,7 +68,7 @@ pub struct _cef_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -218,7 +218,7 @@ pub struct _cef_completion_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -151,7 +151,7 @@ pub struct _cef_client_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -200,7 +200,7 @@ pub struct _cef_command_line_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -99,7 +99,7 @@ pub struct _cef_context_menu_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -426,7 +426,7 @@ pub struct _cef_context_menu_params_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -132,7 +132,7 @@ pub struct _cef_cookie_manager_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -433,7 +433,7 @@ pub struct _cef_cookie_visitor_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -72,7 +72,7 @@ pub struct _cef_file_dialog_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -238,7 +238,7 @@ pub struct _cef_dialog_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -103,7 +103,7 @@ pub struct _cef_display_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -69,7 +69,7 @@ pub struct _cef_domvisitor_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -308,7 +308,7 @@ pub struct _cef_domdocument_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -820,7 +820,7 @@ pub struct _cef_domnode_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -68,7 +68,7 @@ pub struct _cef_before_download_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -209,7 +209,7 @@ pub struct _cef_download_item_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -367,7 +367,7 @@ pub struct _cef_download_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -160,7 +160,7 @@ pub struct _cef_download_item_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -204,7 +204,7 @@ pub struct _cef_drag_data_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -70,7 +70,7 @@ pub struct _cef_drag_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -83,7 +83,7 @@ pub struct _cef_focus_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -214,7 +214,7 @@ pub struct _cef_frame_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -67,7 +67,7 @@ pub struct _cef_get_geolocation_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -65,7 +65,7 @@ pub struct _cef_geolocation_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -224,7 +224,7 @@ pub struct _cef_geolocation_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -66,7 +66,7 @@ pub struct _cef_jsdialog_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -255,7 +255,7 @@ pub struct _cef_jsdialog_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -81,7 +81,7 @@ pub struct _cef_keyboard_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -168,7 +168,7 @@ pub struct _cef_life_span_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -108,7 +108,7 @@ pub struct _cef_load_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -401,7 +401,7 @@ pub struct _cef_menu_model_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -70,7 +70,7 @@ pub struct _cef_print_dialog_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -220,7 +220,7 @@ pub struct _cef_print_job_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -385,7 +385,7 @@ pub struct _cef_print_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -206,7 +206,7 @@ pub struct _cef_print_settings_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -91,7 +91,7 @@ pub struct _cef_process_message_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -184,7 +184,7 @@ pub struct _cef_render_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -173,7 +173,7 @@ pub struct _cef_render_process_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -167,7 +167,7 @@ pub struct _cef_request_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -581,7 +581,7 @@ pub struct _cef_post_data_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -853,7 +853,7 @@ pub struct _cef_post_data_element_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -89,7 +89,7 @@ pub struct _cef_request_context_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -65,7 +65,7 @@ pub struct _cef_request_context_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -70,7 +70,7 @@ pub struct _cef_quota_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -225,7 +225,7 @@ pub struct _cef_allow_certificate_error_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -485,7 +485,7 @@ pub struct _cef_request_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -82,7 +82,7 @@ pub struct _cef_resource_bundle_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -117,7 +117,7 @@ pub struct _cef_resource_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -122,7 +122,7 @@ pub struct _cef_response_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -108,7 +108,7 @@ pub struct _cef_scheme_registrar_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -303,7 +303,7 @@ pub struct _cef_scheme_handler_factory_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -90,7 +90,7 @@ pub struct _cef_read_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -318,7 +318,7 @@ pub struct _cef_stream_reader_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -583,7 +583,7 @@ pub struct _cef_write_handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -812,7 +812,7 @@ pub struct _cef_stream_writer_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -64,7 +64,7 @@ pub struct _cef_string_visitor_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -68,7 +68,7 @@ pub struct _cef_task_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -244,7 +244,7 @@ pub struct _cef_task_runner_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -69,7 +69,7 @@ pub struct _cef_end_tracing_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -101,7 +101,7 @@ pub struct _cef_urlrequest_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -387,7 +387,7 @@ pub struct _cef_urlrequest_client_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -131,7 +131,7 @@ pub struct _cef_v8context_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -447,7 +447,7 @@ pub struct _cef_v8handler_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -619,7 +619,7 @@ pub struct _cef_v8accessor_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -844,7 +844,7 @@ pub struct _cef_v8exception_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -1416,7 +1416,7 @@ pub struct _cef_v8value_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -2423,7 +2423,7 @@ pub struct _cef_v8stack_trace_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -2660,7 +2660,7 @@ pub struct _cef_v8stack_frame_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -91,7 +91,7 @@ pub struct _cef_binary_value_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -476,7 +476,7 @@ pub struct _cef_dictionary_value_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -1179,7 +1179,7 @@ pub struct _cef_list_value_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -86,7 +86,7 @@ pub struct _cef_web_plugin_info_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -273,7 +273,7 @@ pub struct _cef_web_plugin_info_visitor_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
@ -421,7 +421,7 @@ pub struct _cef_web_plugin_unstable_callback_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -277,7 +277,7 @@ pub struct _cef_xml_reader_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -140,7 +140,7 @@ pub struct _cef_zip_reader_t {
|
|||
//
|
||||
// The reference count. This will only be present for Rust instances!
|
||||
//
|
||||
pub ref_count: uint,
|
||||
pub ref_count: usize,
|
||||
|
||||
//
|
||||
// Extra data. This will only be present for Rust instances!
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* 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/. */
|
||||
|
||||
#![feature(int_uint)]
|
||||
#![feature(alloc)]
|
||||
#![feature(box_syntax)]
|
||||
#![feature(plugin)]
|
||||
#![feature(link_args)]
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
// //
|
||||
// // Note that if the method returns unit, you must write `-> ()` explicitly. This is
|
||||
// // due to limitations of Rust's macro system.
|
||||
// fn foo(&this, a: int, b: *mut cef_other_thing_t) -> () {
|
||||
// // Inside here, `a` will have type `int`, and `b` will have the type
|
||||
// fn foo(&this, a: isize, b: *mut cef_other_thing_t) -> () {
|
||||
// // Inside here, `a` will have type `isize`, and `b` will have the type
|
||||
// // `CefOtherThing` -- i.e. the Rust-wrapped version of `cef_other_thing_t`.
|
||||
// ...
|
||||
// }
|
||||
//
|
||||
// fn bar(&this, a: int) -> *mut cef_other_thing_t {
|
||||
// fn bar(&this, a: isize) -> *mut cef_other_thing_t {
|
||||
// // Return types are automatically unwrapped from the Rust types (e.g.
|
||||
// // `CefOtherThing`) into the corresponding C types (e.g. `*mut
|
||||
// // cef_other_thing_t`).
|
||||
|
@ -66,7 +66,7 @@ macro_rules! full_cef_class_impl(
|
|||
// Calculate the offset of the reference count. This is the size of the
|
||||
// structure.
|
||||
let null: *const $c_interface_name = ::std::ptr::null();
|
||||
let offset: *const uint = &(*null).ref_count;
|
||||
let offset: *const usize = &(*null).ref_count;
|
||||
let size = (offset as ::libc::size_t) - (null as ::libc::size_t);
|
||||
$interface_name::from_c_object_addref(
|
||||
::eutil::create_cef_object::<$c_interface_name,$class_name>(size))
|
||||
|
|
|
@ -94,7 +94,7 @@ pub extern "C" fn cef_string_utf8_set(src: *const u8, src_len: size_t, output: *
|
|||
return 0;
|
||||
}
|
||||
|
||||
ptr::copy((*output).str, src, src_len as uint);
|
||||
ptr::copy((*output).str, src, src_len as usize);
|
||||
(*output).length = src_len;
|
||||
(*output).dtor = Some(string_utf8_dtor as extern "C" fn(*mut u8));
|
||||
}
|
||||
|
@ -112,8 +112,8 @@ pub extern "C" fn cef_string_utf8_cmp(a: *const cef_string_utf8_t, b: *const cef
|
|||
unsafe {
|
||||
let astr = (*a).str as *const u8;
|
||||
let bstr = (*b).str as *const u8;
|
||||
let astr = slice::from_raw_parts(astr, (*a).length as uint);
|
||||
let bstr = slice::from_raw_parts(bstr, (*b).length as uint);
|
||||
let astr = slice::from_raw_parts(astr, (*a).length as usize);
|
||||
let bstr = slice::from_raw_parts(bstr, (*b).length as usize);
|
||||
match astr.cmp(bstr) {
|
||||
Ordering::Less => -1,
|
||||
Ordering::Equal => 0,
|
||||
|
@ -124,7 +124,7 @@ pub extern "C" fn cef_string_utf8_cmp(a: *const cef_string_utf8_t, b: *const cef
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int {
|
||||
slice_to_str(src, src_len as uint, |result| {
|
||||
slice_to_str(src, src_len as usize, |result| {
|
||||
let conv = result.utf16_units().collect::<Vec<u16>>();
|
||||
cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1);
|
||||
1
|
||||
|
@ -134,7 +134,7 @@ pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, outp
|
|||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_utf16_to_utf8(src: *const u16, src_len: size_t, output: *mut cef_string_utf8_t) -> c_int {
|
||||
unsafe {
|
||||
let ustr = slice::from_raw_parts(src, src_len as uint);
|
||||
let ustr = slice::from_raw_parts(src, src_len as usize);
|
||||
match string::String::from_utf16(ustr) {
|
||||
Ok(str) => {
|
||||
cef_string_utf8_set(str.as_bytes().as_ptr(), str.len() as size_t, output, 1);
|
||||
|
@ -175,7 +175,7 @@ pub extern "C" fn cef_string_utf16_set(src: *const c_ushort, src_len: size_t, ou
|
|||
return 0;
|
||||
}
|
||||
|
||||
ptr::copy((*output).str, src, src_len as uint);
|
||||
ptr::copy((*output).str, src, src_len as usize);
|
||||
(*output).length = src_len;
|
||||
(*output).dtor = Some(string_utf16_dtor as extern "C" fn(*mut c_ushort));
|
||||
}
|
||||
|
@ -193,8 +193,8 @@ pub extern "C" fn cef_string_utf16_cmp(a: *const cef_string_utf16_t, b: *const c
|
|||
unsafe {
|
||||
let astr = (*a).str as *const _;
|
||||
let bstr = (*b).str as *const _;
|
||||
let astr: &[u16] = slice::from_raw_parts(astr, (*a).length as uint);
|
||||
let bstr: &[u16] = slice::from_raw_parts(bstr, (*b).length as uint);
|
||||
let astr: &[u16] = slice::from_raw_parts(astr, (*a).length as usize);
|
||||
let bstr: &[u16] = slice::from_raw_parts(bstr, (*b).length as usize);
|
||||
match astr.cmp(bstr) {
|
||||
Ordering::Less => -1,
|
||||
Ordering::Equal => 0,
|
||||
|
@ -233,7 +233,7 @@ pub extern "C" fn cef_string_wide_set(src: *const wchar_t, src_len: size_t, outp
|
|||
return 0;
|
||||
}
|
||||
|
||||
ptr::copy((*output).str, src, src_len as uint);
|
||||
ptr::copy((*output).str, src, src_len as usize);
|
||||
(*output).length = src_len;
|
||||
(*output).dtor = Some(string_wide_dtor as extern "C" fn(*mut wchar_t));
|
||||
}
|
||||
|
@ -251,8 +251,8 @@ pub extern "C" fn cef_string_wide_cmp(a: *const cef_string_wide_t, b: *const cef
|
|||
unsafe {
|
||||
let astr = (*a).str as *const wchar_t;
|
||||
let bstr = (*b).str as *const wchar_t;
|
||||
let astr = slice::from_raw_parts(astr, (*a).length as uint);
|
||||
let bstr = slice::from_raw_parts(bstr, (*b).length as uint);
|
||||
let astr = slice::from_raw_parts(astr, (*a).length as usize);
|
||||
let bstr = slice::from_raw_parts(bstr, (*b).length as usize);
|
||||
match astr.cmp(bstr) {
|
||||
Ordering::Less => -1,
|
||||
Ordering::Equal => 0,
|
||||
|
@ -266,7 +266,7 @@ pub extern "C" fn cef_string_utf8_to_wide(src: *const u8, src_len: size_t, outpu
|
|||
if mem::size_of::<wchar_t>() == mem::size_of::<u16>() {
|
||||
return cef_string_utf8_to_utf16(src, src_len, output as *mut cef_string_utf16_t);
|
||||
}
|
||||
slice_to_str(src, src_len as uint, |result| {
|
||||
slice_to_str(src, src_len as usize, |result| {
|
||||
let conv = result.chars().map(|c| c as u32).collect::<Vec<u32>>();
|
||||
cef_string_wide_set(conv.as_ptr() as *const wchar_t, conv.len() as size_t, output, 1)
|
||||
})
|
||||
|
@ -278,7 +278,7 @@ pub extern "C" fn cef_string_wide_to_utf8(src: *const wchar_t, src_len: size_t,
|
|||
return cef_string_utf16_to_utf8(src as *const u16, src_len, output);
|
||||
}
|
||||
unsafe {
|
||||
let ustr = slice::from_raw_parts(src, src_len as uint);
|
||||
let ustr = slice::from_raw_parts(src, src_len as usize);
|
||||
let conv = ustr.iter().map(|&c| char::from_u32(c as u32).unwrap_or('\u{FFFD}')).collect::<String>();
|
||||
cef_string_utf8_set(conv.as_bytes().as_ptr(), conv.len() as size_t, output, 1)
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ pub extern "C" fn cef_string_wide_to_utf8(src: *const wchar_t, src_len: size_t,
|
|||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_ascii_to_utf16(src: *const u8, src_len: size_t, output: *mut cef_string_utf16_t) -> c_int {
|
||||
slice_to_str(src, src_len as uint, |result| {
|
||||
slice_to_str(src, src_len as usize, |result| {
|
||||
let conv = result.utf16_units().collect::<Vec<u16>>();
|
||||
cef_string_utf16_set(conv.as_ptr(), conv.len() as size_t, output, 1)
|
||||
})
|
||||
|
@ -295,7 +295,7 @@ pub extern "C" fn cef_string_ascii_to_utf16(src: *const u8, src_len: size_t, out
|
|||
#[no_mangle]
|
||||
pub extern "C" fn cef_string_ascii_to_wide(src: *const u8, src_len: size_t, output: *mut cef_string_wide_t) -> c_int {
|
||||
unsafe {
|
||||
let ustr = slice::from_raw_parts(src, src_len as uint);
|
||||
let ustr = slice::from_raw_parts(src, src_len as usize);
|
||||
let conv = ustr.iter().map(|&c| c as u8).collect::<Vec<u8>>();
|
||||
cef_string_wide_set(conv.as_ptr() as *const wchar_t, conv.len() as size_t, output, 1)
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ pub extern "C" fn cef_string_list_value(lt: *mut cef_string_list_t, index: c_int
|
|||
unsafe {
|
||||
if index < 0 || lt.is_null() { return 0; }
|
||||
let v = string_list_to_vec(lt);
|
||||
if index as uint > (*v).len() - 1 { return 0; }
|
||||
let cs = (*v)[index as uint];
|
||||
if index as usize > (*v).len() - 1 { return 0; }
|
||||
let cs = (*v)[index as usize];
|
||||
cef_string_utf16_set(mem::transmute((*cs).str), (*cs).length, value, 1)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ pub extern "C" fn cef_string_map_append(sm: *mut cef_string_map_t, key: *const c
|
|||
unsafe {
|
||||
if sm.is_null() { return 0; }
|
||||
let v = string_map_to_treemap(sm);
|
||||
slice_to_str((*key).str as *const u8, (*key).length as uint, |result| {
|
||||
slice_to_str((*key).str as *const u8, (*key).length as usize, |result| {
|
||||
let s = String::from_str(result);
|
||||
let csv = cef_string_userfree_utf16_alloc();
|
||||
cef_string_utf16_set((*value).str as *const u16, (*value).length, csv, 1);
|
||||
|
@ -54,7 +54,7 @@ pub extern "C" fn cef_string_map_find(sm: *mut cef_string_map_t, key: *const cef
|
|||
unsafe {
|
||||
if sm.is_null() { return 0; }
|
||||
let v = string_map_to_treemap(sm);
|
||||
slice_to_str((*key).str as *const u8, (*key).length as uint, |result| {
|
||||
slice_to_str((*key).str as *const u8, (*key).length as usize, |result| {
|
||||
match (*v).get(&String::from_str(result)) {
|
||||
Some(s) => {
|
||||
cef_string_utf16_set((**s).str as *const u16, (**s).length, value, 1);
|
||||
|
@ -71,10 +71,10 @@ pub extern "C" fn cef_string_map_key(sm: *mut cef_string_map_t, index: c_int, va
|
|||
unsafe {
|
||||
if index < 0 || sm.is_null() { return 0; }
|
||||
let v = string_map_to_treemap(sm);
|
||||
if index as uint > (*v).len() - 1 { return 0; }
|
||||
if index as usize > (*v).len() - 1 { return 0; }
|
||||
|
||||
for (i, k) in (*v).keys().enumerate() {
|
||||
if i == index as uint {
|
||||
if i == index as usize {
|
||||
cef_string_utf16_set(k.as_bytes().as_ptr() as *const u16,
|
||||
k.len() as u64,
|
||||
value,
|
||||
|
@ -91,10 +91,10 @@ pub extern "C" fn cef_string_map_value(sm: *mut cef_string_map_t, index: c_int,
|
|||
unsafe {
|
||||
if index < 0 || sm.is_null() { return 0; }
|
||||
let v = string_map_to_treemap(sm);
|
||||
if index as uint > (*v).len() - 1 { return 0; }
|
||||
if index as usize > (*v).len() - 1 { return 0; }
|
||||
|
||||
for (i, val) in (*v).values().enumerate() {
|
||||
if i == index as uint {
|
||||
if i == index as usize {
|
||||
cef_string_utf16_set((**val).str as *const u16, (**val).length, value, 1);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ pub extern "C" fn cef_string_multimap_find_count(smm: *mut cef_string_multimap_t
|
|||
unsafe {
|
||||
if smm.is_null() { return 0; }
|
||||
let v = string_multimap_to_treemap(smm);
|
||||
slice_to_str((*key).str as *const u8, (*key).length as uint, |result| {
|
||||
slice_to_str((*key).str as *const u8, (*key).length as usize, |result| {
|
||||
match (*v).get(&String::from_str(result)) {
|
||||
Some(s) => s.len() as c_int,
|
||||
None => 0
|
||||
|
@ -54,7 +54,7 @@ pub extern "C" fn cef_string_multimap_append(smm: *mut cef_string_multimap_t, ke
|
|||
unsafe {
|
||||
if smm.is_null() { return 0; }
|
||||
let v = string_multimap_to_treemap(smm);
|
||||
slice_to_str((*key).str as *const u8, (*key).length as uint, |result| {
|
||||
slice_to_str((*key).str as *const u8, (*key).length as usize, |result| {
|
||||
let s = String::from_str(result);
|
||||
let csv = cef_string_userfree_utf16_alloc();
|
||||
cef_string_utf16_set((*value).str as *const u16, (*value).length, csv, 1);
|
||||
|
@ -72,13 +72,13 @@ pub extern "C" fn cef_string_multimap_enumerate(smm: *mut cef_string_multimap_t,
|
|||
unsafe {
|
||||
if smm.is_null() { return 0; }
|
||||
let v = string_multimap_to_treemap(smm);
|
||||
slice_to_str((*key).str as *const u8, (*key).length as uint, |result| {
|
||||
slice_to_str((*key).str as *const u8, (*key).length as usize, |result| {
|
||||
match (*v).get(&String::from_str(result)) {
|
||||
Some(s) => {
|
||||
if (*s).len() <= index as uint {
|
||||
if (*s).len() <= index as usize {
|
||||
return 0;
|
||||
}
|
||||
let cs = (*s)[index as uint];
|
||||
let cs = (*s)[index as usize];
|
||||
cef_string_utf16_set((*cs).str as *const u16, (*cs).length, value, 1)
|
||||
}
|
||||
None => 0
|
||||
|
@ -92,7 +92,7 @@ pub extern "C" fn cef_string_multimap_key(smm: *mut cef_string_multimap_t, index
|
|||
unsafe {
|
||||
if index < 0 || smm.is_null() { return 0; }
|
||||
let v = string_multimap_to_treemap(smm);
|
||||
let mut rem = index as uint;
|
||||
let mut rem = index as usize;
|
||||
|
||||
for (key, val) in (*v).iter() {
|
||||
if rem < (*val).len() {
|
||||
|
@ -113,11 +113,11 @@ pub extern "C" fn cef_string_multimap_value(smm: *mut cef_string_multimap_t, ind
|
|||
unsafe {
|
||||
if index < 0 || smm.is_null() { return 0; }
|
||||
let v = string_multimap_to_treemap(smm);
|
||||
let mut rem = index as uint;
|
||||
let mut rem = index as usize;
|
||||
|
||||
for val in (*v).values() {
|
||||
if rem < (*val).len() {
|
||||
let cs = (*val)[rem as uint];
|
||||
let cs = (*val)[rem as usize];
|
||||
return cef_string_utf16_set((*cs).str as *const u16, (*cs).length, value, 1);
|
||||
} else {
|
||||
rem -= (*val).len();
|
||||
|
|
|
@ -185,7 +185,7 @@ impl<'a> CefWrap<*const cef_string_t> for &'a [u16] {
|
|||
unsafe {
|
||||
let ptr: *mut c_ushort = mem::transmute(libc::malloc(((buffer.len() + 1) * 2) as u64));
|
||||
ptr::copy(ptr, mem::transmute(buffer.as_ptr()), buffer.len());
|
||||
*ptr.offset(buffer.len() as int) = 0;
|
||||
*ptr.offset(buffer.len() as isize) = 0;
|
||||
|
||||
// FIXME(pcwalton): This leaks!! We should instead have the caller pass some scratch
|
||||
// stack space to create the object in. What a botch.
|
||||
|
@ -248,9 +248,9 @@ impl<'a> CefWrap<cef_string_userfree_t> for String {
|
|||
let buffer = libc::malloc((mem::size_of::<c_ushort>() as libc::size_t) *
|
||||
((utf16_chars.len() + 1) as libc::size_t)) as *mut u16;
|
||||
for (i, ch) in utf16_chars.iter().enumerate() {
|
||||
*buffer.offset(i as int) = *ch
|
||||
*buffer.offset(i as isize) = *ch
|
||||
}
|
||||
*buffer.offset(utf16_chars.len() as int) = 0;
|
||||
*buffer.offset(utf16_chars.len() as isize) = 0;
|
||||
|
||||
boxed_string = libc::malloc(mem::size_of::<cef_string_utf16>() as libc::size_t) as
|
||||
*mut cef_string_utf16;
|
||||
|
|
Загрузка…
Ссылка в новой задаче