diff options
author | Vincent Sanders <vince@kyllikki.org> | 2012-11-03 22:56:55 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2012-11-03 22:56:55 +0000 |
commit | 9a3fcd5cdb1f72a2ec3ef9ac10a494dd97bc96d7 (patch) | |
tree | e029bbc557431611601105aeb21da2374bead55f /src/jsapi-libdom-property.c | |
parent | f6346cf8c8954843883f075cb25f1f3774504553 (diff) | |
download | nsgenbind-9a3fcd5cdb1f72a2ec3ef9ac10a494dd97bc96d7.tar.gz nsgenbind-9a3fcd5cdb1f72a2ec3ef9ac10a494dd97bc96d7.tar.bz2 |
take unsigned type modifier into account on webidl long (int32_t) types
Diffstat (limited to 'src/jsapi-libdom-property.c')
-rw-r--r-- | src/jsapi-libdom-property.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/jsapi-libdom-property.c b/src/jsapi-libdom-property.c index 702de15..6bd698d 100644 --- a/src/jsapi-libdom-property.c +++ b/src/jsapi-libdom-property.c @@ -251,6 +251,7 @@ static int output_return_declaration(struct binding *binding, struct webidl_node *type_node = NULL; struct webidl_node *type_base = NULL; struct webidl_node *type_name = NULL; + struct webidl_node *type_mod = NULL; enum webidl_type webidl_arg_type; type_node = webidl_node_find_type(webidl_node_getnode(node), @@ -306,7 +307,20 @@ static int output_return_declaration(struct binding *binding, case WEBIDL_TYPE_LONG: /* int32_t */ - fprintf(binding->outfile, "\tint32_t %s = 0;\n", ident); + type_mod = webidl_node_find_type(webidl_node_getnode(type_node), + NULL, + WEBIDL_NODE_TYPE_MODIFIER); + if ((type_mod != NULL) && + (webidl_node_getint(type_mod) == WEBIDL_TYPE_MODIFIER_UNSIGNED)) { + fprintf(binding->outfile, + "\tuint32_t %s = 0;\n", + ident); + } else { + fprintf(binding->outfile, + "\tint32_t %s = 0;\n", + ident); + } + break; case WEBIDL_TYPE_STRING: |