diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-09 23:53:32 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2025-01-09 23:53:32 +1300 |
commit | 53aa8144851913994b963ed611cca8885b8f9a9e (patch) | |
tree | 1b2a262cedb353b4aff00e14b200918ac17b11ab /src/fltk-devices-surface-paged.adb | |
parent | 17473af7e8ed13e0a9399a69442f9839e5d83aef (diff) |
Internal_FLTK_Error raises are now pragma Asserts
Diffstat (limited to 'src/fltk-devices-surface-paged.adb')
-rw-r--r-- | src/fltk-devices-surface-paged.adb | 18 |
1 files changed, 11 insertions, 7 deletions
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; |