[ovs-dev] [PATCH] ofproto-dpif: xlate_actions() more judiciously.
Jean Tourrilhes
jt at hpl.hp.com
Tue Jun 7 18:41:27 UTC 2011
On Tue, Jun 07, 2011 at 11:31:50AM -0700, Ben Pfaff wrote:
> On Tue, Jun 07, 2011 at 11:25:53AM -0700, Jean Tourrilhes wrote:
> > - bool send_flow_removed; /* Send a flow removed message? */
> > + int send_flow_removed:1, /* Send a flow removed message? */
> > + has_resubmit:1; /* Rule contains resubmit action. */
>
> Leaving the rest of this patch aside for the moment (I think that
> Ethan is planning to review it in detail), let me address this
> specific part. "int" bit-fields are a weird corner case in the C
> standard, which says:
>
> ...for bit-fields, it is implementation-defined whether the
> specifier "int" designates the same type as "signed int" or the
> same type as "unsigned int".
>
> This means that a 1-bit "int" bit-field might only be able to
> represent the values -1 and 0.
>
> My conclusion has always been that one should never use "int" as the
> type of a bit-field member, only "unsigned int" (or "signed int", I
> guess, but I've never had a need for a signed bit-field member).
Thanks for the tip, I've fixed that. Anyway, you will probably
rewrite anything... For a bool, I guess it did not matter because you
are comparing 0 and non-zero, so 1 or -1 are the same, but let's make
it clean and standard.
Regards,
Jean
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ovs-1.1.0-hpl-resubmit-stats-2.diff
Type: text/x-diff
Size: 3235 bytes
Desc: not available
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20110607/f41eb819/attachment-0003.bin>
More information about the dev
mailing list