On Tue, 20 May 2008 18:27:32 -0300 "Gustavo Sverzut Barbieri"
<[EMAIL PROTECTED]> babbled:
then u'd have a platform that does NOT do 2's compliment math. not compiler but
cpu... and i'd love to see that exist - NOT. :) everything is 2's compliment
and so a 1 bit signed bitfield when "on" is "-1" which as you say - still is
true. it always will be :)
> to make clear: it COULD be -0, on intel at least it's -1 and thus
> evaluates to TRUE, that's why it was unnoticed.
>
> On Tue, May 20, 2008 at 5:56 PM, Enlightenment CVS
> <[EMAIL PROTECTED]> wrote:
> > Enlightenment CVS committal
> >
> > Author : barbieri
> > Project : e17
> > Module : libs/evas
> >
> > Dir : e17/libs/evas/src/lib/include
> >
> >
> > Modified Files:
> > evas_common.h
> >
> >
> > Log Message:
> > Remove bugs with bitfield usage, make boolean usage clear.
> >
> > This patch fixes the problem with bitfield of signed types (ie: char),
> > where the bit would be used for the signal, so 1 is considered -0 and
> > thus 0.
> >
> > Move all the single bit fields to Evas_Bool, making it clear and also
> > avoiding these problems since Evas_Bool is unsigned char.
> >
> >
> > ===================================================================
> > RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_common.h,v
> > retrieving revision 1.97
> > retrieving revision 1.98
> > diff -u -3 -r1.97 -r1.98
> > --- evas_common.h 19 May 2008 03:13:16 -0000 1.97
> > +++ evas_common.h 20 May 2008 20:56:39 -0000 1.98
> > @@ -283,12 +283,12 @@
> >
> > struct
> > {
> > - unsigned int loaded : 1;
> > - unsigned int dirty : 1;
> > - unsigned int activ : 1;
> > - unsigned int need_data : 1;
> > - unsigned int lru_nodata : 1;
> > - unsigned int cached : 1;
> > + Evas_Bool loaded : 1;
> > + Evas_Bool dirty : 1;
> > + Evas_Bool activ : 1;
> > + Evas_Bool need_data : 1;
> > + Evas_Bool lru_nodata : 1;
> > + Evas_Bool cached : 1;
> > } flags;
> >
> > int references;
> > @@ -320,11 +320,11 @@
> >
> > struct
> > {
> > - unsigned int cached : 1;
> > - unsigned int activ : 1;
> > - unsigned int dirty : 1;
> > - unsigned int loaded : 1;
> > - unsigned int need_parent : 1;
> > + Evas_Bool cached : 1;
> > + Evas_Bool activ : 1;
> > + Evas_Bool dirty : 1;
> > + Evas_Bool loaded : 1;
> > + Evas_Bool need_parent : 1;
> > } flags;
> >
> > int references;
> > @@ -347,7 +347,7 @@
> > struct _RGBA_Draw_Context
> > {
> > struct {
> > - char use : 1;
> > + Evas_Bool use : 1;
> > DATA32 col;
> > } mul;
> > struct {
> > @@ -355,7 +355,7 @@
> > } col;
> > struct RGBA_Draw_Context_clip {
> > int x, y, w, h;
> > - char use : 1;
> > + Evas_Bool use : 1;
> > } clip;
> > Cutout_Rects cutout;
> > struct {
> > @@ -373,7 +373,7 @@
> > int y, h;
> > } sli;
> > int render_op;
> > - unsigned char anti_alias : 1;
> > + Evas_Bool anti_alias : 1;
> > };
> >
> > struct _RGBA_Pipe_Op
> > @@ -448,15 +448,15 @@
> > /* Colorspace stuff. */
> > struct {
> > void *data;
> > - unsigned int no_free : 1;
> > - unsigned int dirty : 1;
> > + Evas_Bool no_free : 1;
> > + Evas_Bool dirty : 1;
> > } cs;
> >
> > /* RGBA stuff */
> > struct
> > {
> > DATA32 *data;
> > - unsigned int no_free : 1;
> > + Evas_Bool no_free : 1;
> > } image;
> > };
> >
> > @@ -483,7 +483,7 @@
> > float angle;
> > int direction;
> > float offset;
> > - unsigned char has_alpha : 1;
> > + Evas_Bool has_alpha : 1;
> > } map;
> >
> > struct {
> > @@ -515,8 +515,8 @@
> >
> > int references;
> >
> > - unsigned char imported_data : 1;
> > - unsigned char has_alpha : 1;
> > + Evas_Bool imported_data : 1;
> > + Evas_Bool has_alpha : 1;
> > };
> >
> > struct _RGBA_Gradient_Type
> > @@ -698,12 +698,12 @@
> >
> > struct _Tilebuf_Tile
> > {
> > - unsigned char redraw : 1;
> > + Evas_Bool redraw : 1;
> > /* FIXME: need these flags later - but not now */
> > /*
> > - int done : 1;
> > - int edge : 1;
> > - int from : 1;
> > + Evas_Bool done : 1;
> > + Evas_Bool edge : 1;
> > + Evas_Bool from : 1;
> >
> > struct {
> > int dx, dy;
> >
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > enlightenment-cvs mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs
> >
>
>
>
> --
> Gustavo Sverzut Barbieri
> http://profusion.mobi embedded systems
> --------------------------------------
> MSN: [EMAIL PROTECTED]
> Skype: gsbarbieri
> Mobile: +55 (19) 9225-2202
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> enlightenment-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
--
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler) [EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel