mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
fix dom bindings for android(and 32bit system) build
This commit is contained in:
parent
730c10e6aa
commit
da2ccb048e
3 changed files with 5 additions and 5 deletions
|
@ -1563,7 +1563,7 @@ for (uint32_t i = 0; i < length; ++i) {
|
|||
raise TypeError("We don't support nullable enumerated return types "
|
||||
"yet")
|
||||
return ("""assert!((%(result)s as uint) < %(strings)s.len());
|
||||
let %(resultStr)s: *JSString = JS_NewStringCopyN(cx, ptr::to_unsafe_ptr(&%(strings)s[%(result)s as u32].value[0]) as *i8, %(strings)s[%(result)s as u32].length as u64);
|
||||
let %(resultStr)s: *JSString = JS_NewStringCopyN(cx, ptr::to_unsafe_ptr(&%(strings)s[%(result)s as u32].value[0]) as *i8, %(strings)s[%(result)s as u32].length as libc::size_t);
|
||||
if %(resultStr)s.is_null() {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ pub fn _obj_toString(cx: *JSContext, className: *libc::c_char) -> *JSString {
|
|||
unsafe {
|
||||
let name = str::raw::from_c_str(className);
|
||||
let nchars = "[object ]".len() + name.len();
|
||||
let chars: *mut jschar = cast::transmute(JS_malloc(cx, (nchars + 1) as u64 * (size_of::<jschar>() as u64)));
|
||||
let chars: *mut jschar = cast::transmute(JS_malloc(cx, (nchars + 1) as libc::size_t * (size_of::<jschar>() as libc::size_t)));
|
||||
if chars.is_null() {
|
||||
return ptr::null();
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ pub fn _obj_toString(cx: *JSContext, className: *libc::c_char) -> *JSString {
|
|||
*chars.offset(i as int) = c as jschar;
|
||||
}
|
||||
*chars.offset(nchars as int) = 0;
|
||||
let jsstr = JS_NewUCString(cx, cast::transmute(chars), nchars as u64);
|
||||
let jsstr = JS_NewUCString(cx, cast::transmute(chars), nchars as libc::size_t);
|
||||
if jsstr.is_null() {
|
||||
JS_free(cx, cast::transmute(chars));
|
||||
}
|
||||
|
|
|
@ -37,8 +37,8 @@ use js::{JSPROP_SETTER, JSVAL_VOID, JSVAL_TRUE, JSVAL_FALSE};
|
|||
use js::{JS_THIS_OBJECT, JSFUN_CONSTRUCTOR, JS_CALLEE, JSPROP_READONLY};
|
||||
use js;
|
||||
|
||||
static TOSTRING_CLASS_RESERVED_SLOT: u64 = 0;
|
||||
static TOSTRING_NAME_RESERVED_SLOT: u64 = 1;
|
||||
static TOSTRING_CLASS_RESERVED_SLOT: libc::size_t = 0;
|
||||
static TOSTRING_NAME_RESERVED_SLOT: libc::size_t = 1;
|
||||
|
||||
struct GlobalStaticData {
|
||||
proxy_handlers: HashMap<uint, *libc::c_void>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue