diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-10-24 21:08:56 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-10-24 21:08:56 +0100 |
commit | 2c193d1fa01e116d7cdb1b5dd0f3cd8497bf7ef6 (patch) | |
tree | 821c06d3fa369971a4dc2f4edb827ebd656ea8d4 | |
parent | 0f8a9def0c9480c884da9c3021f55a8e30324e45 (diff) | |
download | nsgenbind-2c193d1fa01e116d7cdb1b5dd0f3cd8497bf7ef6.tar.gz nsgenbind-2c193d1fa01e116d7cdb1b5dd0f3cd8497bf7ef6.tar.bz2 |
improve unimplemented warning to include type modifier
-rw-r--r-- | src/duk-libdom-interface.c | 7 | ||||
-rw-r--r-- | src/webidl-ast.c | 14 | ||||
-rw-r--r-- | src/webidl-ast.h | 2 |
3 files changed, 16 insertions, 7 deletions
diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c index a57c520..77a58b0 100644 --- a/src/duk-libdom-interface.c +++ b/src/duk-libdom-interface.c @@ -1316,7 +1316,8 @@ output_attribute_getter(FILE* outf, "Unimplemented: getter %s::%s(%s);", interfacee->name, atributee->name, - webidl_type_to_str(atributee->base_type)); + webidl_type_to_str(atributee->type_modifier, + atributee->base_type)); if (options->dbglog) { fprintf(outf, "\tLOG(\"Unimplemented\");\n" ); @@ -1472,8 +1473,8 @@ output_attribute_setter(FILE* outf, "Unimplemented: setter %s::%s(%s);", interfacee->name, atributee->name, - webidl_type_to_str(atributee->base_type)); - + webidl_type_to_str(atributee->type_modifier, + atributee->base_type)); if (options->dbglog) { fprintf(outf, "\tLOG(\"Unimplemented\");\n" ); } diff --git a/src/webidl-ast.c b/src/webidl-ast.c index 08a8dcc..253a3ba 100644 --- a/src/webidl-ast.c +++ b/src/webidl-ast.c @@ -685,7 +685,7 @@ int webidl_intercalate_implements(struct webidl_node *webidl_ast) } /* exported interface defined in webidl-ast.h */ -const char *webidl_type_to_str(enum webidl_type t) +const char *webidl_type_to_str(enum webidl_type_modifier m, enum webidl_type t) { switch (t) { case WEBIDL_TYPE_ANY: /**< 0 - The type is unconstrained */ @@ -710,10 +710,18 @@ const char *webidl_type_to_str(enum webidl_type t) return "double"; case WEBIDL_TYPE_SHORT: /**< 7 - The type is a signed 16bit */ - return "short"; + if (m == WEBIDL_TYPE_MODIFIER_UNSIGNED) { + return "unsigned short"; + } else { + return "short"; + } case WEBIDL_TYPE_LONG: /**< 8 - The type is a signed 32bit */ - return "long"; + if (m == WEBIDL_TYPE_MODIFIER_UNSIGNED) { + return "unsigned long"; + } else { + return "long"; + } case WEBIDL_TYPE_LONGLONG: /**< 9 - The type is a signed 64bit */ return "long long"; diff --git a/src/webidl-ast.h b/src/webidl-ast.h index 0a8079b..bd9b313 100644 --- a/src/webidl-ast.h +++ b/src/webidl-ast.h @@ -166,6 +166,6 @@ int webidl_fprintf(FILE *stream, const char *format, ...); /** * get string of argument type */ -const char *webidl_type_to_str(enum webidl_type t); +const char *webidl_type_to_str(enum webidl_type_modifier m, enum webidl_type t); #endif |