From 8c8acc027871f97370ee549306876690030c3bbb Mon Sep 17 00:00:00 2001 From: Ole Troan Date: Tue, 27 Nov 2018 10:05:23 +0100 Subject: API: Change ip4_address and ip6_address to use type alias. Change-Id: Id8669bbadd1d6b2054865a310a654e9b38d1667d Signed-off-by: Ole Troan --- src/vpp-api/vapi/vapi_c_gen.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/vpp-api/vapi/vapi_c_gen.py') diff --git a/src/vpp-api/vapi/vapi_c_gen.py b/src/vpp-api/vapi/vapi_c_gen.py index 9939bc0556c..490b83028da 100755 --- a/src/vpp-api/vapi/vapi_c_gen.py +++ b/src/vpp-api/vapi/vapi_c_gen.py @@ -10,7 +10,7 @@ from vapi_json_parser import Field, Struct, Enum, Union, Message, JsonParser,\ class CField(Field): def get_c_name(self): - return self.name + return "vapi_type_%s" % self.name def get_c_def(self): if self.len is not None: @@ -100,14 +100,14 @@ class CField(Field): class CAlias(CField): def get_c_name(self): - return self.name + return "vapi_type_%s" % self.name def get_c_def(self): - return "typedef %s" % super(CAlias, self).get_c_def() - # if self.len is not None: - # return "typedef %s %s[%d];" % (self.type.get_c_name(), self.name, self.len) - # else: - # return "typedef %s %s;" % (self.type.get_c_name(), self.name) + if self.len is not None: + return "typedef %s vapi_type_%s[%d];" % (self.type.get_c_name(), self.name, self.len) + else: + return "typedef %s vapi_type_%s;" % (self.type.get_c_name(), self.name) + #return "typedef %s" % super(CAlias, self).get_c_def() # def needs_byte_swap -- cgit 1.2.3-korg