From 53aa8144851913994b963ed611cca8885b8f9a9e Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Thu, 9 Jan 2025 23:53:32 +1300 Subject: Internal_FLTK_Error raises are now pragma Asserts --- src/fltk-devices-surface-paged.adb | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/fltk-devices-surface-paged.adb') diff --git a/src/fltk-devices-surface-paged.adb b/src/fltk-devices-surface-paged.adb index 2fb6450..829974a 100644 --- a/src/fltk-devices-surface-paged.adb +++ b/src/fltk-devices-surface-paged.adb @@ -6,6 +6,7 @@ with + Ada.Assertions, Ada.Strings.Unbounded, Interfaces.C.Strings; @@ -18,7 +19,8 @@ use type package body FLTK.Devices.Surface.Paged is - package SU renames Ada.Strings.Unbounded; + package Chk renames Ada.Assertions; + package SU renames Ada.Strings.Unbounded; @@ -204,11 +206,12 @@ package body FLTK.Devices.Surface.Paged is begin if Value in Page_Format'Pos (A0) .. Page_Format'Pos (Envelope) then return Page_Format'Val (Value); - elsif Value = fl_page_format_media then - return Media; else - raise Internal_FLTK_Error; + pragma Assert (Value = fl_page_format_media); + return Media; end if; + exception + when Chk.Assertion_Error => raise Internal_FLTK_Error; end To_Page_Format; @@ -235,11 +238,12 @@ package body FLTK.Devices.Surface.Paged is return Landscape; elsif Value = fl_page_layout_reversed then return Reversed; - elsif Value = fl_page_layout_orientation then - return Orientation; else - raise Internal_FLTK_Error; + pragma Assert (Value = fl_page_layout_orientation); + return Orientation; end if; + exception + when Chk.Assertion_Error => raise Internal_FLTK_Error; end To_Page_Layout; -- cgit