a-ztexio.adb, [...]: Replace bad range checks with 'Valid tests.
authorRobert Dewar <dewar@adacore.com>
Mon, 5 Sep 2005 07:52:38 +0000 (09:52 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 5 Sep 2005 07:52:38 +0000 (09:52 +0200)
2005-09-01  Robert Dewar  <dewar@adacore.com>

* a-ztexio.adb, a-textio.adb, a-witeio.adb: Replace bad range checks
with 'Valid tests.

From-SVN: r103858

gcc/ada/a-textio.adb
gcc/ada/a-witeio.adb
gcc/ada/a-ztexio.adb

index d86e2a9312c328abf51a592b4382d0b58a2b06cf..dfd65574159c09a76bd50303ff74451ad8352e0f 100644 (file)
@@ -896,7 +896,7 @@ package body Ada.Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if Spacing not in Positive_Count then
+      if not Spacing'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1334,7 +1334,7 @@ package body Ada.Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Positive_Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1461,7 +1461,7 @@ package body Ada.Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Positive_Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1506,7 +1506,7 @@ package body Ada.Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1539,7 +1539,7 @@ package body Ada.Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1567,7 +1567,7 @@ package body Ada.Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if Spacing not in Positive_Count then
+      if not Spacing'Valid then
          raise Constraint_Error;
       end if;
 
index 249c2bfde37de55a9da167e569bda72e98c8f1db..073319239cf51b16aa3bc3f266fe27ca5c905775 100644 (file)
@@ -987,7 +987,7 @@ package body Ada.Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if Spacing not in Positive_Count then
+      if not Spacing'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1346,7 +1346,7 @@ package body Ada.Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Positive_Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1434,7 +1434,7 @@ package body Ada.Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Positive_Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1479,7 +1479,7 @@ package body Ada.Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1512,7 +1512,7 @@ package body Ada.Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1570,7 +1570,7 @@ package body Ada.Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if Spacing not in Positive_Count then
+      if not Spacing'Valid then
          raise Constraint_Error;
       end if;
 
index bc9acaaf18a66f348330e8f08d9ee7a9d616cee6..8530e5a9a85da87b300ebd0a04cf5e2e35de9dbd 100644 (file)
@@ -988,7 +988,7 @@ package body Ada.Wide_Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if Spacing not in Positive_Count then
+      if not Spacing'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1348,7 +1348,7 @@ package body Ada.Wide_Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Positive_Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1436,7 +1436,7 @@ package body Ada.Wide_Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Positive_Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1481,7 +1481,7 @@ package body Ada.Wide_Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1514,7 +1514,7 @@ package body Ada.Wide_Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if To not in Count then
+      if not To'Valid then
          raise Constraint_Error;
       end if;
 
@@ -1572,7 +1572,7 @@ package body Ada.Wide_Wide_Text_IO is
       --  explicit test is that we don't want junk values around, even if
       --  checks are off in the caller.
 
-      if Spacing not in Positive_Count then
+      if not Spacing'Valid then
          raise Constraint_Error;
       end if;