X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsrc%2Fterminal_interface-curses-forms.adb;h=8b01e164299d7c7c546f9ebfa8eebb5410c493fa;hp=b9be41a889f2b585cfebbc741e4ec187d4e65f97;hb=e9d205b51699dd452427c908758daa13cccfe2f6;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/Ada95/src/terminal_interface-curses-forms.adb b/Ada95/src/terminal_interface-curses-forms.adb index b9be41a8..8b01e164 100644 --- a/Ada95/src/terminal_interface-curses-forms.adb +++ b/Ada95/src/terminal_interface-curses-forms.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2004,2008 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 -- @@ -34,9 +34,9 @@ -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 --- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control: --- $Revision: 1.21 $ +-- $Revision: 1.26 $ +-- $Date: 2008/07/26 18:50:44 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Unchecked_Deallocation; @@ -331,7 +331,7 @@ package body Terminal_Interface.Curses.Forms is Opt : C_Int) return C_Int; pragma Import (C, Set_Field_Opts, "set_field_opts"); - Opt : C_Int := FOS_2_CInt (Options); + Opt : constant C_Int := FOS_2_CInt (Options); Res : Eti_Error; begin Res := Set_Field_Opts (Fld, Opt); @@ -354,7 +354,7 @@ package body Terminal_Interface.Curses.Forms is pragma Import (C, Field_Opts_Off, "field_opts_off"); Err : Eti_Error; - Opt : C_Int := FOS_2_CInt (Options); + Opt : constant C_Int := FOS_2_CInt (Options); begin if On then Err := Field_Opts_On (Fld, Opt); @@ -374,7 +374,7 @@ package body Terminal_Interface.Curses.Forms is function Field_Opts (Fld : Field) return C_Int; pragma Import (C, Field_Opts, "field_opts"); - Res : C_Int := Field_Opts (Fld); + Res : constant C_Int := Field_Opts (Fld); begin Options := CInt_2_FOS (Res); end Get_Options; @@ -759,7 +759,7 @@ package body Terminal_Interface.Curses.Forms is P : Pointer := C_Fields (Frm); begin - if P = null or else Index not in 1 .. Field_Count (Frm) then + if P = null or else Index > Field_Count (Frm) then raise Form_Exception; else P := P + ptrdiff_t (C_Int (Index) - 1); @@ -846,7 +846,7 @@ package body Terminal_Interface.Curses.Forms is Opt : C_Int) return C_Int; pragma Import (C, Set_Form_Opts, "set_form_opts"); - Opt : C_Int := FrmOS_2_CInt (Options); + Opt : constant C_Int := FrmOS_2_CInt (Options); Res : Eti_Error; begin Res := Set_Form_Opts (Frm, Opt); @@ -869,7 +869,7 @@ package body Terminal_Interface.Curses.Forms is pragma Import (C, Form_Opts_Off, "form_opts_off"); Err : Eti_Error; - Opt : C_Int := FrmOS_2_CInt (Options); + Opt : constant C_Int := FrmOS_2_CInt (Options); begin if On then Err := Form_Opts_On (Frm, Opt); @@ -889,7 +889,7 @@ package body Terminal_Interface.Curses.Forms is function Form_Opts (Frm : Form) return C_Int; pragma Import (C, Form_Opts, "form_opts"); - Res : C_Int := Form_Opts (Frm); + Res : constant C_Int := Form_Opts (Frm); begin Options := CInt_2_FrmOS (Res); end Get_Options; @@ -996,7 +996,7 @@ package body Terminal_Interface.Curses.Forms is function Frm_Driver (Frm : Form; Key : C_Int) return C_Int; pragma Import (C, Frm_Driver, "form_driver"); - R : Eti_Error := Frm_Driver (Frm, C_Int (Key)); + R : constant Eti_Error := Frm_Driver (Frm, C_Int (Key)); begin if R /= E_Ok then if R = E_Unknown_Command then @@ -1136,7 +1136,7 @@ package body Terminal_Interface.Curses.Forms is begin if FA /= null and then Free_Fields then for I in FA'First .. (FA'Last - 1) loop - if (FA (I) /= Null_Field) then + if FA (I) /= Null_Field then Delete (FA (I)); end if; end loop;