--- a/SmallInteger.st Fri Jul 26 09:39:03 2013 +0200
+++ b/SmallInteger.st Fri Jul 26 09:39:21 2013 +0200
@@ -831,25 +831,25 @@
bitAt:anIntegerIndex
"return the value of the index's bit (index starts at 1) as 0 or 1.
Notice: the result of bitAt: on negative receivers is not
- defined in the language standard (since the implementation
- is free to choose any internal representation for integers)"
+ defined in the language standard (since the implementation
+ is free to choose any internal representation for integers)"
%{ /* NOCONTEXT */
if (__isSmallInteger(anIntegerIndex)) {
- INT idx = __smallIntegerVal(anIntegerIndex);
- if (idx > 0) {
- if (idx > N_INT_BITS) {
- RETURN(__mkSmallInteger(0));
- }
- RETURN((__smallIntegerVal(self) & (1 << (idx-1))) ? __mkSmallInteger(1) : __mkSmallInteger(0));
- }
+ INT idx = __smallIntegerVal(anIntegerIndex);
+ if (idx > 0) {
+ if (idx > N_INT_BITS) {
+ RETURN(__mkSmallInteger(0));
+ }
+ RETURN((__smallIntegerVal(self) & (1 << (idx-1))) ? __mkSmallInteger(1) : __mkSmallInteger(0));
+ }
}
%}.
- ^ SubscriptOutOfBoundsSignal
- raiseRequestWith:anIntegerIndex
- errorString:'index out of bounds'
+ ^ SubscriptOutOfBoundsError
+ raiseRequestWith:anIntegerIndex
+ errorString:'index out of bounds'
"
16r00000001 bitAt:0
@@ -869,9 +869,9 @@
|mask|
anIntegerIndex <= 0 ifTrue:[
- ^ SubscriptOutOfBoundsSignal
- raiseRequestWith:anIntegerIndex
- errorString:'index out of bounds'
+ ^ SubscriptOutOfBoundsSignal
+ raiseRequestWith:anIntegerIndex
+ errorString:'index out of bounds'
].
(anIntegerIndex > SmallInteger maxBits) ifTrue:[^ 0].
mask := 1 bitShift:(anIntegerIndex - 1).
@@ -4232,11 +4232,11 @@
!SmallInteger class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.208 2013-06-25 20:37:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.209 2013-07-26 07:39:21 stefan Exp $'
!
version_CVS
- ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.208 2013-06-25 20:37:31 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.209 2013-07-26 07:39:21 stefan Exp $'
! !