From ab055a75961fcd2a97a211a51a33ec2db46c372b Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 13 Apr 2015 09:17:44 -0500 Subject: [PATCH] servo: Merge #5661 - Stop using int/uint in CEF (from Ms2ger:cef); r=jdm Source-Repo: https://github.com/servo/servo Source-Revision: c42c2ae9b57b5960ce617e5b4c0ab75959e46957 --- servo/ports/cef/browser.rs | 2 +- servo/ports/cef/command_line.rs | 4 +-- servo/ports/cef/core.rs | 8 ++--- servo/ports/cef/eutil.rs | 6 ++-- servo/ports/cef/interfaces/cef_app.rs | 2 +- .../ports/cef/interfaces/cef_auth_callback.rs | 2 +- servo/ports/cef/interfaces/cef_browser.rs | 6 ++-- .../interfaces/cef_browser_process_handler.rs | 2 +- servo/ports/cef/interfaces/cef_callback.rs | 4 +-- servo/ports/cef/interfaces/cef_client.rs | 2 +- .../ports/cef/interfaces/cef_command_line.rs | 2 +- .../interfaces/cef_context_menu_handler.rs | 4 +-- servo/ports/cef/interfaces/cef_cookie.rs | 4 +-- .../cef/interfaces/cef_dialog_handler.rs | 4 +-- .../cef/interfaces/cef_display_handler.rs | 2 +- servo/ports/cef/interfaces/cef_dom.rs | 6 ++-- .../cef/interfaces/cef_download_handler.rs | 6 ++-- .../ports/cef/interfaces/cef_download_item.rs | 2 +- servo/ports/cef/interfaces/cef_drag_data.rs | 2 +- .../ports/cef/interfaces/cef_drag_handler.rs | 2 +- .../ports/cef/interfaces/cef_focus_handler.rs | 2 +- servo/ports/cef/interfaces/cef_frame.rs | 2 +- servo/ports/cef/interfaces/cef_geolocation.rs | 2 +- .../cef/interfaces/cef_geolocation_handler.rs | 4 +-- .../cef/interfaces/cef_jsdialog_handler.rs | 4 +-- .../cef/interfaces/cef_keyboard_handler.rs | 2 +- .../cef/interfaces/cef_life_span_handler.rs | 2 +- .../ports/cef/interfaces/cef_load_handler.rs | 2 +- servo/ports/cef/interfaces/cef_menu_model.rs | 2 +- .../ports/cef/interfaces/cef_print_handler.rs | 6 ++-- .../cef/interfaces/cef_print_settings.rs | 2 +- .../cef/interfaces/cef_process_message.rs | 2 +- .../cef/interfaces/cef_render_handler.rs | 2 +- .../interfaces/cef_render_process_handler.rs | 2 +- servo/ports/cef/interfaces/cef_request.rs | 6 ++-- .../cef/interfaces/cef_request_context.rs | 2 +- .../interfaces/cef_request_context_handler.rs | 2 +- .../cef/interfaces/cef_request_handler.rs | 6 ++-- .../interfaces/cef_resource_bundle_handler.rs | 2 +- .../cef/interfaces/cef_resource_handler.rs | 2 +- servo/ports/cef/interfaces/cef_response.rs | 2 +- servo/ports/cef/interfaces/cef_scheme.rs | 4 +-- servo/ports/cef/interfaces/cef_stream.rs | 8 ++--- .../cef/interfaces/cef_string_visitor.rs | 2 +- servo/ports/cef/interfaces/cef_task.rs | 4 +-- servo/ports/cef/interfaces/cef_trace.rs | 2 +- servo/ports/cef/interfaces/cef_urlrequest.rs | 4 +-- servo/ports/cef/interfaces/cef_v8.rs | 14 ++++----- servo/ports/cef/interfaces/cef_values.rs | 6 ++-- servo/ports/cef/interfaces/cef_web_plugin.rs | 6 ++-- servo/ports/cef/interfaces/cef_xml_reader.rs | 2 +- servo/ports/cef/interfaces/cef_zip_reader.rs | 2 +- servo/ports/cef/lib.rs | 2 +- servo/ports/cef/macros.rs | 8 ++--- servo/ports/cef/string.rs | 30 +++++++++---------- servo/ports/cef/string_list.rs | 4 +-- servo/ports/cef/string_map.rs | 12 ++++---- servo/ports/cef/string_multimap.rs | 16 +++++----- servo/ports/cef/wrappers.rs | 6 ++-- 59 files changed, 131 insertions(+), 131 deletions(-) diff --git a/servo/ports/cef/browser.rs b/servo/ports/cef/browser.rs index a654cce9e734..6f773fa335a5 100644 --- a/servo/ports/cef/browser.rs +++ b/servo/ports/cef/browser.rs @@ -86,7 +86,7 @@ pub struct ServoCefBrowser { /// Whether the on-created callback has fired yet. pub callback_executed: Cell, - id: int, + id: isize, servo_browser: RefCell, message_queue: RefCell>, } diff --git a/servo/ports/cef/command_line.rs b/servo/ports/cef/command_line.rs index 8ba04395423d..dd932a22d745 100644 --- a/servo/ports/cef/command_line.rs +++ b/servo/ports/cef/command_line.rs @@ -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 = 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)); } diff --git a/servo/ports/cef/core.rs b/servo/ports/cef/core.rs index 9a6b320c6380..3a2e3da09d7a 100644 --- a/servo/ports/cef/core.rs +++ b/servo/ports/cef/core.rs @@ -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 } }; diff --git a/servo/ports/cef/eutil.rs b/servo/ports/cef/eutil.rs index d6bf20b780fd..dca208e165a2 100644 --- a/servo/ports/cef/eutil.rs +++ b/servo/ports/cef/eutil.rs @@ -19,7 +19,7 @@ pub trait Downcast { fn downcast(&self) -> &Class; } -pub fn slice_to_str(s: *const u8, l: uint, f: F) -> c_int where F: FnOnce(&str) -> c_int { +pub fn slice_to_str(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(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! diff --git a/servo/ports/cef/interfaces/cef_app.rs b/servo/ports/cef/interfaces/cef_app.rs index b47864fa63c5..0c22ddc8bc3a 100644 --- a/servo/ports/cef/interfaces/cef_app.rs +++ b/servo/ports/cef/interfaces/cef_app.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_auth_callback.rs b/servo/ports/cef/interfaces/cef_auth_callback.rs index 04a85d764423..076346dd8999 100644 --- a/servo/ports/cef/interfaces/cef_auth_callback.rs +++ b/servo/ports/cef/interfaces/cef_auth_callback.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_browser.rs b/servo/ports/cef/interfaces/cef_browser.rs index 6d0ec4eac3df..474d855ffea2 100644 --- a/servo/ports/cef/interfaces/cef_browser.rs +++ b/servo/ports/cef/interfaces/cef_browser.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_browser_process_handler.rs b/servo/ports/cef/interfaces/cef_browser_process_handler.rs index 5a03a2ac8825..66ba7a0635d3 100644 --- a/servo/ports/cef/interfaces/cef_browser_process_handler.rs +++ b/servo/ports/cef/interfaces/cef_browser_process_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_callback.rs b/servo/ports/cef/interfaces/cef_callback.rs index 58e6e8d1ee38..a4b8fe54a22e 100644 --- a/servo/ports/cef/interfaces/cef_callback.rs +++ b/servo/ports/cef/interfaces/cef_callback.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_client.rs b/servo/ports/cef/interfaces/cef_client.rs index 11d534133ee6..3c75868c9b0b 100644 --- a/servo/ports/cef/interfaces/cef_client.rs +++ b/servo/ports/cef/interfaces/cef_client.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_command_line.rs b/servo/ports/cef/interfaces/cef_command_line.rs index 0f5acc730617..1524296b6e1b 100644 --- a/servo/ports/cef/interfaces/cef_command_line.rs +++ b/servo/ports/cef/interfaces/cef_command_line.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_context_menu_handler.rs b/servo/ports/cef/interfaces/cef_context_menu_handler.rs index c70bed4e21d3..a3863c491bfe 100644 --- a/servo/ports/cef/interfaces/cef_context_menu_handler.rs +++ b/servo/ports/cef/interfaces/cef_context_menu_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_cookie.rs b/servo/ports/cef/interfaces/cef_cookie.rs index de4770490d10..4239c95c67e0 100644 --- a/servo/ports/cef/interfaces/cef_cookie.rs +++ b/servo/ports/cef/interfaces/cef_cookie.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_dialog_handler.rs b/servo/ports/cef/interfaces/cef_dialog_handler.rs index 98e1f6e9d6e5..029ecf9c3a03 100644 --- a/servo/ports/cef/interfaces/cef_dialog_handler.rs +++ b/servo/ports/cef/interfaces/cef_dialog_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_display_handler.rs b/servo/ports/cef/interfaces/cef_display_handler.rs index 664c2bf88917..4d90e2af6c00 100644 --- a/servo/ports/cef/interfaces/cef_display_handler.rs +++ b/servo/ports/cef/interfaces/cef_display_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_dom.rs b/servo/ports/cef/interfaces/cef_dom.rs index bd226731ce90..fc053c3bcf96 100644 --- a/servo/ports/cef/interfaces/cef_dom.rs +++ b/servo/ports/cef/interfaces/cef_dom.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_download_handler.rs b/servo/ports/cef/interfaces/cef_download_handler.rs index c65384340638..0757dfaf728d 100644 --- a/servo/ports/cef/interfaces/cef_download_handler.rs +++ b/servo/ports/cef/interfaces/cef_download_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_download_item.rs b/servo/ports/cef/interfaces/cef_download_item.rs index 2acda63dcd4e..9fca39432842 100644 --- a/servo/ports/cef/interfaces/cef_download_item.rs +++ b/servo/ports/cef/interfaces/cef_download_item.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_drag_data.rs b/servo/ports/cef/interfaces/cef_drag_data.rs index 385210f5d533..599727db6dd7 100644 --- a/servo/ports/cef/interfaces/cef_drag_data.rs +++ b/servo/ports/cef/interfaces/cef_drag_data.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_drag_handler.rs b/servo/ports/cef/interfaces/cef_drag_handler.rs index fbcd50089ad6..38dae28fefae 100644 --- a/servo/ports/cef/interfaces/cef_drag_handler.rs +++ b/servo/ports/cef/interfaces/cef_drag_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_focus_handler.rs b/servo/ports/cef/interfaces/cef_focus_handler.rs index f5114646b14b..5314ded7237b 100644 --- a/servo/ports/cef/interfaces/cef_focus_handler.rs +++ b/servo/ports/cef/interfaces/cef_focus_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_frame.rs b/servo/ports/cef/interfaces/cef_frame.rs index 2de1a1af4662..f22a8b682576 100644 --- a/servo/ports/cef/interfaces/cef_frame.rs +++ b/servo/ports/cef/interfaces/cef_frame.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_geolocation.rs b/servo/ports/cef/interfaces/cef_geolocation.rs index 8c044f5e04db..a2a07a3b862d 100644 --- a/servo/ports/cef/interfaces/cef_geolocation.rs +++ b/servo/ports/cef/interfaces/cef_geolocation.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_geolocation_handler.rs b/servo/ports/cef/interfaces/cef_geolocation_handler.rs index 18c93ed895af..5e98e92e8b06 100644 --- a/servo/ports/cef/interfaces/cef_geolocation_handler.rs +++ b/servo/ports/cef/interfaces/cef_geolocation_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_jsdialog_handler.rs b/servo/ports/cef/interfaces/cef_jsdialog_handler.rs index be9d47fa1ba7..4c03c07f5a31 100644 --- a/servo/ports/cef/interfaces/cef_jsdialog_handler.rs +++ b/servo/ports/cef/interfaces/cef_jsdialog_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_keyboard_handler.rs b/servo/ports/cef/interfaces/cef_keyboard_handler.rs index 0061984ced18..dc347e9dd371 100644 --- a/servo/ports/cef/interfaces/cef_keyboard_handler.rs +++ b/servo/ports/cef/interfaces/cef_keyboard_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_life_span_handler.rs b/servo/ports/cef/interfaces/cef_life_span_handler.rs index af9a9856a623..106ce028ae98 100644 --- a/servo/ports/cef/interfaces/cef_life_span_handler.rs +++ b/servo/ports/cef/interfaces/cef_life_span_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_load_handler.rs b/servo/ports/cef/interfaces/cef_load_handler.rs index d46e515c3eff..e242dc23fa3c 100644 --- a/servo/ports/cef/interfaces/cef_load_handler.rs +++ b/servo/ports/cef/interfaces/cef_load_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_menu_model.rs b/servo/ports/cef/interfaces/cef_menu_model.rs index b1757917f475..6f3df5a486c3 100644 --- a/servo/ports/cef/interfaces/cef_menu_model.rs +++ b/servo/ports/cef/interfaces/cef_menu_model.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_print_handler.rs b/servo/ports/cef/interfaces/cef_print_handler.rs index b8f36809dc0f..d5cabeae8dfb 100644 --- a/servo/ports/cef/interfaces/cef_print_handler.rs +++ b/servo/ports/cef/interfaces/cef_print_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_print_settings.rs b/servo/ports/cef/interfaces/cef_print_settings.rs index cd28e8d77847..1a79e25bcc57 100644 --- a/servo/ports/cef/interfaces/cef_print_settings.rs +++ b/servo/ports/cef/interfaces/cef_print_settings.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_process_message.rs b/servo/ports/cef/interfaces/cef_process_message.rs index da56b1f3bba3..ef6d896f2272 100644 --- a/servo/ports/cef/interfaces/cef_process_message.rs +++ b/servo/ports/cef/interfaces/cef_process_message.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_render_handler.rs b/servo/ports/cef/interfaces/cef_render_handler.rs index bae32a055b3b..9f982c908658 100644 --- a/servo/ports/cef/interfaces/cef_render_handler.rs +++ b/servo/ports/cef/interfaces/cef_render_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_render_process_handler.rs b/servo/ports/cef/interfaces/cef_render_process_handler.rs index 869082f8db4b..da4a513371a4 100644 --- a/servo/ports/cef/interfaces/cef_render_process_handler.rs +++ b/servo/ports/cef/interfaces/cef_render_process_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_request.rs b/servo/ports/cef/interfaces/cef_request.rs index 07a534e5e4c2..097065efa8d0 100644 --- a/servo/ports/cef/interfaces/cef_request.rs +++ b/servo/ports/cef/interfaces/cef_request.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_request_context.rs b/servo/ports/cef/interfaces/cef_request_context.rs index 0c55410507c2..e5de378a71e7 100644 --- a/servo/ports/cef/interfaces/cef_request_context.rs +++ b/servo/ports/cef/interfaces/cef_request_context.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_request_context_handler.rs b/servo/ports/cef/interfaces/cef_request_context_handler.rs index fc068697e0b7..a331d984709a 100644 --- a/servo/ports/cef/interfaces/cef_request_context_handler.rs +++ b/servo/ports/cef/interfaces/cef_request_context_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_request_handler.rs b/servo/ports/cef/interfaces/cef_request_handler.rs index 169f8c4a670a..b0aed69c0a71 100644 --- a/servo/ports/cef/interfaces/cef_request_handler.rs +++ b/servo/ports/cef/interfaces/cef_request_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_resource_bundle_handler.rs b/servo/ports/cef/interfaces/cef_resource_bundle_handler.rs index 4730a16981b6..680aa71eb693 100644 --- a/servo/ports/cef/interfaces/cef_resource_bundle_handler.rs +++ b/servo/ports/cef/interfaces/cef_resource_bundle_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_resource_handler.rs b/servo/ports/cef/interfaces/cef_resource_handler.rs index 715271adac6e..7f72737a86e4 100644 --- a/servo/ports/cef/interfaces/cef_resource_handler.rs +++ b/servo/ports/cef/interfaces/cef_resource_handler.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_response.rs b/servo/ports/cef/interfaces/cef_response.rs index 791572bb1c62..86140890396c 100644 --- a/servo/ports/cef/interfaces/cef_response.rs +++ b/servo/ports/cef/interfaces/cef_response.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_scheme.rs b/servo/ports/cef/interfaces/cef_scheme.rs index 62f71533ebc1..ecbfaa70ebb4 100644 --- a/servo/ports/cef/interfaces/cef_scheme.rs +++ b/servo/ports/cef/interfaces/cef_scheme.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_stream.rs b/servo/ports/cef/interfaces/cef_stream.rs index a1e748793d8b..07dc90bdf3b7 100644 --- a/servo/ports/cef/interfaces/cef_stream.rs +++ b/servo/ports/cef/interfaces/cef_stream.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_string_visitor.rs b/servo/ports/cef/interfaces/cef_string_visitor.rs index cb589e7850a7..1e98a4f96277 100644 --- a/servo/ports/cef/interfaces/cef_string_visitor.rs +++ b/servo/ports/cef/interfaces/cef_string_visitor.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_task.rs b/servo/ports/cef/interfaces/cef_task.rs index 19cf20a8633a..0f496a1cad50 100644 --- a/servo/ports/cef/interfaces/cef_task.rs +++ b/servo/ports/cef/interfaces/cef_task.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_trace.rs b/servo/ports/cef/interfaces/cef_trace.rs index 76000fc060af..e3e0ce524a26 100644 --- a/servo/ports/cef/interfaces/cef_trace.rs +++ b/servo/ports/cef/interfaces/cef_trace.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_urlrequest.rs b/servo/ports/cef/interfaces/cef_urlrequest.rs index 876bea289425..e08eacc55bec 100644 --- a/servo/ports/cef/interfaces/cef_urlrequest.rs +++ b/servo/ports/cef/interfaces/cef_urlrequest.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_v8.rs b/servo/ports/cef/interfaces/cef_v8.rs index 2672dcd07a17..8d404afe0ee6 100644 --- a/servo/ports/cef/interfaces/cef_v8.rs +++ b/servo/ports/cef/interfaces/cef_v8.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_values.rs b/servo/ports/cef/interfaces/cef_values.rs index 9eed34a61e26..dc9838232ccf 100644 --- a/servo/ports/cef/interfaces/cef_values.rs +++ b/servo/ports/cef/interfaces/cef_values.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_web_plugin.rs b/servo/ports/cef/interfaces/cef_web_plugin.rs index 5f4943d60772..ff13a130624b 100644 --- a/servo/ports/cef/interfaces/cef_web_plugin.rs +++ b/servo/ports/cef/interfaces/cef_web_plugin.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_xml_reader.rs b/servo/ports/cef/interfaces/cef_xml_reader.rs index eb453ce6ebe0..ed79167e9283 100644 --- a/servo/ports/cef/interfaces/cef_xml_reader.rs +++ b/servo/ports/cef/interfaces/cef_xml_reader.rs @@ -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! diff --git a/servo/ports/cef/interfaces/cef_zip_reader.rs b/servo/ports/cef/interfaces/cef_zip_reader.rs index 7f1c08e335fd..15c0527a0018 100644 --- a/servo/ports/cef/interfaces/cef_zip_reader.rs +++ b/servo/ports/cef/interfaces/cef_zip_reader.rs @@ -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! diff --git a/servo/ports/cef/lib.rs b/servo/ports/cef/lib.rs index 040c5991e9bf..6e0627b959b4 100644 --- a/servo/ports/cef/lib.rs +++ b/servo/ports/cef/lib.rs @@ -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)] diff --git a/servo/ports/cef/macros.rs b/servo/ports/cef/macros.rs index 97a42bcef179..605b92da6728 100644 --- a/servo/ports/cef/macros.rs +++ b/servo/ports/cef/macros.rs @@ -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)) diff --git a/servo/ports/cef/string.rs b/servo/ports/cef/string.rs index f758b907c25e..37cdafac7516 100644 --- a/servo/ports/cef/string.rs +++ b/servo/ports/cef/string.rs @@ -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::>(); 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::() == mem::size_of::() { 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::>(); 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::(); 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::>(); 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::>(); cef_string_wide_set(conv.as_ptr() as *const wchar_t, conv.len() as size_t, output, 1) } diff --git a/servo/ports/cef/string_list.rs b/servo/ports/cef/string_list.rs index 0e2912511bff..b41532731f8e 100644 --- a/servo/ports/cef/string_list.rs +++ b/servo/ports/cef/string_list.rs @@ -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) } } diff --git a/servo/ports/cef/string_map.rs b/servo/ports/cef/string_map.rs index 048f11484f9e..41225c9ed5a8 100644 --- a/servo/ports/cef/string_map.rs +++ b/servo/ports/cef/string_map.rs @@ -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; } diff --git a/servo/ports/cef/string_multimap.rs b/servo/ports/cef/string_multimap.rs index 1872c36d5411..d0ad3aa0b877 100644 --- a/servo/ports/cef/string_multimap.rs +++ b/servo/ports/cef/string_multimap.rs @@ -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(); diff --git a/servo/ports/cef/wrappers.rs b/servo/ports/cef/wrappers.rs index efc8ac8aaae2..99858f7887e9 100644 --- a/servo/ports/cef/wrappers.rs +++ b/servo/ports/cef/wrappers.rs @@ -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 for String { let buffer = libc::malloc((mem::size_of::() 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::() as libc::size_t) as *mut cef_string_utf16;