From 6d467b3ad530bef468a1ab3c6f80a6c2ab6e08d8 Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Sun, 13 Dec 2020 04:12:55 +0000 Subject: 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 --- src/tools/vppapigen/vppapigen.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/tools/vppapigen') 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): -- cgit 1.2.3-korg