--- a/ByteArray.st Tue Oct 19 22:01:44 1999 +0200
+++ b/ByteArray.st Tue Oct 19 22:15:35 1999 +0200
@@ -2131,34 +2131,34 @@
); \
__rslt; \
})
- ip2 -= 5;
+ ip2 -= 7;
while (ip1 <= ip2) {
int t1, t2;
t1 = ip1[0];
- t2 = ip2[5];
- ip2[5] = BSWAP(t1);
+ t2 = ip2[7];
+ ip2[7] = BSWAP(t1);
ip1[0] = BSWAP(t2);
t1 = ip1[1];
- t2 = ip2[4];
- ip2[4] = BSWAP(t1);
+ t2 = ip2[6];
+ ip2[6] = BSWAP(t1);
ip1[1] = BSWAP(t2);
t1 = ip1[2];
- t2 = ip2[3];
- ip2[3] = BSWAP(t1);
+ t2 = ip2[5];
+ ip2[5] = BSWAP(t1);
ip1[2] = BSWAP(t2);
t1 = ip1[3];
- t2 = ip2[2];
- ip2[2] = BSWAP(t1);
+ t2 = ip2[4];
+ ip2[4] = BSWAP(t1);
ip1[3] = BSWAP(t2);
ip1 += 4;
ip2 -= 4;
}
- ip2 += 5;
+ ip2 += 7;
while (ip1 < ip2) {
int t;
@@ -2178,28 +2178,28 @@
}
}
#endif /* i386 && __GNUC__ */
- p2 -= 4;
+ p2 -= 7;
while (p1 <= p2) {
t = p1[0];
- p1[0] = p2[4];
- p2[4] = t;
+ p1[0] = p2[7];
+ p2[7] = t;
t = p1[1];
- p1[1] = p2[3];
- p2[3] = t;
+ p1[1] = p2[6];
+ p2[6] = t;
t = p1[2];
- p1[2] = p2[2];
- p2[2] = t;
+ p1[2] = p2[5];
+ p2[5] = t;
t = p1[3];
- p1[3] = p2[1];
- p2[1] = t;
+ p1[3] = p2[4];
+ p2[4] = t;
p1 += 4;
p2 -= 4;
}
- p2 += 4;
+ p2 += 7;
while (p1 < p2) {
t = *p1;
@@ -2214,6 +2214,7 @@
"
#[1 2 3 4 5] reverse
#[1 2 3 4] reverse
+ #[1 2 3 4 5] reverse
#[1 2 3 4 5 6] reverse
#[1 2 3 4 5 6 7] reverse
#[1 2 3 4 5 6 7 8] reverse
@@ -2225,9 +2226,14 @@
(1 to:255) asByteArray reverse
1 to:1024 do:[:i|
- |bytes rBytes|
+ |bytes test rBytes|
bytes := ((1 to:i) asArray collect:[:i | i bitAnd:255]) asByteArray.
+ test := ((i to:1 by:-1) asArray collect:[:i | i bitAnd:255]) asByteArray.
+ rBytes := bytes copy.
+ rBytes reverse ~= test ifTrue:[
+ self halt
+ ].
rBytes := bytes copy.
rBytes reverse reverse ~= bytes ifTrue:[
self halt
@@ -2246,7 +2252,7 @@
10000000 timesRepeat:[
b reverse
]
- ]
+ ]
"
!
@@ -2744,5 +2750,5 @@
!ByteArray class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.124 1999-10-19 20:01:44 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.125 1999-10-19 20:15:35 cg Exp $'
! !