diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-31 18:13:22 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-10-31 18:13:22 +0000 |
commit | d9e74e050bd1ae08f4be72f63784a42c0973a94a (patch) | |
tree | 1a5cb845f084a8360d6f2bc2dd674427a1a51b02 /gcc/ada/a-convec.adb | |
parent | ad67c992e9102a7a00351747f46956e56b6f0c3f (diff) | |
download | gcc-d9e74e050bd1ae08f4be72f63784a42c0973a94a.tar.gz |
2006-10-31 Matt Heaney <heaney@adacore.com>
* a-crbtgo.ads: Commented each subprogram
* a-crbtgo.adb: Added reference to book from which algorithms were
adapted.
* a-crbtgk.ads, a-crbtgk.adb (Generic_Insert_Post): pass flag to
indicate which child.
(Generic_Conditional_Insert): changed parameter name from "Success" to
"Inserted".
(Generic_Unconditional_Insert_With_Hint): improved algorithm
* a-coorse.adb (Replace_Element): changed parameter name in call to
conditional insert operation.
* a-convec.adb, a-coinve.adb (Insert): removed obsolete comment
* a-cohama.adb (Iterate): manipulate busy-bit here, instead of in
Generic_Iteration
* a-ciorse.adb (Replace_Element): changed parameter name in call to
conditional insert operation.
* a-cihama.adb (Iterate): manipulate busy-bit here, instead of in
Generic_Iteration.
* a-cidlli.ads, a-cidlli.adb (Splice): Position param is now mode in
instead of mode inout.
* a-chtgop.adb (Adjust): modified comments to reflect current AI-302
draft
(Generic_Read): preserve existing buckets array if possible
(Generic_Write): don't send buckets array length anymore
* a-cdlili.ads, a-cdlili.adb (Splice): Position param is now mode in
instead of mode inout.
* a-cihase.adb (Difference): iterate over smaller of Tgt and Src sets
(Iterate): manipulate busy-bit here, instead of in Generic_Iteration
* a-cohase.adb (Difference): iterate over smaller of Tgt and Src sets
(Iterate): manipulate busy-bit here, instead of in Generic_Iteration
(Replace_Element): local operation is now an instantiation
* a-chtgke.ads, a-chtgke.adb (Generic_Conditional_Insert): manually
check current length.
(Generic_Replace_Element): new operation
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118324 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-convec.adb')
-rw-r--r-- | gcc/ada/a-convec.adb | 34 |
1 files changed, 1 insertions, 33 deletions
diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index ecffd32b90c..f08b70416a7 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -8,10 +8,6 @@ -- -- -- Copyright (C) 2004-2006 Free Software Foundation, Inc. -- -- -- --- This specification is derived from the Ada Reference Manual for use with -- --- GNAT. The copyright notice above, and the license provisions that follow -- --- apply solely to the contents of the part following the private keyword. -- --- -- -- 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- -- -- ware Foundation; either version 2, or (at your option) any later ver- -- @@ -799,34 +795,6 @@ package body Ada.Containers.Vectors is begin if Old_Last_As_Int > Int'Last - N then - - -- ??? - - -- The purpose of this test is to ensure that the calculation of - -- New_Last_As_Int (see below) doesn't overflow. - - -- This isn't quite right, since the only requirements are: - -- V.Last <= Index_Type'Last - -- V.Length <= Count_Type'Last - - -- To be strictly correct there's no (explicit) requirement that - -- Old_Last + N <= Int'Last - - -- However, there might indeed be an implied requirement, since - -- machine constraints dictate that - -- Index_Type'Last <= Int'Last - -- and so this check is perhaps proper after all. - - -- This shouldn't be an issue in practice, since it can only - -- happen when N is very large, or V.Last is near Int'Last. - - -- N isn't likely to be large, since there's probably not enough - -- storage. - - -- V.Last would only be large if IT'First is very large (and - -- V.Length has some "normal" size). But typically IT'First is - -- either 0 or 1. - raise Constraint_Error with "new length is out of range"; end if; @@ -1282,7 +1250,7 @@ package body Ada.Containers.Vectors is Old_Last_As_Int : constant Int := Int (Container.Last); begin - if Old_Last_As_Int > Int'Last - N then -- see Insert ??? + if Old_Last_As_Int > Int'Last - N then raise Constraint_Error with "new length is out of range"; end if; |