summaryrefslogtreecommitdiff
path: root/gcc/ada/s-stoele.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:04:45 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-15 14:04:45 +0000
commit9bd54259216d02cd5594e74814882fdf68da84ea (patch)
tree279a2f0ac1adbda90386c290562b5c9db514bf19 /gcc/ada/s-stoele.adb
parent5764a3254bdbc73428ac054ee1e4cdf7c9e27855 (diff)
downloadgcc-9bd54259216d02cd5594e74814882fdf68da84ea.tar.gz
2005-11-14 Robert Dewar <dewar@adacore.com>
* s-stoele.adb: Fix code for Address mod Storage_Offset for negative offset values git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@107010 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-stoele.adb')
-rw-r--r--gcc/ada/s-stoele.adb10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/ada/s-stoele.adb b/gcc/ada/s-stoele.adb
index 59eaf0b8215..4d4f9594e76 100644
--- a/gcc/ada/s-stoele.adb
+++ b/gcc/ada/s-stoele.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2004 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -61,15 +61,17 @@ package body System.Storage_Elements is
return To_Offset (To_Address (To_Integer (Left) - To_Integer (Right)));
end "-";
- function "mod" (Left : Address; Right : Storage_Offset)
- return Storage_Offset is
+ function "mod"
+ (Left : Address;
+ Right : Storage_Offset) return Storage_Offset
+ is
begin
if Right >= 0 then
return Storage_Offset
(To_Integer (Left) mod Integer_Address (Right));
else
return -Storage_Offset
- (To_Integer (Left) mod Integer_Address (-Right));
+ ((-To_Integer (Left)) mod Integer_Address (-Right));
end if;
end "mod";