diff options
author | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-04-20 18:21:16 +1200 |
---|---|---|
committer | Tony Garnock-Jones <tonygarnockjones@gmail.com> | 2010-04-20 18:21:16 +1200 |
commit | 76adcc251cb7f36ae45f905302be1070bbec5ece (patch) | |
tree | 5eee1e3b40773f309b87afd935c4771731fe3486 | |
parent | 87842e22068717f722241804d2da2a0eb7e83070 (diff) | |
parent | db3c67727ea1dc2a6d182b5e622e94795b2b8f3b (diff) | |
download | rabbitmq-c-github-ask-76adcc251cb7f36ae45f905302be1070bbec5ece.tar.gz |
Merge default into amqp_0_9_1
-rw-r--r-- | librabbitmq/codegen.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/librabbitmq/codegen.py b/librabbitmq/codegen.py index aa34469..792a6cf 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': |