api: start enum values from 0 94/36194/1
authorFilip Varga <fivarga@cisco.com>
Mon, 23 May 2022 19:18:38 +0000 (21:18 +0200)
committerFilip Varga <fivarga@cisco.com>
Tue, 24 May 2022 10:36:29 +0000 (12:36 +0200)
C enum values by default start from 0.
All unassigned names should get value as value of previous name plus one.
The problem was that default value was 0 and adding one for the first
value would make generated api files start from 1 instead of 0.

Type: fix

Change-Id: I772d6411435648de3ec514f57025ef1acae87338
Signed-off-by: Filip Varga <fivarga@cisco.com>
src/tools/vppapigen/vppapigen.py

index c7bc681..944bf5e 100755 (executable)
@@ -362,7 +362,7 @@ class Enum(Processable):
         self.vla = False
         self.manual_print = False
 
-        count = 0
+        count = -1
         block2 = []
         block3 = []
         bc_set = False