diff options
author | Matthew Heaney <heaney@adacore.com> | 2005-12-09 18:16:22 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-12-09 18:16:22 +0100 |
commit | 7cdc672b77b47c9c4794ed9b24b8dc923ea36bab (patch) | |
tree | 3d8042f676028733216495b35bc6bac0d717a751 /gcc/ada/a-cohama.adb | |
parent | 9582a3cd55cfe9218f3fd8c80808d816c8774897 (diff) | |
download | gcc-7cdc672b77b47c9c4794ed9b24b8dc923ea36bab.tar.gz |
a-convec.adb (Merge): Added assertions to check whether vector params are sorted.
2005-12-05 Matthew Heaney <heaney@adacore.com>
* a-convec.adb (Merge): Added assertions to check whether vector params
are sorted.
* a-coinve.adb (Merge): Added assertions to check whether vector params
are sorted.
* a-cohama.ads (Cursor'Write): raises Program_Error per latest AI-302
draft.
(Cursor'Read): raises PE
* a-cohama.adb (Insert.New_Node): Uses box-style syntax to init elem
to its default value.
* a-cihama.adb: Manually check whether cursor's key and elem are
non-null
* a-cidlli.ads, a-cidlli.adb (Splice): Changed param name and param mode
(Merge): Assert that target and source lists are in order
(Swap): Declare non-const temporaries, to pass to Splice
* a-cdlili.ads: (Splice): Changed param name and param mode
* a-cdlili.adb: (Splice): Changed param name and param mode
(Merge): Assert that target and source lists are in order
(Swap): Declare non-const temporaries, to pass to Splice
* a-ciorma.ads, a-coorma.ads: (Read): declare Stream param as not null
(Write): declare Stream param as not null
* a-ciorma.adb, a-coorma.adb: All explicit raise statements now include
an exception message.
From-SVN: r108287
Diffstat (limited to 'gcc/ada/a-cohama.adb')
-rw-r--r-- | gcc/ada/a-cohama.adb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/gcc/ada/a-cohama.adb b/gcc/ada/a-cohama.adb index d235d0b0c79..a29784bdb45 100644 --- a/gcc/ada/a-cohama.adb +++ b/gcc/ada/a-cohama.adb @@ -438,18 +438,10 @@ package body Ada.Containers.Hashed_Maps is -------------- function New_Node (Next : Node_Access) return Node_Access is - Node : Node_Access := new Node_Type; -- Ada 2005 aggregate possible? - begin - Node.Key := Key; - Node.Next := Next; - - return Node; - - exception - when others => - Free (Node); - raise; + return new Node_Type'(Key => Key, + Element => <>, + Next => Next); end New_Node; HT : Hash_Table_Type renames Container.HT; @@ -490,9 +482,8 @@ package body Ada.Containers.Hashed_Maps is -------------- function New_Node (Next : Node_Access) return Node_Access is - Node : constant Node_Access := new Node_Type'(Key, New_Item, Next); begin - return Node; + return new Node_Type'(Key, New_Item, Next); end New_Node; HT : Hash_Table_Type renames Container.HT; |