summaryrefslogtreecommitdiffstats
path: root/src/tools/vppapigen
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2020-12-13 04:12:55 +0000
committerOle Tr�an <otroan@employees.org>2021-02-03 07:43:35 +0000
commit6d467b3ad530bef468a1ab3c6f80a6c2ab6e08d8 (patch)
treeca7468556c5660d315d58ce4c70d9ac55971996f /src/tools/vppapigen
parente988726cbfb1b1f618c4034aa16e41364f9c48a2 (diff)
vppapigen: fix enum types
enums can return signed or unsigned integers enumflags are unsigned integers Type: fix Change-Id: Iafc8f8f09c96679c5983d2cb807699fcf90ca0d7 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/tools/vppapigen')
-rwxr-xr-xsrc/tools/vppapigen/vppapigen.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/vppapigen/vppapigen.py b/src/tools/vppapigen/vppapigen.py
index 0782dd294ab..eabf8f0644d 100755
--- a/src/tools/vppapigen/vppapigen.py
+++ b/src/tools/vppapigen/vppapigen.py
@@ -719,7 +719,7 @@ class VPPAPIParser(object):
p[0] = EnumFlag(p[2], p[4])
def p_enumflag_type(self, p):
- ''' enumflag : ENUMFLAG ID ':' enum_size '{' enum_statements '}' ';' ''' # noqa : E502
+ ''' enumflag : ENUMFLAG ID ':' enumflag_size '{' enum_statements '}' ';' ''' # noqa : E502
if len(p) == 9:
p[0] = EnumFlag(p[2], p[6], enumtype=p[4])
else:
@@ -728,7 +728,16 @@ class VPPAPIParser(object):
def p_enum_size(self, p):
''' enum_size : U8
| U16
- | U32 '''
+ | U32
+ | I8
+ | I16
+ | I32 '''
+ p[0] = p[1]
+
+ def p_enumflag_size(self, p):
+ ''' enumflag_size : U8
+ | U16
+ | U32 '''
p[0] = p[1]
def p_define(self, p):