diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-08-24 10:45:57 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-09-04 13:09:13 +0200 |
commit | 06c60b6c468ca7cde004fe7c3ce35de312855f55 (patch) | |
tree | 33e164badc15e320421ba47f5a26a622f4d85dee /qapi/qapi-util.c | |
parent | 64355088e0213b564eb6ef5d2658210accfcc32f (diff) | |
download | qemu-06c60b6c468ca7cde004fe7c3ce35de312855f55.zip qemu-06c60b6c468ca7cde004fe7c3ce35de312855f55.tar.gz qemu-06c60b6c468ca7cde004fe7c3ce35de312855f55.tar.bz2 |
qapi: Drop superfluous qapi_enum_parse() parameter max
The lookup tables have a sentinel, no need to make callers pass their
size.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-3-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Rebased, commit message corrected]
Diffstat (limited to 'qapi/qapi-util.c')
-rw-r--r-- | qapi/qapi-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qapi/qapi-util.c b/qapi/qapi-util.c index 46eda7d..ee7594f 100644 --- a/qapi/qapi-util.c +++ b/qapi/qapi-util.c @@ -16,7 +16,7 @@ #include "qapi/util.h" int qapi_enum_parse(const char * const lookup[], const char *buf, - int max, int def, Error **errp) + int def, Error **errp) { int i; @@ -24,7 +24,7 @@ int qapi_enum_parse(const char * const lookup[], const char *buf, return def; } - for (i = 0; i < max; i++) { + for (i = 0; lookup[i]; i++) { if (!strcmp(buf, lookup[i])) { return i; } |