On Fri, May 8, 2009 at 2:06 PM, Kenton Varda <ken...@google.com> wrote:
>
>
> On Fri, May 8, 2009 at 9:03 AM, Henner Zeller <h.zel...@acm.org> wrote:
>>
>> fixed32 or fixed64 would be probably better. uint32 is encoded in
>> variable length which would make bitfields typically larger than
>> necessary.
>
> Depends.  If you are only using the first few (low-order) bits, then uint32
> is probably better since it will use fewer bytes.  But, yes, if you use all
> 32 bits then fixed32 is better.

this is why I said 'typically' :) bitfields typically have a random
distribution of bits.

>
>>
>> >
>> > Another way might be to just refer to all the bitfields as "bytes".
>> >
>> > We chose the first approach, but YMMV.
>> >
>> > Ciao,
>> >
>> > Peter K.
>> >
>> > On May 8, 2:02 am, swapnil...@gmail.com wrote:
>> >> Hi All,
>> >>
>> >> I have a project in which we are using Protocol buffers (C++ ). The
>> >> existing code for uses bit fields.
>> >> i would like to know can we use bit fields in .proto file? If yes then
>> >> please tell me how to use it?
>> > >
>> >
>>
>> >>
>
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to