fix support of fixed-sized entries in event_rpcgen

svn:r885
This commit is contained in:
Niels Provos 2008-06-25 20:52:29 +00:00
parent 0a66700e00
commit 33bb64c1e0
4 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,7 @@ Changes in 1.4.5-stable:
o Rename INPUT and OUTPUT to EVRPC_INPUT and EVRPC_OUTPUT. Retain INPUT/OUTPUT aliases on on-win32 platforms for backwards compatibility.
o Do not use SO_REUSEADDR when connecting
o Fix Windows build
o Fix a bug in event_rpcgen when generated fixed-sized entries
Changes in 1.4.4-stable:
o Correct the documentation on buffer printf functions.

View File

@ -446,7 +446,7 @@ class EntryBytes(Entry):
Entry.__init__(self, type, name, tag)
self._length = length
self._ctype = 'uint32_t'
self._ctype = 'uint8_t'
def GetDeclaration(self, funcname):
code = [ 'int %s(struct %s *, %s **);' % (
@ -518,7 +518,6 @@ class EntryBytes(Entry):
def CodeNew(self, name):
code = ['memset(%s->%s_data, 0, sizeof(%s->%s_data));' % (
name, self._name, name, self._name)]
code.extend(Entry.CodeNew(self, name))
return code
def Verify(self):

View File

@ -1363,6 +1363,8 @@ rpc_test(void)
exit(1);
}
EVTAG_ASSIGN(run, how, "very fast but with some data in it");
EVTAG_ASSIGN(run, fixed_bytes,
(unsigned char*)"012345678901234567890123");
}
if (msg_complete(msg) == -1) {

View File

@ -15,4 +15,6 @@ struct kill {
struct run {
string how = 1;
optional bytes some_bytes = 2;
bytes fixed_bytes[24] = 3;
}