ByteArray.st
changeset 15330 6e9281a08730
parent 15324 514914a1c770
child 15625 090e438cffe5
child 18066 89d51443ba6f
equal deleted inserted replaced
15329:cf2d5230ab9e 15330:6e9281a08730
  2439 
  2439 
  2440 %{  /* NOCONTEXT */
  2440 %{  /* NOCONTEXT */
  2441 
  2441 
  2442     REGISTER unsigned char *p;
  2442     REGISTER unsigned char *p;
  2443     unsigned int __i1, __i2;
  2443     unsigned int __i1, __i2;
  2444     int cnt;
  2444     int sz;
  2445     unsigned int t;
  2445     unsigned int t;
  2446 
  2446 
  2447     if (__qClass(self) == @global(ByteArray) && __bothSmallInteger(i1, i2)) {
  2447     if (__qClass(self) == @global(ByteArray) && __bothSmallInteger(i1, i2)) {
  2448 	__i1 = __intVal(i1) - 1;
  2448         __i1 = __intVal(i1) - 1;
  2449 	__i2 = __intVal(i2) - 1;
  2449         __i2 = __intVal(i2) - 1;
  2450 	cnt = __byteArraySize(self);
  2450         sz = __byteArraySize(self);
  2451 	p = __ByteArrayInstPtr(self)->ba_element;
  2451         p = __ByteArrayInstPtr(self)->ba_element;
  2452 	if (__i1 < cnt && __i2 < cnt) {
  2452         if (__i1 < sz && __i2 < sz) {
  2453 	    t = p[__i1];
  2453             t = p[__i1];
  2454 	    p[__i1] = p[__i2];
  2454             p[__i1] = p[__i2];
  2455 	    p[__i2] = t;
  2455             p[__i2] = t;
  2456 	}
  2456         }
  2457 	RETURN ( self );
  2457         RETURN ( self );
  2458     }
  2458     }
  2459 %}.
  2459 %}.
  2460     ^ super swapIndex:i1 and:i2 "/ rubbish - there is no one currently
  2460     ^ super swapIndex:i1 and:i2 "/ rubbish - there is no one currently
  2461 
  2461 
  2462     "
  2462     "
  3015 ! !
  3015 ! !
  3016 
  3016 
  3017 !ByteArray class methodsFor:'documentation'!
  3017 !ByteArray class methodsFor:'documentation'!
  3018 
  3018 
  3019 version
  3019 version
  3020     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.209 2013-05-27 08:10:49 cg Exp $'
  3020     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.210 2013-05-27 08:23:00 cg Exp $'
  3021 !
  3021 !
  3022 
  3022 
  3023 version_CVS
  3023 version_CVS
  3024     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.209 2013-05-27 08:10:49 cg Exp $'
  3024     ^ '$Header: /cvs/stx/stx/libbasic/ByteArray.st,v 1.210 2013-05-27 08:23:00 cg Exp $'
  3025 ! !
  3025 ! !
  3026 
  3026