summaryrefslogtreecommitdiff
path: root/gcc/ada/s-rannum.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-23 06:21:26 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-06-23 06:21:26 +0000
commitb39f902fcdc2df45f703bb6fa364064786602c97 (patch)
tree055f02e3e3f13e394ea9082c561ba3e01e199a63 /gcc/ada/s-rannum.adb
parentb8ba40f6dede4275ddc7f15fdcec67779ce6adc8 (diff)
downloadgcc-b39f902fcdc2df45f703bb6fa364064786602c97.tar.gz
2010-06-23 Ed Schonberg <schonberg@adacore.com>
* exp_ch4.adb: Use predefined unsigned type in all cases. 2010-06-23 Bob Duff <duff@adacore.com> * s-rannum.adb (Reset): Avoid overflow in calculation of Initiator. * g-pehage.ads: Minor comment fixes. * g-pehage.adb: Minor: Add some additional debugging printouts under Verbose flag. 2010-06-23 Robert Dewar <dewar@adacore.com> * binde.adb (Better_Choice): Always prefer Pure/Preelab. (Worse_Choice): Always prefer Pure/Preelab. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161246 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-rannum.adb')
-rw-r--r--gcc/ada/s-rannum.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/s-rannum.adb b/gcc/ada/s-rannum.adb
index 5065910eb39..d85dd2efacf 100644
--- a/gcc/ada/s-rannum.adb
+++ b/gcc/ada/s-rannum.adb
@@ -484,7 +484,12 @@ package body System.Random_Numbers is
-----------
procedure Reset (Gen : Generator) is
- X : constant Unsigned_32 := Unsigned_32 ((Calendar.Clock - Y2K) * 64.0);
+ Clock : constant Time := Calendar.Clock;
+ Duration_Since_Y2K : constant Duration := Clock - Y2K;
+
+ X : constant Unsigned_32 :=
+ Unsigned_32'Mod (Unsigned_64 (Duration_Since_Y2K) * 64);
+
begin
Init (Gen, X);
end Reset;