Mercurial > hg > CbC > CbC_gcc
comparison gcc/ada/libgnat/a-cfinve.adb @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
4 -- -- | 4 -- -- |
5 -- ADA.CONTAINERS.FORMAL_INDEFINITE_VECTORS -- | 5 -- ADA.CONTAINERS.FORMAL_INDEFINITE_VECTORS -- |
6 -- -- | 6 -- -- |
7 -- B o d y -- | 7 -- B o d y -- |
8 -- -- | 8 -- -- |
9 -- Copyright (C) 2010-2018, Free Software Foundation, Inc. -- | 9 -- Copyright (C) 2010-2019, Free Software Foundation, Inc. -- |
10 -- -- | 10 -- -- |
11 -- GNAT is free software; you can redistribute it and/or modify it under -- | 11 -- GNAT is free software; you can redistribute it and/or modify it under -- |
12 -- terms of the GNU General Public License as published by the Free Soft- -- | 12 -- terms of the GNU General Public License as published by the Free Soft- -- |
13 -- ware Foundation; either version 3, or (at your option) any later ver- -- | 13 -- ware Foundation; either version 3, or (at your option) any later ver- -- |
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- | 14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- |
455 function Find_Index | 455 function Find_Index |
456 (Container : Vector; | 456 (Container : Vector; |
457 Item : Element_Type; | 457 Item : Element_Type; |
458 Index : Index_Type := Index_Type'First) return Extended_Index | 458 Index : Index_Type := Index_Type'First) return Extended_Index |
459 is | 459 is |
460 K : Capacity_Range; | 460 K : Count_Type; |
461 Last : constant Index_Type := Last_Index (Container); | 461 Last : constant Extended_Index := Last_Index (Container); |
462 | 462 |
463 begin | 463 begin |
464 K := Capacity_Range (Int (Index) - Int (No_Index)); | 464 K := Capacity_Range (Int (Index) - Int (No_Index)); |
465 for Indx in Index .. Last loop | 465 for Indx in Index .. Last loop |
466 if Get_Element (Container, K) = Item then | 466 if Get_Element (Container, K) = Item then |
1275 (Container : Vector; | 1275 (Container : Vector; |
1276 Item : Element_Type; | 1276 Item : Element_Type; |
1277 Index : Index_Type := Index_Type'Last) return Extended_Index | 1277 Index : Index_Type := Index_Type'Last) return Extended_Index |
1278 is | 1278 is |
1279 Last : Index_Type'Base; | 1279 Last : Index_Type'Base; |
1280 K : Capacity_Range; | 1280 K : Count_Type'Base; |
1281 | 1281 |
1282 begin | 1282 begin |
1283 if Index > Last_Index (Container) then | 1283 if Index > Last_Index (Container) then |
1284 Last := Last_Index (Container); | 1284 Last := Last_Index (Container); |
1285 else | 1285 else |