diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-03-17 12:37:08 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-11 05:53:44 -0400 |
commit | 38f44fd6af098d4d09bcf91039b4ce989b0d0791 (patch) | |
tree | 5a362451acae8a1e10cef9e565a80c3839af97d6 | |
parent | fc4c73488f8254c0d787a4ec06c135a4ce029b33 (diff) | |
download | gcc-38f44fd6af098d4d09bcf91039b4ce989b0d0791.zip gcc-38f44fd6af098d4d09bcf91039b4ce989b0d0791.tar.gz gcc-38f44fd6af098d4d09bcf91039b4ce989b0d0791.tar.bz2 |
[Ada] Refine type for sorting case-choices tables
2020-06-11 Piotr Trojanek <trojanek@adacore.com>
gcc/ada/
* sem_aggr.adb (Case_Table_Type): Change index type from Nat to
Pos.
-rw-r--r-- | gcc/ada/sem_aggr.adb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb index 5d56fd7..9ef0eb8 100644 --- a/gcc/ada/sem_aggr.adb +++ b/gcc/ada/sem_aggr.adb @@ -85,9 +85,8 @@ package body Sem_Aggr is -- The node of the choice end record; - type Case_Table_Type is array (Nat range <>) of Case_Bounds; - -- Table type used by Check_Case_Choices procedure. Entry zero is not - -- used (reserved for the sort). Real entries start at one. + type Case_Table_Type is array (Pos range <>) of Case_Bounds; + -- Table type used by Check_Case_Choices procedure ----------------------- -- Local Subprograms -- @@ -1827,9 +1826,8 @@ package body Sem_Aggr is -- if a choice in an aggregate is a subtype indication these -- denote the lowest and highest values of the subtype - Table : Case_Table_Type (0 .. Case_Table_Size); - -- Used to sort all the different choice values. Entry zero is - -- reserved for sorting purposes. + Table : Case_Table_Type (1 .. Case_Table_Size); + -- Used to sort all the different choice values Single_Choice : Boolean; -- Set to true every time there is a single discrete choice in a |