From e417a2ef34e121982d56eeae6eaca01d82884052 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Sun, 10 Jun 2018 22:16:59 +0200 Subject: [PATCH] Removed most warnings in new 2018 gnat gpl --- index/alire-index-hungarian.ads | 2 +- src/alire-boolean_trees.adb | 4 -- src/alire-dependencies.ads | 4 -- src/alire-index.ads | 74 +++++++++++++++++-------------- src/alire-milestones.ads | 2 - src/alire-requisites-booleans.ads | 4 ++ src/alire-requisites.ads | 2 +- 7 files changed, 46 insertions(+), 46 deletions(-) diff --git a/index/alire-index-hungarian.ads b/index/alire-index-hungarian.ads index 1d0fcf68..52a7490e 100644 --- a/index/alire-index-hungarian.ads +++ b/index/alire-index-hungarian.ads @@ -16,6 +16,6 @@ package Alire.Index.Hungarian is package V_1_0_0 is new Project_Release (Base - .Replacing (Git (Repo, "c784e09b8f9bd02c76d89b458ad6a32f65cfd146"))); + .Replacing (Git (Repo, "2494b4501837979a92a1de90e05c95ed7b23ce93"))); end Alire.Index.Hungarian; diff --git a/src/alire-boolean_trees.adb b/src/alire-boolean_trees.adb index eb487ce6..e3358b2c 100644 --- a/src/alire-boolean_trees.adb +++ b/src/alire-boolean_trees.adb @@ -84,7 +84,6 @@ package body Alire.Boolean_Trees is ----------- function "not" (T : Tree) return Tree is - use Trees; begin return Merge_Under (Node'(Kind => Not_Node), T); end "not"; @@ -148,7 +147,6 @@ package body Alire.Boolean_Trees is ----------- function Image (T : Tree) return String is - use Trees; begin if T.Is_Empty then return "(empty tree)"; @@ -171,8 +169,6 @@ package body Alire.Boolean_Trees is -------------------- function Image_Skeleton (T : Tree) return String is - use Trees; - begin if T.Is_Empty then return "(empty tree)"; diff --git a/src/alire-dependencies.ads b/src/alire-dependencies.ads index 800219cf..c7a7f887 100644 --- a/src/alire-dependencies.ads +++ b/src/alire-dependencies.ads @@ -24,8 +24,6 @@ package Alire.Dependencies with Preelaborate is private - use all type Semantic_Versioning.Version; - type Dependency (Name_Len : Natural) is tagged record Project : Alire.Project (1 .. Name_Len); Versions : Semantic_Versioning.Version_Set; @@ -40,8 +38,6 @@ private function Versions (Dep : Dependency) return Semantic_Versioning.Version_Set is (Dep.Versions); - use all type Alire.Project; - function Image (Dep : Dependency) return String is -- Exceptional case: alire=0.0.0 means Unavailable (if Dep = Unavailable then "Unavailable" diff --git a/src/alire-index.ads b/src/alire-index.ads index 7a585e33..14d1c517 100644 --- a/src/alire-index.ads +++ b/src/alire-index.ads @@ -166,16 +166,12 @@ package Alire.Index is ------------------------ -- INDEXING SUPPORT -- ------------------------ - - use all type Alire.Project; -- Shortcuts for origins: function Git (URL : Alire.URL; Commit : Origins.Git_Commit) return Origins.Origin renames Origins.New_Git; function Hg (URL : Alire.URL; Commit : Origins.Hg_Commit) return Origins.Origin renames Origins.New_Hg; - use all type Platforms.Distributions; - function Packaged_As (S : String) return Origins.Package_Names renames Origins.Packaged_As; function Unavailable return Origins.Package_Names renames Origins.Unavailable; @@ -190,9 +186,6 @@ package Alire.Index is function V (Semantic_Version : String) return Semver.Version renames Semver.Relaxed; - - use Versions.Expressions; - use Versions.Expressions_With_Versioned; function Unavailable return Release_Dependencies; -- A never available release @@ -236,21 +229,6 @@ package Alire.Index is ------------------ -- Properties -- ------------------ - - use all type Actions.Moments; --- use all type Alire.Dependencies.Vectors.Vector; - use all type GPR.Value; - use all type GPR.Value_Vector; - use all type Licensing.Licenses; - use all type Platforms.Compilers; - use all type Platforms.Operating_Systems; - use all type Platforms.Targets; - use all type Platforms.Versions; - use all type Platforms.Word_Sizes; - use all type Properties.Property'Class; - use all type Release_Dependencies; - use all type Release_Properties; - use all type Requisites.Tree; function On_Condition (Condition : Requisites.Tree; When_True : Release_Properties; @@ -319,26 +297,20 @@ package Alire.Index is -- REQUISITES -- ------------------ - package Plat_Reqs renames Requisites.Platform; +-- package Plat_Reqs renames Requisites.Platform; - function Compiler is new Requisites.Platform.Compilers.Factory; + function Compiler is new Requisites.Platform.Compilers.Factory; -- function Compiler_Is_Native return Release_Requisites renames Plat_Reqs.Compiler_Is_Native; - use all type Requisites.Platform.Compilers.Comparable; - function Distribution is new Requisites.Platform.Distributions.Factory; - use all type Requisites.Platform.Distributions.Comparable; + function Distribution is new Requisites.Platform.Distributions.Factory; function Operating_System is new Requisites.Platform.Op_Systems.Factory; - use all type Requisites.Platform.Op_Systems.Comparable; - function Distro_Release is new Requisites.Platform.Versions.Factory; - use all type Requisites.Platform.Versions.Comparable; + function Distro_Release is new Requisites.Platform.Versions.Factory; - function Target is new Requisites.Platform.Targets.Factory; - use all type Requisites.Platform.Targets.Comparable; + function Target is new Requisites.Platform.Targets.Factory; - function Word_Size is new Requisites.Platform.Word_Sizes.Factory; - use all type Requisites.Platform.Word_Sizes.Comparable; + function Word_Size is new Requisites.Platform.Word_Sizes.Factory; ------------ -- ROOT -- @@ -362,6 +334,40 @@ package Alire.Index is function Set_Root (R : Release) return Roots.Root renames Alire.Root.Set; -- An unindexed working copy (See New_Working_Release) + ------------ + -- USES -- + ------------ + -- For the benefit of child index files + + pragma Warnings (Off); + use all type Actions.Moments; + use all type Alire.Project; + use all type GPR.Value; + use all type GPR.Value_Vector; + use all type Licensing.Licenses; + use all type Platforms.Compilers; + use all type Platforms.Distributions; + use all type Platforms.Operating_Systems; + use all type Platforms.Targets; + use all type Platforms.Versions; + use all type Platforms.Word_Sizes; + use all type Properties.Property'Class; + use all type Release_Dependencies; + use all type Release_Properties; + + use all type Requisites.Platform.Compilers.Comparable; + use all type Requisites.Platform.Distributions.Comparable; + use all type Requisites.Platform.Op_Systems.Comparable; + use all type Requisites.Platform.Targets.Comparable; + use all type Requisites.Platform.Versions.Comparable; + use all type Requisites.Platform.Word_Sizes.Comparable; + + use all type Requisites.Tree; + + use Versions.Expressions; + use Versions.Expressions_With_Versioned; + pragma Warnings (On); + private type Catalog_Entry (Name_Len, Descr_Len, Pack_Len, Self_Len : Natural) is new diff --git a/src/alire-milestones.ads b/src/alire-milestones.ads index b51bae76..602158f6 100644 --- a/src/alire-milestones.ads +++ b/src/alire-milestones.ads @@ -17,8 +17,6 @@ package Alire.Milestones with Preelaborate is private - use all type Alire.Project; - type Milestone (Name_Len : Natural) is tagged record Name : Alire.Project (1 .. Name_Len); Version : Semantic_Versioning.Version; diff --git a/src/alire-requisites-booleans.ads b/src/alire-requisites-booleans.ads index 9765688e..54591138 100644 --- a/src/alire-requisites-booleans.ads +++ b/src/alire-requisites-booleans.ads @@ -4,11 +4,15 @@ package Alire.Requisites.Booleans with Preelaborate is type Requisite_False is new Requisite with null record; + pragma Warnings (Off); -- For the unused parameters + function Is_Applicable (R : Requisite_True; P : Property'Class) return Boolean is (True); function Satisfies (R : Requisite_True; P : Property'Class) return Boolean is (True); function Image (R : Requisite_True) return String is ("True"); + function Is_Applicable (R : Requisite_False; P : Property'Class) return Boolean is (True); function Satisfies (R : Requisite_False; P : Property'Class) return Boolean is (False); function Image (R : Requisite_False) return String is ("False"); + pragma Warnings (On); function Always_True return Tree is (Trees.Leaf (Requisite_True'(null record))); function Always_False return Tree is (Trees.Leaf (Requisite_False'(null record))); diff --git a/src/alire-requisites.ads b/src/alire-requisites.ads index 7e549f6a..68ce9592 100644 --- a/src/alire-requisites.ads +++ b/src/alire-requisites.ads @@ -10,7 +10,7 @@ package Alire.Requisites with Preelaborate is -- Here we provide the basic storage of values but the actual checking function must be overridden -- for particular checks. - function Is_Applicable (R : Requisite; P : Property'Class) return Boolean is (False); + function Is_Applicable (R : Requisite; P : Property'Class) return Boolean is abstract; -- Initially there is no compatibility. See helper package below -- The following package is the building block to be used to define new compatibility checks.