Any interest in a portable bitfields?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Any interest in a portable bitfields?

Emile Cormier
First, I'd like to thank everyone who contributed to this wonderful
library. We use Boost at work, and I'd like to contribute back.

I've come up with a portable mechanism that allows the declaration of
bitfields much like the way you do in C++. The syntax for using these
bitfields is the same as that of C++ bitfields. My solution doesn't
suffer from the ambiguity in C++ where you don't know whether the first
bitfield starts at the most significant or least significant end of the
word. It also doesn't suffer from the problem in C++ bitfields where the
compiler can arbitrarily decide to align bitfields along word
boundaries.

This solution has been very useful to me when dealing with hardware
registers and with 16-bit color formats.

I am aware of the existance of std::bitset, but it doesn't handle groups
of bits like bitfields do.

If there's interest, I'll post some code here.

Emile Cormier
--
  Emile Cormier
  [hidden email]

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Any interest in a portable bitfields?

Allen-12
Yes, I am interested.

Emile Cormier wrote:

> First, I'd like to thank everyone who contributed to this wonderful
> library. We use Boost at work, and I'd like to contribute back.
>
> I've come up with a portable mechanism that allows the declaration of
> bitfields much like the way you do in C++. The syntax for using these
> bitfields is the same as that of C++ bitfields. My solution doesn't
> suffer from the ambiguity in C++ where you don't know whether the first
> bitfield starts at the most significant or least significant end of the
> word. It also doesn't suffer from the problem in C++ bitfields where the
> compiler can arbitrarily decide to align bitfields along word
> boundaries.
>
> This solution has been very useful to me when dealing with hardware
> registers and with 16-bit color formats.
>
> I am aware of the existance of std::bitset, but it doesn't handle groups
> of bits like bitfields do.
>
> If there's interest, I'll post some code here.
>
> Emile Cormier

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Any interest in a portable bitfields?

Austin Gilbert
In reply to this post by Emile Cormier
I am also interested.

On 3/4/06, Emile Cormier <[hidden email]> wrote:

>
> First, I'd like to thank everyone who contributed to this wonderful
> library. We use Boost at work, and I'd like to contribute back.
>
> I've come up with a portable mechanism that allows the declaration of
> bitfields much like the way you do in C++. The syntax for using these
> bitfields is the same as that of C++ bitfields. My solution doesn't
> suffer from the ambiguity in C++ where you don't know whether the first
> bitfield starts at the most significant or least significant end of the
> word. It also doesn't suffer from the problem in C++ bitfields where the
> compiler can arbitrarily decide to align bitfields along word
> boundaries.
>
> This solution has been very useful to me when dealing with hardware
> registers and with 16-bit color formats.
>
> I am aware of the existance of std::bitset, but it doesn't handle groups
> of bits like bitfields do.
>
> If there's interest, I'll post some code here.
>
> Emile Cormier
> --
>   Emile Cormier
>   [hidden email]
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Any interest in a portable bitfields?

Andrew Finkenstadt
In reply to this post by Emile Cormier
I am highly interested, as my work involves 3D games, bit-packed
representations, and colors.

On 3/4/06, Emile Cormier <[hidden email]> wrote:
>
> word. It also doesn't suffer from the problem in C++ bitfields where the
> compiler can arbitrarily decide to align bitfields along word
> boundaries.
>
> This solution has been very useful to me when dealing with hardware
> registers and with 16-bit color formats.
>
>
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: Any interest in a portable bitfields?

Daniel Gutson
In reply to this post by Emile Cormier
I'm interested too. We (@motorola) use a lot of them, and always
concerned about portability..

   Daniel.

On 3/4/06, Emile Cormier <[hidden email]> wrote:

> First, I'd like to thank everyone who contributed to this wonderful
> library. We use Boost at work, and I'd like to contribute back.
>
> I've come up with a portable mechanism that allows the declaration of
> bitfields much like the way you do in C++. The syntax for using these
> bitfields is the same as that of C++ bitfields. My solution doesn't
> suffer from the ambiguity in C++ where you don't know whether the first
> bitfield starts at the most significant or least significant end of the
> word. It also doesn't suffer from the problem in C++ bitfields where the
> compiler can arbitrarily decide to align bitfields along word
> boundaries.
>
> This solution has been very useful to me when dealing with hardware
> registers and with 16-bit color formats.
>
> I am aware of the existance of std::bitset, but it doesn't handle groups
> of bits like bitfields do.
>
> If there's interest, I'll post some code here.
>
> Emile Cormier
> --
>  Emile Cormier
>  [hidden email]
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost