From: Niels Provos Date: Thu, 13 Dec 2007 06:36:54 +0000 (+0000) Subject: fix a bug with event_rpcgen for integers X-Git-Tag: release-2.0.1-alpha~455 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=850534734be9e18ed24630d506bc252816229b77;p=libevent fix a bug with event_rpcgen for integers svn:r588 --- diff --git a/ChangeLog b/ChangeLog index 934fafec..60278ece 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ Changes in current version: o support for 32-bit tag numbers in rpc structures; this is wire compatible, but changes the API slightly. o pull setters/getters out of RPC structures into a base class to which we just need to store a pointer; this reduces the memory footprint of these structures. o prefix {encode,decode}_tag functions with evtag to avoid collisions + o fix a bug with event_rpcgen for integers Changes in 1.4.0: diff --git a/event_rpcgen.py b/event_rpcgen.py index 1ff55e73..00dc755a 100755 --- a/event_rpcgen.py +++ b/event_rpcgen.py @@ -555,6 +555,10 @@ class EntryInt(Entry): return dcl + def CodeNew(self, name): + code = ['%s->%s_data = 0;' % (name, self._name)] + return code + class EntryString(Entry): def __init__(self, type, name, tag): # Init base class diff --git a/test/regress.rpc b/test/regress.rpc index 52a2104b..0400d528 100644 --- a/test/regress.rpc +++ b/test/regress.rpc @@ -10,6 +10,7 @@ struct msg { struct kill { string weapon = 0x10121; string action = 2; + int how_often = 3; } struct run {