[Vm-dev] Byte order in Cog ImageSegments

Mariano Martinez Peck marianopeck at gmail.com
Sat Apr 16 21:58:27 UTC 2011


ImageSegment >> endianness
    "Return which endian kind the incoming segment came from"

    ^ (segment first bitShift: -24) asCharacter == $d ifTrue: [#big]
ifFalse: [#little]


Check senders of #endianness, mostly in methods like #startUpFrom:

Cheers

Mariano

On Sat, Apr 16, 2011 at 11:43 PM, Matthew Fulmer <tapplek at gmail.com> wrote:

>
> On Sat, Apr 16, 2011 at 05:34:59PM -0400, Matthew Fulmer wrote:
> >
> > I discovered a bug in cobalt today due to the float-endianness
> > of ImageSegments made in cog vs interpreter:
> >
> > http://croquet-src-01.oit.duke.edu/mantis/view.php?id=503
> >
> > Is there a way to detect the platform endianness, so we can, in
> > the future, add metadata about that to ImageSegments, and then
> > byte-swap them if needed?
> >
> > Failing that, I guess we could add a constant float to the image
> > segment, and test whether it unpacks as byte-swapped or not
>
> Thinking about it, I guess this should be fixed in the
> ImageSegment post-loader, rather than in cobalt
>
> --
> Matthew Fulmer (a.k.a. Tapple)
>



-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20110416/1fb9e7f4/attachment.htm


More information about the Vm-dev mailing list