Don't generate enums that end in a comma

svn path=/trunk/; revision=21888
This commit is contained in:
Jörg Mayer 2007-05-22 16:14:28 +00:00
parent 574eb87d18
commit 5e33afbf50
2 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/* Do not modify this file. */
/* It is created automatically by the ASN.1 to Wireshark dissector compiler */
/* .\packet-rnsap.c */
/* ./packet-rnsap.c */
/* ../../tools/asn2wrs.py -p rnsap -c rnsap.cnf -s packet-rnsap-template RNSAP-CommonDataTypes.asn RNSAP-Constants.asn RNSAP-Containers.asn RNSAP-IEs.asn RNSAP-PDU-Contents.asn RNSAP-PDU-Descriptions.asn */
/* Input file: packet-rnsap-template.c */
@ -211,7 +211,7 @@
typedef enum _DdMode_enum {
tdd = 0,
fdd = 1,
common = 2,
common = 2
} DdMode_enum;
typedef enum _ProtocolIE_ID_enum {
@ -744,7 +744,7 @@ typedef enum _ProtocolIE_ID_enum {
id_HS_PDSCH_Code_Change_Grant = 680,
id_HS_PDSCH_Code_Change_Indicator = 681,
id_SixtyfourQAM_DL_SupportIndicator = 684,
id_eDCH_MACdFlow_Retransmission_Timer_LCR = 694,
id_eDCH_MACdFlow_Retransmission_Timer_LCR = 694
} ProtocolIE_ID_enum;
/*--- End of included file: packet-rnsap-val.h ---*/

View File

@ -1080,9 +1080,14 @@ class EthCtx:
out += '#define %-12s %3s\n' % (self.eth_enum_item(tname, id), val)
else:
out += "typedef enum _%s {\n" % (self.eth_enum_nm(tname))
first_line = 1
for (val, id) in vals:
out += ' %-12s = %3s,\n' % (self.eth_enum_item(tname, id), val)
out += "} %s;\n" % (self.eth_enum_nm(tname))
if (first_line == 1):
first_line = 0
else:
out += ",\n"
out += ' %-12s = %3s' % (self.eth_enum_item(tname, id), val)
out += "\n} %s;\n" % (self.eth_enum_nm(tname))
return out
#--- eth_bits ---------------------------------------------------------------