qapi: Avoid unnecessary use of enum lookup table's sentinel
commit1c236ba5319d6141964fddb38f1d942cebcaed05
authorMarkus Armbruster <armbru@redhat.com>
Thu, 24 Aug 2017 08:46:06 +0000 (24 10:46 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Mon, 4 Sep 2017 11:09:13 +0000 (4 13:09 +0200)
tree382b6dcf8bceacb9df4c3f23c34b05b2bf3b1c05
parent113e47ae6dc45b08e732dd5fa85abe71b764f5ae
qapi: Avoid unnecessary use of enum lookup table's sentinel

Currently, the FOO_lookup[] generated for QAPI enum types are
terminated by a NULL sentinel.

A future patch will generate enums with "holes".  NULL-termination
will cease to work then.

To prepare for that, replace "have we reached the sentinel?"
predicates by "have we reached the FOO__MAX value?" predicates.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-12-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
monitor.c
tests/test-qobject-input-visitor.c
tests/test-string-input-visitor.c
ui/input-legacy.c