summaryrefslogtreecommitdiff
path: root/librabbitmq/codegen.py
diff options
context:
space:
mode:
Diffstat (limited to 'librabbitmq/codegen.py')
-rw-r--r--librabbitmq/codegen.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/librabbitmq/codegen.py b/librabbitmq/codegen.py
index 7683783..7aea9f4 100644
--- a/librabbitmq/codegen.py
+++ b/librabbitmq/codegen.py
@@ -167,9 +167,12 @@ def genErl(spec):
def genDecodeMethodFields(m):
print " case %s: {" % (m.defName(),)
- print " %s *m = (%s *) amqp_pool_alloc(pool, sizeof(%s));" % \
- (m.structName(), m.structName(), m.structName())
- print " if (m == NULL) { return -ENOMEM; }"
+ if m.arguments:
+ print " %s *m = (%s *) amqp_pool_alloc(pool, sizeof(%s));" % \
+ (m.structName(), m.structName(), m.structName())
+ print " if (m == NULL) { return -ENOMEM; }"
+ else:
+ print " %s *m = NULL; /* no fields */" % (m.structName(),)
bitindex = None
for f in m.arguments:
if spec.resolveDomain(f.domain) == 'bit':