aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPascal Obry <obry@adacore.com>2009-06-25 09:04:31 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2009-06-25 11:04:31 +0200
commita2b62f99d5c193d5d6e6b16777501338cc519789 (patch)
treefd205b14b1ec6fdf7b212eb5bbbf876b34e20779 /gcc
parent1d24fc5e45ad67dd6b622e79e3d5b254e05613dc (diff)
downloadgcc-a2b62f99d5c193d5d6e6b16777501338cc519789.zip
gcc-a2b62f99d5c193d5d6e6b16777501338cc519789.tar.gz
gcc-a2b62f99d5c193d5d6e6b16777501338cc519789.tar.bz2
a-stwise.adb, [...]: Fix confusion between 'Length and 'Last.
2009-06-25 Pascal Obry <obry@adacore.com> * a-stwise.adb, a-stzsea.adb: Fix confusion between 'Length and 'Last. From-SVN: r148935
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/a-stwise.adb6
-rw-r--r--gcc/ada/a-stzsea.adb6
3 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 03f594b..e3524d5 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-25 Pascal Obry <obry@adacore.com>
+
+ * a-stwise.adb, a-stzsea.adb: Fix confusion between 'Length and 'Last.
+
2009-06-25 Emmanuel Briot <briot@adacore.com>
* fmap.ads, make.adb, prj.adb, prj.ads, prj-nmsc.adb, prj-env.adb,
diff --git a/gcc/ada/a-stwise.adb b/gcc/ada/a-stwise.adb
index 3220c8f..3add82b 100644
--- a/gcc/ada/a-stwise.adb
+++ b/gcc/ada/a-stwise.adb
@@ -88,8 +88,7 @@ package body Ada.Strings.Wide_Search is
-- Unmapped case
if Mapping'Address = Wide_Maps.Identity'Address then
- Ind := Source'First;
- while Ind <= Source'Length - PL1 loop
+ while Ind <= Source'Last - PL1 loop
if Pattern = Source (Ind .. Ind + PL1) then
Num := Num + 1;
Ind := Ind + Pattern'Length;
@@ -101,8 +100,7 @@ package body Ada.Strings.Wide_Search is
-- Mapped case
else
- Ind := Source'First;
- while Ind <= Source'Length - PL1 loop
+ while Ind <= Source'Last - PL1 loop
Cur := Ind;
for K in Pattern'Range loop
if Pattern (K) /= Value (Mapping, Source (Cur)) then
diff --git a/gcc/ada/a-stzsea.adb b/gcc/ada/a-stzsea.adb
index d0a7f9d..a9743e6 100644
--- a/gcc/ada/a-stzsea.adb
+++ b/gcc/ada/a-stzsea.adb
@@ -90,8 +90,7 @@ package body Ada.Strings.Wide_Wide_Search is
-- Unmapped case
if Mapping'Address = Wide_Wide_Maps.Identity'Address then
- Ind := Source'First;
- while Ind <= Source'Length - PL1 loop
+ while Ind <= Source'Last - PL1 loop
if Pattern = Source (Ind .. Ind + PL1) then
Num := Num + 1;
Ind := Ind + Pattern'Length;
@@ -103,8 +102,7 @@ package body Ada.Strings.Wide_Wide_Search is
-- Mapped case
else
- Ind := Source'First;
- while Ind <= Source'Length - PL1 loop
+ while Ind <= Source'Last - PL1 loop
Cur := Ind;
for K in Pattern'Range loop
if Pattern (K) /= Value (Mapping, Source (Cur)) then