[Vm-dev] Re: [squeak-dev] Questionable comment

Eliot Miranda eliot.miranda at gmail.com
Fri Aug 21 04:25:20 UTC 2015


Hi Chris,

On Wed, Aug 19, 2015 at 1:06 PM, Chris Cunningham <cunningham.cb at gmail.com>
wrote:

> well, not questionable - bad.
>
> (in ByteArray)
>
> long64At: index
> "Answer a 64-bit integer in Smalltalk order (little-endian)."
> | n1 n2 |
> n1 := self unsignedLongAt: index bigEndian: true.
> n2 := self unsignedLongAt: index+4 bigEndian: true.
>
> These are obviously bigEndian now, nto litte-endian.
>
> Does this mean Smalltalk order (or now Squeak order) has changed?
>

This is not for general purpose.  The method is part of VMMaker.  Let's
take it to vm-dev.
It's a simple mistake.  If you look at long64At:put: you'll see the comment
is correct:

long64At: index put: val
"I store 64-bit integers in Smalltalk (little-endian) order."
self unsignedLongAt: index put: (val bitAnd: 16rFFFFFFFF) bigEndian: false.
self unsignedLongAt: index+4 put: (val bitShift: -32) bigEndian: false.
^val

Thanks for finding this!



> -cbc
>
>
>
>


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150820/11017423/attachment.htm


More information about the Vm-dev mailing list