Message ID | 1435782155-31412-5-git-send-email-armbru@redhat.com |
---|---|
State | New |
Headers | show |
On 07/01/2015 02:21 PM, Markus Armbruster wrote: > Use c_name() instead of ad hoc code. Doesn't upcase the -p prefix, > which is an improvement in my book. Unbreaks prefix containing '.', > but other funny characters remain broken. To be fixed next. > > Signed-off-by: Markus Armbruster <armbru@redhat.com> > --- > scripts/qapi-event.py | 2 +- > tests/test-qmp-event.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) No change to the generated qapi-event.[ch], so it looks like only the testsuite is affected. [In fact, as far as I can tell, only docs/qapi-code-gen.txt and tests/Makefile even take advantage of the '-p prefix' argument.] Fine by me. Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py index 56bc602..cc74f4d 100644 --- a/scripts/qapi-event.py +++ b/scripts/qapi-event.py @@ -267,7 +267,7 @@ fdecl.write(mcgen(''' exprs = parse_schema(input_file) -event_enum_name = prefix.upper().replace('-', '_') + "QAPIEvent" +event_enum_name = c_name(prefix + "QAPIEvent", protect=False) event_enum_values = [] event_enum_strings = [] diff --git a/tests/test-qmp-event.c b/tests/test-qmp-event.c index 1ee40e1..28f146d 100644 --- a/tests/test-qmp-event.c +++ b/tests/test-qmp-event.c @@ -94,7 +94,7 @@ static bool qdict_cmp_simple(QDict *a, QDict *b) /* This function is hooked as final emit function, which can verify the correctness. */ -static void event_test_emit(TEST_QAPIEvent event, QDict *d, Error **errp) +static void event_test_emit(test_QAPIEvent event, QDict *d, Error **errp) { QObject *obj; QDict *t;
Use c_name() instead of ad hoc code. Doesn't upcase the -p prefix, which is an improvement in my book. Unbreaks prefix containing '.', but other funny characters remain broken. To be fixed next. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- scripts/qapi-event.py | 2 +- tests/test-qmp-event.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)