The Trunk: EToys-nice.214.mcz

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

The Trunk: EToys-nice.214.mcz

commits-2
Nicolas Cellier uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-nice.214.mcz

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

Name: EToys-nice.214
Author: nice
Time: 1 September 2016, 12:35:17.034795 am
UUID: 2cee41a0-cb85-4b73-b2cd-828c3dbe0e32
Ancestors: EToys-tfel.213

Avoid using SmallInteger maxVal for 64bits compatibility.

Indeed, the maxVal would not fit in a WordArray in 64bits VM

=============== Diff against EToys-tfel.213 ===============

Item was changed:
  ----- Method: ChessBoard class>>initializeHashKeys (in category 'class initialization') -----
  initializeHashKeys
  "ChessGame initialize"
  | random |
  HashKeys := Array new: 12.
  1 to: HashKeys size do:[:i| HashKeys at: i put: (WordArray new: 64)].
  HashLocks := Array new: 12.
  1 to: HashLocks size do:[:i| HashLocks at: i put: (WordArray new: 64)].
  random := Random seed: 23648646.
  1 to: 12 do:[:i|
  1 to: 64 do:[:j|
+ (HashKeys at: i) at: j put: (random nextInt: 16r3FFFFFFF "SmallInteger maxVal on 32bits VM")- 1.
+ (HashLocks at: i) at: j put: (random nextInt: 16r3FFFFFFF "SmallInteger maxVal on 32bits VM") - 1.
- (HashKeys at: i) at: j put: (random nextInt: SmallInteger maxVal) - 1.
- (HashLocks at: i) at: j put: (random nextInt: SmallInteger maxVal) - 1.
  ].
  ].
 
  !