scanner: enforce correct argument type for enums
authorAuke Booij <auke@tulcod.com>
Mon, 26 Oct 2015 19:39:52 +0000 (19:39 +0000)
committerBryce Harrington <bryce@osg.samsung.com>
Wed, 4 Nov 2015 22:51:43 +0000 (14:51 -0800)
commit1771299a5a965c1f95c18ef795c29db876133a81
treecc64a942ed5b7ad3635b94f8ef408dee902d3ad0
parent851614fa78862499e016c5718e730fefbb8e3b73
scanner: enforce correct argument type for enums

The scanner now checks whether arguments that have an associated
<enum> have the right type.
An argument with an enum attribute must be of type int or uint,
and if the <enum> with that name has the bitfield attribute
set to true, then the argument must be of type uint.

Changes since v3:
 - Remove useless allow_null check
 - Switch to using bool
 - Clearer message on errorous input
 - Minor formatting fix

Signed-off-by: Auke Booij <auke@tulcod.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Nils Chr. Brause <nilschrbrause@googlemail.com>
src/scanner.c