summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2012-11-03 23:09:59 +0000
committerVincent Sanders <vince@kyllikki.org>2012-11-03 23:09:59 +0000
commita59c3f3baa6bf13f74429d0946f4dc768be94e15 (patch)
tree52d18ab4549f48b54b6d3aacc3c2704003168d7c
parent9a3fcd5cdb1f72a2ec3ef9ac10a494dd97bc96d7 (diff)
downloadnsgenbind-a59c3f3baa6bf13f74429d0946f4dc768be94e15.tar.gz
nsgenbind-a59c3f3baa6bf13f74429d0946f4dc768be94e15.tar.bz2
fix operator input variables on webidl long
-rw-r--r--src/jsapi-libdom-operator.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/jsapi-libdom-operator.c b/src/jsapi-libdom-operator.c
index e0be9eb..3183676 100644
--- a/src/jsapi-libdom-operator.c
+++ b/src/jsapi-libdom-operator.c
@@ -536,6 +536,7 @@ output_operation_input(struct binding *binding,
struct webidl_node *arg_ident = NULL;
struct webidl_node *arg_type = NULL;
struct webidl_node *arg_type_base = NULL;
+ struct webidl_node *type_mod = NULL;
enum webidl_type webidl_arg_type;
int arg_cur = 0; /* current position in the input argument vector */
@@ -611,9 +612,21 @@ output_operation_input(struct binding *binding,
case WEBIDL_TYPE_LONG:
/* int32_t */
- fprintf(binding->outfile,
- "\t%s = 0;\n",
- webidl_node_gettext(arg_ident));
+ type_mod = webidl_node_find_type(webidl_node_getnode(arg_type),
+ NULL,
+ WEBIDL_NODE_TYPE_MODIFIER);
+ if ((type_mod != NULL) &&
+ (webidl_node_getint(type_mod) == WEBIDL_TYPE_MODIFIER_UNSIGNED)) {
+ fprintf(binding->outfile,
+ "\tJS_ValueToECMAUint32(cx, argv[%d], &%s);\n",
+ arg_cur,
+ webidl_node_gettext(arg_ident));
+ } else {
+ fprintf(binding->outfile,
+ "\tJS_ValueToECMAInt32(cx, argv[%d], &%s);\n",
+ arg_cur,
+ webidl_node_gettext(arg_ident));
+ }
break;
case WEBIDL_TYPE_STRING: