public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-2208] [Ada] Fix layout of contracts Date: Fri, 9 Jul 2021 12:39:13 +0000 (GMT) [thread overview] Message-ID: <20210709123913.ECA3C3987021@sourceware.org> (raw) https://gcc.gnu.org/g:021cf768fba5724f6d419fbbd574ca12c76c616c commit r12-2208-g021cf768fba5724f6d419fbbd574ca12c76c616c Author: Joffrey Huguet <huguet@adacore.com> Date: Thu Jun 10 11:39:01 2021 +0200 [Ada] Fix layout of contracts gcc/ada/ * libgnat/a-strunb.ads, libgnat/a-strunb__shared.ads: Fix layout in contracts. Diff: --- gcc/ada/libgnat/a-strunb.ads | 29 ++++++++++++++--------------- gcc/ada/libgnat/a-strunb__shared.ads | 11 ++++------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/gcc/ada/libgnat/a-strunb.ads b/gcc/ada/libgnat/a-strunb.ads index 89c8339d753..13c7612116c 100644 --- a/gcc/ada/libgnat/a-strunb.ads +++ b/gcc/ada/libgnat/a-strunb.ads @@ -81,7 +81,7 @@ is -------------------------------------------------------- function To_Unbounded_String - (Source : String) return Unbounded_String + (Source : String) return Unbounded_String with Post => Length (To_Unbounded_String'Result) = Source'Length, Global => null; @@ -91,8 +91,7 @@ is (Length : Natural) return Unbounded_String with Post => - Ada.Strings.Unbounded.Length (To_Unbounded_String'Result) - = Length, + Ada.Strings.Unbounded.Length (To_Unbounded_String'Result) = Length, Global => null; -- Returns an Unbounded_String that represents an uninitialized String -- whose length is Length. @@ -524,11 +523,11 @@ is with Pre => Low - 1 <= Length (Source) - and then (if High >= Low - then Low - 1 - <= Natural'Last - By'Length - - Natural'Max (Length (Source) - High, 0) - else Length (Source) <= Natural'Last - By'Length), + and then (if High >= Low + then Low - 1 + <= Natural'Last - By'Length + - Natural'Max (Length (Source) - High, 0) + else Length (Source) <= Natural'Last - By'Length), Contract_Cases => (High >= Low => Length (Replace_Slice'Result) @@ -545,11 +544,11 @@ is with Pre => Low - 1 <= Length (Source) - and then (if High >= Low - then Low - 1 - <= Natural'Last - By'Length - - Natural'Max (Length (Source) - High, 0) - else Length (Source) <= Natural'Last - By'Length), + and then (if High >= Low + then Low - 1 + <= Natural'Last - By'Length + - Natural'Max (Length (Source) - High, 0) + else Length (Source) <= Natural'Last - By'Length), Contract_Cases => (High >= Low => Length (Source) @@ -586,7 +585,7 @@ is Pre => Position - 1 <= Length (Source) and then (if New_Item'Length /= 0 then - New_Item'Length <= Natural'Last - (Position - 1)), + New_Item'Length <= Natural'Last - (Position - 1)), Post => Length (Overwrite'Result) = Natural'Max (Length (Source), Position - 1 + New_Item'Length), @@ -600,7 +599,7 @@ is Pre => Position - 1 <= Length (Source) and then (if New_Item'Length /= 0 then - New_Item'Length <= Natural'Last - (Position - 1)), + New_Item'Length <= Natural'Last - (Position - 1)), Post => Length (Source) = Natural'Max (Length (Source)'Old, Position - 1 + New_Item'Length), diff --git a/gcc/ada/libgnat/a-strunb__shared.ads b/gcc/ada/libgnat/a-strunb__shared.ads index 6382252b908..2091bde01c8 100644 --- a/gcc/ada/libgnat/a-strunb__shared.ads +++ b/gcc/ada/libgnat/a-strunb__shared.ads @@ -363,9 +363,8 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping := Maps.Identity) return Natural with - Pre => (if Length (Source) /= 0 - then From <= Length (Source)) - and then Pattern'Length /= 0, + Pre => (if Length (Source) /= 0 then From <= Length (Source)) + and then Pattern'Length /= 0, Global => null; pragma Ada_05 (Index); @@ -376,11 +375,9 @@ is Going : Direction := Forward; Mapping : Maps.Character_Mapping_Function) return Natural with - Pre => (if Length (Source) /= 0 - then From <= Length (Source)) - and then Pattern'Length /= 0, + Pre => (if Length (Source) /= 0 then From <= Length (Source)) + and then Pattern'Length /= 0, Global => null; - pragma Ada_05 (Index); function Index
reply other threads:[~2021-07-09 12:39 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210709123913.ECA3C3987021@sourceware.org \ --to=pmderodat@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).