summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cfdlli.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 17:58:19 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2014-02-24 17:58:19 +0100
commit1b31321b1834aac1bd455e5a457145827dee562f (patch)
tree1add74aa9da3e051e5836c81c36ab340e705ba01 /gcc/ada/a-cfdlli.adb
parent2810861847cca82646c1c7e14249fe198acbbc0f (diff)
downloadgcc-1b31321b1834aac1bd455e5a457145827dee562f.tar.gz
[multiple changes]
2014-02-24 Robert Dewar <dewar@adacore.com> * a-direct.adb, sem_ch5.adb, a-cfdlli.adb, a-cfhase.adb, a-tags.adb, s-filatt.ads, a-cforma.adb, sem_ch6.adb, g-socthi-mingw.adb, a-cfhama.adb, a-cforse.adb, a-cofove.adb: Minor reformatting and code reorganization. 2014-02-24 Thomas Quinot <quinot@adacore.com> * Make-generated.in (OSCONS_CPP, OSCONS_EXTRACT): Make sure that the source directory containing s-oscons-tmplt.c is on the include path, so that all internal header files are available. From-SVN: r208081
Diffstat (limited to 'gcc/ada/a-cfdlli.adb')
-rw-r--r--gcc/ada/a-cfdlli.adb40
1 files changed, 22 insertions, 18 deletions
diff --git a/gcc/ada/a-cfdlli.adb b/gcc/ada/a-cfdlli.adb
index 706bafc6de7..993f966f2e1 100644
--- a/gcc/ada/a-cfdlli.adb
+++ b/gcc/ada/a-cfdlli.adb
@@ -507,7 +507,8 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
function First_To_Previous
(Container : List;
- Current : Cursor) return List is
+ Current : Cursor) return List
+ is
Curs : Cursor := Current;
C : List (Container.Capacity) := Copy (Container, Container.Capacity);
Node : Count_Type;
@@ -515,19 +516,19 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
begin
if Curs = No_Element then
return C;
- end if;
- if not Has_Element (Container, Curs) then
+ elsif not Has_Element (Container, Curs) then
raise Constraint_Error;
- end if;
- while Curs.Node /= 0 loop
- Node := Curs.Node;
- Delete (C, Curs);
- Curs := Next (Container, (Node => Node));
- end loop;
+ else
+ while Curs.Node /= 0 loop
+ Node := Curs.Node;
+ Delete (C, Curs);
+ Curs := Next (Container, (Node => Node));
+ end loop;
- return C;
+ return C;
+ end if;
end First_To_Previous;
----------
@@ -907,6 +908,7 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
if Container.Last = 0 then
return No_Element;
end if;
+
return (Node => Container.Last);
end Last;
@@ -1192,16 +1194,18 @@ package body Ada.Containers.Formal_Doubly_Linked_Lists is
if Container.Length = 0 then
return No_Element;
- end if;
- while CFirst /= 0 loop
- if Container.Nodes (CFirst).Element = Item then
- return (Node => CFirst);
- end if;
- CFirst := Container.Nodes (CFirst).Prev;
- end loop;
+ else
+ while CFirst /= 0 loop
+ if Container.Nodes (CFirst).Element = Item then
+ return (Node => CFirst);
+ else
+ CFirst := Container.Nodes (CFirst).Prev;
+ end if;
+ end loop;
- return No_Element;
+ return No_Element;
+ end if;
end Reverse_Find;
------------