The Trunk: Collections-cbc.650.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-cbc.650.mcz

commits-2
Chris Muller uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-cbc.650.mcz

==================== Summary ====================

Name: Collections-cbc.650
Author: cbc
Time: 28 August 2015, 3:56:04.013 pm
UUID: 35dc53fb-613d-f84a-bd9d-ffc19957feb8
Ancestors: Collections-ul.649

Add ByteArray methods to deal with long64bit values.

=============== Diff against Collections-ul.649 ===============

Item was added:
+ ----- Method: ByteArray>>unsignedLong64At:bigEndian: (in category 'platform independent access') -----
+ unsignedLong64At: index bigEndian: aBool
+ | n1 n2 |
+ aBool
+ ifTrue: [
+ n2 := self unsignedLongAt: index  bigEndian: true.
+ n1 := self unsignedLongAt: index+4  bigEndian: true.
+ ]
+ ifFalse: [
+ n1 := self unsignedLongAt: index bigEndian: false.
+ n2 := self unsignedLongAt: index+4 bigEndian: false.
+ ].
+ ^(n2 bitShift: 32) + n1!

Item was added:
+ ----- Method: ByteArray>>unsignedLong64At:put:bigEndian: (in category 'platform independent access') -----
+ unsignedLong64At: index put: val bigEndian: aBool
+ aBool
+ ifTrue: [
+ self unsignedLongAt: index put: (val bitShift: -32) bigEndian: true.
+ self unsignedLongAt: index+4 put: (val bitAnd: 16rFFFFFFFF) bigEndian: true.
+ ]
+ ifFalse: [
+ self unsignedLongAt: index put: (val bitAnd: 16rFFFFFFFF) bigEndian: false.
+ self unsignedLongAt: index+4 put: (val bitShift: -32) bigEndian: false.
+ ].
+ ^val
+ !