mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
Stop using int/uint in CEF.
This commit is contained in:
parent
1e45d025b3
commit
de94e39ff7
59 changed files with 131 additions and 131 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue