summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-browsers.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/fltk-widgets-groups-browsers.adb')
-rw-r--r--src/fltk-widgets-groups-browsers.adb48
1 files changed, 27 insertions, 21 deletions
diff --git a/src/fltk-widgets-groups-browsers.adb b/src/fltk-widgets-groups-browsers.adb
index 0c65653..aa717b7 100644
--- a/src/fltk-widgets-groups-browsers.adb
+++ b/src/fltk-widgets-groups-browsers.adb
@@ -6,6 +6,7 @@
with
+ Ada.Assertions,
Interfaces.C.Strings,
System.Address_To_Access_Conversions;
@@ -13,6 +14,11 @@ with
package body FLTK.Widgets.Groups.Browsers is
+ package Chk renames Ada.Assertions;
+
+
+
+
------------------------
-- Constants From C --
------------------------
@@ -773,10 +779,10 @@ package body FLTK.Widgets.Groups.Browsers is
Boolean'Pos (State),
Boolean'Pos (Do_Callbacks));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
return Boolean'Val (Code);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Set_Select;
@@ -792,9 +798,9 @@ package body FLTK.Widgets.Groups.Browsers is
Boolean'Pos (State),
Boolean'Pos (Do_Callbacks));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Set_Select;
@@ -809,10 +815,10 @@ package body FLTK.Widgets.Groups.Browsers is
Cursor_To_Address (Item),
Boolean'Pos (Do_Callbacks));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
return Boolean'Val (Code);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Select_Only;
@@ -826,9 +832,9 @@ package body FLTK.Widgets.Groups.Browsers is
Cursor_To_Address (Item),
Boolean'Pos (Do_Callbacks));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Select_Only;
@@ -849,10 +855,10 @@ package body FLTK.Widgets.Groups.Browsers is
(This.Void_Ptr,
Boolean'Pos (Do_Callbacks));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
return Boolean'Val (Code);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Deselect;
@@ -864,9 +870,9 @@ package body FLTK.Widgets.Groups.Browsers is
(This.Void_Ptr,
Boolean'Pos (Do_Callbacks));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Deselect;
@@ -886,10 +892,10 @@ package body FLTK.Widgets.Groups.Browsers is
Code : Interfaces.C.int := fl_abstract_browser_displayed
(This.Void_Ptr, Cursor_To_Address (Item));
begin
- if Code not in 0 .. 1 then
- raise Internal_FLTK_Error;
- end if;
+ pragma Assert (Code in 0 .. 1);
return Boolean'Val (Code);
+ exception
+ when Chk.Assertion_Error => raise Internal_FLTK_Error;
end Is_Displayed;