This change reorganizes code to avoid gratuitous duplication.
No behaviour change, no test.

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-01-23  Thomas Quinot  <qui...@adacore.com>

        * a-textio.adb (Put): Rewrite one-parameter Character version to
        just call the two-parameter one with Current_Out.

Index: a-textio.adb
===================================================================
--- a-textio.adb        (revision 183406)
+++ a-textio.adb        (working copy)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---          Copyright (C) 1992-2010, Free Software Foundation, Inc.         --
+--          Copyright (C) 1992-2012, Free Software Foundation, Inc.         --
 --                                                                          --
 -- GNAT is free software;  you can  redistribute it  and/or modify it under --
 -- terms of the  GNU General Public License as published  by the Free Soft- --
@@ -1274,30 +1274,7 @@
 
    procedure Put (Item : Character) is
    begin
-      FIO.Check_Write_Status (AP (Current_Out));
-
-      if Current_Out.Line_Length /= 0
-        and then Current_Out.Col > Current_Out.Line_Length
-      then
-         New_Line (Current_Out);
-      end if;
-
-      --  If lower half character, or brackets encoding, output directly
-
-      if Character'Pos (Item) < 16#80#
-        or else Default_WCEM = WCEM_Brackets
-      then
-         if fputc (Character'Pos (Item), Current_Out.Stream) = EOF then
-            raise Device_Error;
-         end if;
-
-      --  Case of upper half character with non-brackets encoding
-
-      else
-         Put_Encoded (Current_Out, Item);
-      end if;
-
-      Current_Out.Col := Current_Out.Col + 1;
+      Put (Current_Out, Item);
    end Put;
 
    ---------

Reply via email to