[Spice-devel] [PATCH] codegen: typedef the protocol enums
Christophe Fergeau
cfergeau at redhat.com
Tue Jun 21 04:07:06 PDT 2011
On Tue, Jun 21, 2011 at 01:01:12PM +0200, Marc-André Lureau wrote:
> Hi,
>
> On Mon, Jun 20, 2011 at 11:47 PM, Christophe Fergeau
> <cfergeau at redhat.com> wrote:
> > Hi,
> >
> > On Mon, Jun 20, 2011 at 11:19:43PM +0200, Marc-André Lureau wrote:
> >> This is to satisfy a changed manually in
> >> 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf when one regenerate enums.h.
> >
> > The patch looks good to me, though I don't understand what the commit
> > message means, can you improve it? :)
>
> Sure, what about:
>
> Commit 9d5ef9beeca722b2ceff7d15aaa3aaaaf07ecfbf in spice-protocol
> introduced a typedef manually in the generated enums.h header.
>
> This patch adds them automatically to all enums during enums.h generation.
Yes, much better :)
> >
> > These 2 changes are unrelated to this commit.
>
> It's just removing a C-ism with a trailing; I will split it.
If you split this commit, there are more occurrences of this that you could
change too:
$ grep ";$" *.py
codegen.py: return writer;
codegen.py: self.indentation += 4;
codegen.py: self.indentation -= 4;
demarshal.py: writer.statement("typedef void
(*message_destructor_t)(uint8_t *message)");
demarshal.py: scope.variable_def("SPICE_GNUC_UNUSED uint8_t *", "pos");
demarshal.py: scope.variable_def("size_t", "mem_size", "nw_size");
demarshal.py: scope.variable_def("SPICE_GNUC_UNUSED intptr_t",
"ptr_size");
demarshal.py: scope.variable_def("SPICE_GNUC_UNUSED intptr_t",
"ptr_size");
demarshal.py: scope.variable_def("uint32_t", "n_ptr=0");
demarshal.py: writer.increment("end", "sizeof(void *)");
demarshal.py: scope.variable_def("SpiceChunks *", "chunks");
demarshal.py: scope.variable_def("SpiceChunks *", "chunks");
demarshal.py: parent_scope.variable_def("SPICE_GNUC_UNUSED uint8_t *",
"pos");
demarshal.py: parent_scope.variable_def("uint8_t *", "start =
message_start");
demarshal.py: parent_scope.variable_def("uint8_t *", "data = NULL");
demarshal.py: parent_scope.variable_def("uint8_t *", "in", "end");
demarshal.py: parent_scope.variable_def("SPICE_GNUC_UNUSED
intptr_t", "ptr_size");
demarshal.py: parent_scope.variable_def("uint32_t", "n_ptr=0");
demarshal.py: writer.write("static parse_msg_func_t funcs%d[%d] = "
% (d, r[1] - r[0]));
ptypes.py: new.vals[i] = self.vals[i];
ptypes.py: new.vals[i] = new.vals[i] + other.vals[i];
ptypes.py: size = 0;
spice_parser.py: t = ptypes.PointerType(t);
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20110621/ae0e1d18/attachment.pgp>
More information about the Spice-devel
mailing list