mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace uint/int by usize/isize in various places.
This commit is contained in:
parent
9c863a6bd4
commit
6d30ec77c8
14 changed files with 36 additions and 34 deletions
|
@ -335,7 +335,7 @@ pub unsafe extern fn throwing_constructor(cx: *mut JSContext, _argc: c_uint,
|
|||
/// Fails if the argument is not a DOM global.
|
||||
pub fn initialize_global(global: *mut JSObject) {
|
||||
let proto_array = box ()
|
||||
([0 as *mut JSObject; PrototypeList::ID::Count as uint]);
|
||||
([0 as *mut JSObject; PrototypeList::ID::Count as usize]);
|
||||
unsafe {
|
||||
assert!(((*JS_GetClass(global)).flags & JSCLASS_DOM_GLOBAL) != 0);
|
||||
let box_ = boxed::into_raw(proto_array);
|
||||
|
@ -460,7 +460,7 @@ pub fn get_array_index_from_id(_cx: *mut JSContext, id: jsid) -> Option<u32> {
|
|||
pub fn find_enum_string_index(cx: *mut JSContext,
|
||||
v: JSVal,
|
||||
values: &[&'static str])
|
||||
-> Result<Option<uint>, ()> {
|
||||
-> Result<Option<usize>, ()> {
|
||||
unsafe {
|
||||
let jsstr = JS_ValueToString(cx, v);
|
||||
if jsstr.is_null() {
|
||||
|
@ -474,9 +474,9 @@ pub fn find_enum_string_index(cx: *mut JSContext,
|
|||
}
|
||||
|
||||
Ok(values.iter().position(|value| {
|
||||
value.len() == length as uint &&
|
||||
range(0, length as uint).all(|j| {
|
||||
value.as_bytes()[j] as u16 == *chars.offset(j as int)
|
||||
value.len() == length as usize &&
|
||||
range(0, length as usize).all(|j| {
|
||||
value.as_bytes()[j] as u16 == *chars.offset(j as isize)
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue