From a044206384cb02aaaaab65f813878ddcd44b1dd1 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 18 Nov 2012 21:06:08 +0000 Subject: add short property handling --- src/jsapi-libdom-property.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src') 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: -- cgit v1.2.3