aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/script/dom/bindings/codegen/CodegenRust.py
diff options
context:
space:
mode:
authorSankha Narayan Guria <sankha93@gmail.com>2014-02-23 03:03:48 +0530
committerSankha Narayan Guria <sankha93@gmail.com>2014-02-23 03:03:48 +0530
commit47e6e6ec8f2dfbd56e50f9f2ec2762b85087d948 (patch)
tree51ab3c43698f0b526e7f708407220336e5e4b98b /src/components/script/dom/bindings/codegen/CodegenRust.py
parent061269f9639199a7419e2467ebbe3c28cac1e8ff (diff)
downloadservo-47e6e6ec8f2dfbd56e50f9f2ec2762b85087d948.tar.gz
servo-47e6e6ec8f2dfbd56e50f9f2ec2762b85087d948.zip
Be more explicit in casts of generated bindings
Diffstat (limited to 'src/components/script/dom/bindings/codegen/CodegenRust.py')
-rw-r--r--src/components/script/dom/bindings/codegen/CodegenRust.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py
index cb367a585f6..bcd9a4a2de4 100644
--- a/src/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/src/components/script/dom/bindings/codegen/CodegenRust.py
@@ -250,7 +250,7 @@ class CGMethodCall(CGThing):
# Doesn't matter which of the possible signatures we use, since
# they all have the same types up to that point; just use
# possibleSignatures[0]
- caseBody = [CGGeneric("let argv_start = JS_ARGV(cx, cast::transmute(vp));")]
+ caseBody = [CGGeneric("let argv_start = JS_ARGV(cx, vp as *JSVal);")]
caseBody.extend([ CGArgumentConverter(possibleSignatures[0][1][i],
i, "argv_start", "argc",
descriptor) for i in
@@ -1481,7 +1481,7 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
"}\n" +
successCode)
else:
- tail = "return JS_WrapValue(cx, cast::transmute(${jsvalPtr}));"
+ tail = "return JS_WrapValue(cx, ${jsvalPtr} as *JSVal);"
return ("${jsvalRef} = %s;\n" +
tail) % (value)
@@ -2802,7 +2802,7 @@ class CGGetPerInterfaceObject(CGAbstractMethod):
return ptr::null();
}*/
/* Check to see whether the interface objects are already installed */
- let protoOrIfaceArray: *mut *JSObject = cast::transmute(GetProtoOrIfaceArray(aGlobal));
+ let protoOrIfaceArray: *mut *JSObject = GetProtoOrIfaceArray(aGlobal) as *mut *JSObject;
let cachedObject: *JSObject = *protoOrIfaceArray.offset(%s as int);
if cachedObject.is_null() {
let tmp: *JSObject = CreateInterfaceObjects(aCx, aGlobal, aReceiver);
@@ -3072,7 +3072,7 @@ class CGPerSignatureCall(CGThing):
def getArgv(self):
return "argv" if self.argCount > 0 else ""
def getArgvDecl(self):
- return "\nlet argv = JS_ARGV(cx, cast::transmute(vp));\n"
+ return "\nlet argv = JS_ARGV(cx, vp as *JSVal);\n"
def getArgc(self):
return "argc"
def getArguments(self):
@@ -3232,7 +3232,7 @@ class CGAbstractBindingMethod(CGAbstractExternMethod):
def getThis(self):
return CGIndenter(
- CGGeneric("let obj: *JSObject = JS_THIS_OBJECT(cx, cast::transmute(vp));\n"
+ CGGeneric("let obj: *JSObject = JS_THIS_OBJECT(cx, vp as *mut JSVal);\n"
"if obj.is_null() {\n"
" return false as JSBool;\n"
"}\n"
@@ -3379,8 +3379,8 @@ class CGGenericSetter(CGAbstractBindingMethod):
def generate_code(self):
return CGIndenter(CGGeneric(
"let undef = JSVAL_VOID;\n"
- "let argv: *JSVal = if argc != 0 { JS_ARGV(cx, cast::transmute(vp)) } else { &undef as *JSVal };\n"
- "let info: *JSJitInfo = RUST_FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, cast::transmute(vp)));\n"
+ "let argv: *JSVal = if argc != 0 { JS_ARGV(cx, vp as *JSVal) } else { &undef as *JSVal };\n"
+ "let info: *JSJitInfo = RUST_FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp as *JSVal));\n"
"if CallJitPropertyOp(info, cx, obj, this as *libc::c_void, argv) == 0 {"
" return 0;\n"
"}\n"
@@ -4364,7 +4364,7 @@ if expando.is_not_null() {
}
if hasProp != 0 {
- return JS_GetPropertyById(cx, expando, id, cast::transmute(vp));
+ return JS_GetPropertyById(cx, expando, id, vp as *JSVal);
}
}"""
@@ -4402,7 +4402,7 @@ if expando.is_not_null() {
%s
let mut found = false;
-if !GetPropertyOnPrototype(cx, proxy, id, &mut found, cast::transmute(vp)) {
+if !GetPropertyOnPrototype(cx, proxy, id, &mut found, vp as *JSVal) {
return 0;
}