[Bf-committers] Re: image editor / draw alpha

Branan Riley branan at gmail.com
Thu Jun 15 04:16:02 CEST 2006


Just saw that you had fixed it, and that's a much cleaner way than how
I did it. Like I said in the patch description, my way was pretty
hackish. Off to see if there's anything interesting in the bug
tracker, I suppose.

On 6/14/06, Branan Riley <branan at gmail.com> wrote:
> Fixed the patch upload, I think. Sorry about that.
>
> On 6/14/06, Ton Roosendaal <ton at blender.org> wrote:
> > Hi,
> >
> > Using defines for endianness is a bit cumbersome. In Blender code we
> > use this:
> >
> > ./blenkernel/intern/blender.c:207:      G.order= 1; /* is short */
> > ./blenkernel/intern/blender.c:208:      G.order=
> > (((char*)&G.order)[0])?L_ENDIAN:B_ENDIAN
> >
> > Gives guaranteed results. :)
> >
> > I cannot find a reason why makefiles or scons should should set such
> > defines... apart from some of the non-Blender libraries.
> >
> > -Ton-
> >
> >
> > On 14 Jun, 2006, at 3:16, Ed Halley wrote:
> >
> > >
> > > On Jun 13, 2006, at 7:47 PM, Branan Riley wrote:
> > >> I'm running Gentoo Linux x86-64 on a Pentium 4, so endianness is
> > >> probably the issue. I don't think testing for the Mac OS define would
> > >> work, since there are also Intel-based macs. Does anyoen know the
> > >> right define to check for to distinguish endianness?
> > >
> > > The current patch* for Mac Intel endianness looks for each of these:
> > >
> > >    #if ... || defined(__APPLE__)
> > >
> > > and turns them into
> > >
> > >    #if ... || (defined(__APPLE__) && !defined(__LITTLE_ENDIAN__))
> > >
> > > Similar adjustments are made in a couple makefiles.
> > >
> > > I am all for defining a better symbol to drive these checks, but this
> > > seems to work for the few CLEARLY UNDERSTOOD endian issues.
> > >
> > > It is important for any code that deals with byte packing to be CLEAR
> > > about its intentions.  This "it works because alpha is the low byte of
> > > an int" stuff can't be sufficient.  More rigorous testing is needed,
> > > and developers can't get complacent about assuming that all machines
> > > work the same way that their favorite machine works.
> > >
> > > * (the current patch being what was passed around unofficially as
> > >    'dougcorrs.diff' but never got posted on the patch server)
> > >
> > > --
> > > [ e d @ h a l l e y . c c ]
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > Bf-committers mailing list
> > > Bf-committers at projects.blender.org
> > > http://projects.blender.org/mailman/listinfo/bf-committers
> > >
> > >
> > >
> > ------------------------------------------------------------------------
> > --
> > Ton Roosendaal  Blender Foundation ton at blender.org
> > http://www.blender.org
> >
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at projects.blender.org
> > http://projects.blender.org/mailman/listinfo/bf-committers
> >
>


More information about the Bf-committers mailing list