mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Stop using int/uint in script.
This commit is contained in:
parent
74f8c0eeb7
commit
c2e81be8a5
12 changed files with 23 additions and 24 deletions
|
@ -1040,7 +1040,7 @@ class CGArgumentConverter(CGThing):
|
||||||
else:
|
else:
|
||||||
assert argument.optional
|
assert argument.optional
|
||||||
variadicConversion = {
|
variadicConversion = {
|
||||||
"val": string.Template("(*${argv}.offset(variadicArg as int))").substitute(replacer),
|
"val": string.Template("(*${argv}.offset(variadicArg as isize))").substitute(replacer),
|
||||||
}
|
}
|
||||||
innerConverter = instantiateJSToNativeConversionTemplate(
|
innerConverter = instantiateJSToNativeConversionTemplate(
|
||||||
template, variadicConversion, declType, "slot",
|
template, variadicConversion, declType, "slot",
|
||||||
|
|
|
@ -321,7 +321,7 @@ impl RootedCollectionSet {
|
||||||
ROOTED_COLLECTIONS.with(|ref collections| {
|
ROOTED_COLLECTIONS.with(|ref collections| {
|
||||||
let type_ = VecRootableType::tag(None::<T>);
|
let type_ = VecRootableType::tag(None::<T>);
|
||||||
let mut collections = collections.borrow_mut();
|
let mut collections = collections.borrow_mut();
|
||||||
assert!(collections.set[type_ as uint].remove(&(collection as *const _ as *const _)));
|
assert!(collections.set[type_ as usize].remove(&(collection as *const _ as *const _)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +329,7 @@ impl RootedCollectionSet {
|
||||||
ROOTED_COLLECTIONS.with(|ref collections| {
|
ROOTED_COLLECTIONS.with(|ref collections| {
|
||||||
let type_ = VecRootableType::tag(None::<T>);
|
let type_ = VecRootableType::tag(None::<T>);
|
||||||
let mut collections = collections.borrow_mut();
|
let mut collections = collections.borrow_mut();
|
||||||
collections.set[type_ as uint].insert(collection as *const _ as *const _);
|
collections.set[type_ as usize].insert(collection as *const _ as *const _);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,15 +345,15 @@ impl RootedCollectionSet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let dom_collections = &self.set[CollectionType::DOMObjects as uint] as *const _ as *const HashSet<*const RootedVec<*const Reflector>>;
|
let dom_collections = &self.set[CollectionType::DOMObjects as usize] as *const _ as *const HashSet<*const RootedVec<*const Reflector>>;
|
||||||
for dom_collection in (*dom_collections).iter() {
|
for dom_collection in (*dom_collections).iter() {
|
||||||
for reflector in (**dom_collection).iter() {
|
for reflector in (**dom_collection).iter() {
|
||||||
trace_reflector(tracer, "", &**reflector);
|
trace_reflector(tracer, "", &**reflector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trace_collection_type::<JSVal>(tracer, &self.set[CollectionType::JSVals as uint]);
|
trace_collection_type::<JSVal>(tracer, &self.set[CollectionType::JSVals as usize]);
|
||||||
trace_collection_type::<*mut JSObject>(tracer, &self.set[CollectionType::JSObjects as uint]);
|
trace_collection_type::<*mut JSObject>(tracer, &self.set[CollectionType::JSObjects as usize]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ use std::ptr;
|
||||||
#[privatize]
|
#[privatize]
|
||||||
pub struct BrowserContext {
|
pub struct BrowserContext {
|
||||||
history: Vec<SessionHistoryEntry>,
|
history: Vec<SessionHistoryEntry>,
|
||||||
active_index: uint,
|
active_index: usize,
|
||||||
window_proxy: *mut JSObject,
|
window_proxy: *mut JSObject,
|
||||||
frame_element: Option<JS<Element>>,
|
frame_element: Option<JS<Element>>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -339,7 +339,7 @@ impl<'a> DocumentHelpers<'a> for JSRef<'a, Document> {
|
||||||
let elements = entry.into_mut();
|
let elements = entry.into_mut();
|
||||||
|
|
||||||
let new_node: JSRef<Node> = NodeCast::from_ref(element);
|
let new_node: JSRef<Node> = NodeCast::from_ref(element);
|
||||||
let mut head: uint = 0u;
|
let mut head: usize = 0;
|
||||||
let root: JSRef<Node> = NodeCast::from_ref(root.r());
|
let root: JSRef<Node> = NodeCast::from_ref(root.r());
|
||||||
for node in root.traverse_preorder() {
|
for node in root.traverse_preorder() {
|
||||||
let elem: Option<JSRef<Element>> = ElementCast::to_ref(node);
|
let elem: Option<JSRef<Element>> = ElementCast::to_ref(node);
|
||||||
|
|
|
@ -63,7 +63,7 @@ impl<'a> ImageDataHelpers for JSRef<'a, ImageData> {
|
||||||
let cx = global.get_cx();
|
let cx = global.get_cx();
|
||||||
let data: *const uint8_t = JS_GetUint8ClampedArrayData(self.Data(cx), cx) as *const uint8_t;
|
let data: *const uint8_t = JS_GetUint8ClampedArrayData(self.Data(cx), cx) as *const uint8_t;
|
||||||
let len = self.Width() * self.Height() * 4;
|
let len = self.Width() * self.Height() * 4;
|
||||||
slice::from_raw_parts(data, len as uint).to_vec()
|
slice::from_raw_parts(data, len as usize).to_vec()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ impl<'a> NamedNodeMapMethods for JSRef<'a, NamedNodeMap> {
|
||||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||||
let owner = owner.r();
|
let owner = owner.r();
|
||||||
let attrs = owner.attrs();
|
let attrs = owner.attrs();
|
||||||
attrs.as_slice().get(index as uint).map(|x| Temporary::new(x.clone()))
|
attrs.as_slice().get(index as usize).map(|x| Temporary::new(x.clone()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn IndexedGetter(self, index: u32, found: &mut bool) -> Option<Temporary<Attr>> {
|
fn IndexedGetter(self, index: u32, found: &mut bool) -> Option<Temporary<Attr>> {
|
||||||
|
|
|
@ -475,7 +475,7 @@ pub trait NodeHelpers<'a> {
|
||||||
fn dirty_impl(self, damage: NodeDamage, force_ancestors: bool);
|
fn dirty_impl(self, damage: NodeDamage, force_ancestors: bool);
|
||||||
|
|
||||||
fn dump(self);
|
fn dump(self);
|
||||||
fn dump_indent(self, indent: uint);
|
fn dump_indent(self, indent: u32);
|
||||||
fn debug_str(self) -> String;
|
fn debug_str(self) -> String;
|
||||||
|
|
||||||
fn traverse_preorder(self) -> TreeIterator<'a>;
|
fn traverse_preorder(self) -> TreeIterator<'a>;
|
||||||
|
@ -514,9 +514,9 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Dumps the node tree, for debugging, with indentation.
|
/// Dumps the node tree, for debugging, with indentation.
|
||||||
fn dump_indent(self, indent: uint) {
|
fn dump_indent(self, indent: u32) {
|
||||||
let mut s = String::new();
|
let mut s = String::new();
|
||||||
for _ in range(0, indent) {
|
for _ in 0..indent {
|
||||||
s.push_str(" ");
|
s.push_str(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
|
||||||
// FIXME: this should have a pure version?
|
// FIXME: this should have a pure version?
|
||||||
for kid in self.children() {
|
for kid in self.children() {
|
||||||
let kid = kid.root();
|
let kid = kid.root();
|
||||||
kid.r().dump_indent(indent + 1u)
|
kid.r().dump_indent(indent + 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -886,10 +886,10 @@ impl<'a> NodeHelpers<'a> for JSRef<'a, Node> {
|
||||||
uniqueId: unique_id.clone(),
|
uniqueId: unique_id.clone(),
|
||||||
baseURI: self.GetBaseURI().unwrap_or("".to_owned()),
|
baseURI: self.GetBaseURI().unwrap_or("".to_owned()),
|
||||||
parent: self.GetParentNode().root().map(|node| node.r().get_unique_id()).unwrap_or("".to_owned()),
|
parent: self.GetParentNode().root().map(|node| node.r().get_unique_id()).unwrap_or("".to_owned()),
|
||||||
nodeType: self.NodeType() as uint,
|
nodeType: self.NodeType() as usize,
|
||||||
namespaceURI: "".to_owned(), //FIXME
|
namespaceURI: "".to_owned(), //FIXME
|
||||||
nodeName: self.NodeName(),
|
nodeName: self.NodeName(),
|
||||||
numChildren: self.ChildNodes().root().r().Length() as uint,
|
numChildren: self.ChildNodes().root().r().Length() as usize,
|
||||||
|
|
||||||
//FIXME doctype nodes only
|
//FIXME doctype nodes only
|
||||||
name: "".to_owned(),
|
name: "".to_owned(),
|
||||||
|
|
|
@ -51,7 +51,7 @@ impl<'a> PerformanceMethods for JSRef<'a, Performance> {
|
||||||
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
|
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
|
||||||
fn Now(self) -> DOMHighResTimeStamp {
|
fn Now(self) -> DOMHighResTimeStamp {
|
||||||
let navStart = self.timing.root().r().NavigationStartPrecise();
|
let navStart = self.timing.root().r().NavigationStartPrecise();
|
||||||
let now = (time::precise_time_ns() as f64 - navStart) * 1000000u as f64;
|
let now = (time::precise_time_ns() as f64 - navStart) * 1000000 as f64;
|
||||||
Finite::wrap(now)
|
Finite::wrap(now)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,7 @@ impl<'a> PrivateTreeWalkerHelpers for JSRef<'a, TreeWalker> {
|
||||||
fn accept_node(self, node: JSRef<Node>) -> Fallible<u16> {
|
fn accept_node(self, node: JSRef<Node>) -> Fallible<u16> {
|
||||||
// "To filter node run these steps:"
|
// "To filter node run these steps:"
|
||||||
// "1. Let n be node's nodeType attribute value minus 1."
|
// "1. Let n be node's nodeType attribute value minus 1."
|
||||||
let n: uint = node.NodeType() as uint - 1;
|
let n = node.NodeType() - 1;
|
||||||
// "2. If the nth bit (where 0 is the least significant bit) of whatToShow is not set,
|
// "2. If the nth bit (where 0 is the least significant bit) of whatToShow is not set,
|
||||||
// return FILTER_SKIP."
|
// return FILTER_SKIP."
|
||||||
if (self.what_to_show & (1 << n)) == 0 {
|
if (self.what_to_show & (1 << n)) == 0 {
|
||||||
|
|
|
@ -94,7 +94,7 @@ impl Runnable for XHRProgressHandler {
|
||||||
|
|
||||||
#[derive(PartialEq, Clone, Copy)]
|
#[derive(PartialEq, Clone, Copy)]
|
||||||
#[jstraceable]
|
#[jstraceable]
|
||||||
pub struct GenerationId(uint);
|
pub struct GenerationId(u32);
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub enum XHRProgress {
|
pub enum XHRProgress {
|
||||||
|
@ -148,7 +148,7 @@ pub struct XMLHttpRequest {
|
||||||
request_method: DOMRefCell<Method>,
|
request_method: DOMRefCell<Method>,
|
||||||
request_url: DOMRefCell<Option<Url>>,
|
request_url: DOMRefCell<Option<Url>>,
|
||||||
request_headers: DOMRefCell<Headers>,
|
request_headers: DOMRefCell<Headers>,
|
||||||
request_body_len: Cell<uint>,
|
request_body_len: Cell<usize>,
|
||||||
sync: Cell<bool>,
|
sync: Cell<bool>,
|
||||||
upload_complete: Cell<bool>,
|
upload_complete: Cell<bool>,
|
||||||
upload_events: Cell<bool>,
|
upload_events: Cell<bool>,
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#![feature(collections)]
|
#![feature(collections)]
|
||||||
#![feature(core)]
|
#![feature(core)]
|
||||||
#![feature(custom_attribute)]
|
#![feature(custom_attribute)]
|
||||||
#![feature(int_uint)]
|
|
||||||
#![feature(old_io)]
|
#![feature(old_io)]
|
||||||
#![feature(path)]
|
#![feature(path)]
|
||||||
#![feature(plugin)]
|
#![feature(plugin)]
|
||||||
|
|
|
@ -225,9 +225,9 @@ impl TextInput {
|
||||||
if adjust.abs() as usize > remaining && self.edit_point.line > 0 {
|
if adjust.abs() as usize > remaining && self.edit_point.line > 0 {
|
||||||
self.adjust_vertical(-1, select);
|
self.adjust_vertical(-1, select);
|
||||||
self.edit_point.index = self.current_line_length();
|
self.edit_point.index = self.current_line_length();
|
||||||
self.adjust_horizontal(adjust + remaining as int + 1, select);
|
self.adjust_horizontal(adjust + remaining as isize + 1, select);
|
||||||
} else {
|
} else {
|
||||||
self.edit_point.index = max(0, self.edit_point.index as int + adjust) as usize;
|
self.edit_point.index = max(0, self.edit_point.index as isize + adjust) as usize;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let remaining = self.current_line_length() - self.edit_point.index;
|
let remaining = self.current_line_length() - self.edit_point.index;
|
||||||
|
@ -235,7 +235,7 @@ impl TextInput {
|
||||||
self.adjust_vertical(1, select);
|
self.adjust_vertical(1, select);
|
||||||
self.edit_point.index = 0;
|
self.edit_point.index = 0;
|
||||||
// one shift is consumed by the change of line, hence the -1
|
// one shift is consumed by the change of line, hence the -1
|
||||||
self.adjust_horizontal(adjust - remaining as int - 1, select);
|
self.adjust_horizontal(adjust - remaining as isize - 1, select);
|
||||||
} else {
|
} else {
|
||||||
self.edit_point.index = min(self.current_line_length(),
|
self.edit_point.index = min(self.current_line_length(),
|
||||||
self.edit_point.index + adjust as usize);
|
self.edit_point.index + adjust as usize);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue