diff options
author | Vincent Sanders <vince@kyllikki.org> | 2012-11-18 21:06:08 +0000 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2012-11-18 21:06:08 +0000 |
commit | a044206384cb02aaaaab65f813878ddcd44b1dd1 (patch) | |
tree | 291cc8ddf2d0be9339171a04650fa33c3cf0e60f | |
parent | 3d3e27d666c7c35ab95f450c68766a9ba996a485 (diff) | |
download | nsgenbind-a044206384cb02aaaaab65f813878ddcd44b1dd1.tar.gz nsgenbind-a044206384cb02aaaaab65f813878ddcd44b1dd1.tar.bz2 |
add short property handling
-rw-r--r-- | src/jsapi-libdom-property.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/jsapi-libdom-property.c b/src/jsapi-libdom-property.c index e87620e..d96228a 100644 --- a/src/jsapi-libdom-property.c +++ b/src/jsapi-libdom-property.c @@ -192,7 +192,10 @@ static int output_return(struct binding *binding, break; case WEBIDL_TYPE_SHORT: - WARN(WARNING_UNIMPLEMENTED, "Unhandled type WEBIDL_TYPE_SHORT"); + /* int16_t */ + fprintf(binding->outfile, + "\tJS_SET_RVAL(cx, vp, INT_TO_JSVAL(%s));\n", + ident); break; case WEBIDL_TYPE_LONGLONG: @@ -296,7 +299,21 @@ static int output_return_declaration(struct binding *binding, break; case WEBIDL_TYPE_SHORT: - WARN(WARNING_UNIMPLEMENTED, "Unhandled type WEBIDL_TYPE_SHORT"); + /* int16_t */ + 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, + "\tuint16_t %s = 0;\n", + ident); + } else { + fprintf(binding->outfile, + "\tint16_t %s = 0;\n", + ident); + } + break; case WEBIDL_TYPE_LONGLONG: |