]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/src/terminal_interface-curses-forms-field_types.adb
ncurses 5.9 - patch 20140816
[ncurses.git] / Ada95 / src / terminal_interface-curses-forms-field_types.adb
index 5195a20a499c32e8312baba36b6970b07a26bfa3..99ee3741f97f9f7f6e8d7219a982c9f3305090e6 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998-2009,2011 Free Software Foundation, Inc.              --
+-- Copyright (c) 1998-2011,2014 Free Software Foundation, Inc.              --
 --                                                                          --
 -- Permission is hereby granted, free of charge, to any person obtaining a  --
 -- copy of this software and associated documentation files (the            --
@@ -35,8 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author:  Juergen Pfeifer, 1996
 --  Version Control:
---  $Revision: 1.25 $
---  $Date: 2011/03/22 23:22:27 $
+--  $Revision: 1.27 $
+--  $Date: 2014/05/24 21:31:05 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
@@ -130,10 +130,9 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
       Usr_Arg   : constant System.Address := Get_Arg (Fld);
       Low_Level : constant C_Field_Type := Get_Fieldtype (Fld);
       Arg : Argument_Access;
-      Res : Eti_Error;
       function Set_Fld_Type (F    : Field := Fld;
                              Cf   : C_Field_Type := Cft;
-                             Arg1 : Argument_Access) return C_Int;
+                             Arg1 : Argument_Access) return Eti_Error;
       pragma Import (C, Set_Fld_Type, "set_field_type_user");
 
    begin
@@ -152,10 +151,7 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
             end if;
          end if;
 
-         Res := Set_Fld_Type (Arg1 => Arg);
-         if Res /= E_Ok then
-            Eti_Exception (Res);
-         end if;
+         Eti_Exception (Set_Fld_Type (Arg1 => Arg));
       end if;
    end Wrap_Builtin;
 
@@ -223,7 +219,6 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
    --
    function C_Builtin_Router return C_Field_Type
    is
-      Res : Eti_Error;
       T   : C_Field_Type;
    begin
       if M_Builtin_Router = Null_Field_Type then
@@ -232,13 +227,10 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
          if T = Null_Field_Type then
             raise Form_Exception;
          else
-            Res := Set_Fieldtype_Arg (T,
-                                      Make_Arg'Access,
-                                      Copy_Arg'Access,
-                                      Free_Arg'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
+            Eti_Exception (Set_Fieldtype_Arg (T,
+                                              Make_Arg'Access,
+                                              Copy_Arg'Access,
+                                              Free_Arg'Access));
          end if;
          M_Builtin_Router := T;
       end if;
@@ -250,7 +242,6 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
    --
    function C_Choice_Router return C_Field_Type
    is
-      Res : Eti_Error;
       T   : C_Field_Type;
    begin
       if M_Choice_Router = Null_Field_Type then
@@ -259,20 +250,14 @@ package body Terminal_Interface.Curses.Forms.Field_Types is
          if T = Null_Field_Type then
             raise Form_Exception;
          else
-            Res := Set_Fieldtype_Arg (T,
-                                      Make_Arg'Access,
-                                      Copy_Arg'Access,
-                                      Free_Arg'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
+            Eti_Exception (Set_Fieldtype_Arg (T,
+                                              Make_Arg'Access,
+                                              Copy_Arg'Access,
+                                              Free_Arg'Access));
 
-            Res := Set_Fieldtype_Choice (T,
-                                         Next_Router'Access,
-                                         Prev_Router'Access);
-            if Res /= E_Ok then
-               Eti_Exception (Res);
-            end if;
+            Eti_Exception (Set_Fieldtype_Choice (T,
+                                                 Next_Router'Access,
+                                                 Prev_Router'Access));
          end if;
          M_Choice_Router := T;
       end if;