aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2007-05-22 16:14:28 +0000
committerJörg Mayer <jmayer@loplof.de>2007-05-22 16:14:28 +0000
commit5e33afbf50f7690a39415e0e4696ddbbbc64caff (patch)
tree517d8a2cd037dd36f3a0d9ad3f04a05d72d04c1a /tools
parent574eb87d1863495eb2c31d2f94ac05c8842009b3 (diff)
Don't generate enums that end in a comma
svn path=/trunk/; revision=21888
Diffstat (limited to 'tools')
-rwxr-xr-xtools/asn2wrs.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/asn2wrs.py b/tools/asn2wrs.py
index 0b16183556..ec2664cbf2 100755
--- a/tools/asn2wrs.py
+++ b/tools/asn2wrs.py
@@ -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 ---------------------------------------------------------------