X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvapi%2Fvapi_c_gen.py;h=490b83028da91a134d787b97756e80d56f530a04;hb=8c8acc027871f97370ee549306876690030c3bbb;hp=9939bc0556c625285a889661e022feb269647bef;hpb=1f0dd7a0664bc217b7d69773574ac7eae3813bd7;p=vpp.git 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