--- a/AbstractOperatingSystem.st Mon Jul 11 09:18:21 2016 +0100
+++ b/AbstractOperatingSystem.st Mon Jul 11 09:20:09 2016 +0100
@@ -6017,7 +6017,7 @@
that they can deal with timestamps after 2038 (especially: win32 will do so).
Notice that timestamp is prepared to compensate for any OS limitation by computing the timeInfo
components itself.
- So it is usually (except for a little performance) no problem to return a reange too small here."
+ So it is usually (except for a little performance) no problem to return a range too small here."
^ (SmallInteger maxVal * 2 + 1) * 1000
!
@@ -6139,7 +6139,7 @@
timer wraps."
%{ /* NOCONTEXT */
- RETURN ( __mkSmallInteger(0x0FFFFFFF) );
+ RETURN ( __mkSmallInteger(_MAX_INT >> 2) );
%}
!
@@ -6174,31 +6174,27 @@
This should really be moved to some RelativeTime class."
(msTime1 > msTime2) ifTrue:[
- ((msTime1 - msTime2) < 16r10000000) ifTrue:[
- ^ true
- ].
+ ^ (msTime1 - msTime2) <= (SmallInteger maxVal // 4).
] ifFalse:[
- ((msTime2 - msTime1) > 16r10000000) ifTrue:[
- ^ true
- ].
+ ^ (msTime2 - msTime1) > ((SmallInteger maxVal // 4) + 1)
].
- ^ false
!
millisecondTimeAdd:msTime1 and:msTime2
"Add two millisecond times (such as returned getMillisecondTime).
- The returned value is msTime1 + msTime2 where a wrap occurs at:16r1FFFFFFF.
+ The returned value is msTime1 + msTime2 where a wrap occurs
+ at:16r1FFFFFFF (32-bit systems) or:16r1FFFFFFFFFFFFFFF (64-bit systems).
This should really be moved to some RelativeTime class."
|sum|
sum := msTime1 + msTime2.
- (sum > 16r1FFFFFFF) ifTrue:[
- self assert:(sum <= 16r3FFFFFFF) message:'overflow in timer computation'.
- ^ sum - 16r20000000.
+ (sum > (SmallInteger maxVal // 2)) ifTrue:[
+ self assert:(sum <= SmallInteger maxVal) message:'overflow in timer computation'.
+ ^ sum - (SmallInteger maxVal // 2 + 1).
].
- (sum < 0) ifTrue:[^ sum + 16r20000000].
+ (sum < 0) ifTrue:[^ sum + (SmallInteger maxVal // 2 + 1)].
^ sum
!
@@ -6215,14 +6211,16 @@
|diff|
diff := msTime1 - msTime2.
- diff > 16r-10000000 ifTrue:[
- (diff < 16r10000000) ifTrue:[
- ^ diff.
- ] ifFalse:[
- ^ diff - 16r20000000.
- ].
+
+ diff < (SmallInteger maxVal // -4) ifTrue:[
+ ^ diff + (SmallInteger maxVal // 2) + 1.
].
- ^ diff + 16r20000000
+
+ diff <= (SmallInteger maxVal // 4) ifTrue:[
+ ^ diff.
+ ] ifFalse:[
+ ^ diff - (SmallInteger maxVal // 2 + 1).
+ ].
"