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-postscript.adb | |
parent | 17473af7e8ed13e0a9399a69442f9839e5d83aef (diff) |
Internal_FLTK_Error raises are now pragma Asserts
Diffstat (limited to 'src/fltk-devices-surface-paged-postscript.adb')
-rw-r--r-- | src/fltk-devices-surface-paged-postscript.adb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/fltk-devices-surface-paged-postscript.adb b/src/fltk-devices-surface-paged-postscript.adb index 92653cb..fa9f66d 100644 --- a/src/fltk-devices-surface-paged-postscript.adb +++ b/src/fltk-devices-surface-paged-postscript.adb @@ -6,6 +6,7 @@ with + Ada.Assertions, Interfaces.C.Strings; use type @@ -16,6 +17,11 @@ use type package body FLTK.Devices.Surface.Paged.Postscript is + package Chk renames Ada.Assertions; + + + + ------------------------ -- Functions From C -- ------------------------ @@ -347,9 +353,9 @@ package body FLTK.Devices.Surface.Paged.Postscript is To_Cint (Format), To_Cint (Layout)); begin - if Code /= 0 then - raise Internal_FLTK_Error; - end if; + pragma Assert (Code = 0); + exception + when Chk.Assertion_Error => raise Internal_FLTK_Error; end Start_Job; @@ -366,11 +372,12 @@ package body FLTK.Devices.Surface.Paged.Postscript is To_Cint (Layout)); begin case Code is - when 0 => null; when 1 => raise User_Cancel_Error; when 2 => raise File_Open_Error; - when others => raise Internal_FLTK_Error; + when others => pragma Assert (Code = 0); end case; + exception + when Chk.Assertion_Error => raise Internal_FLTK_Error; end Start_Job; |