summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-07-28 10:57:19 +1000
committerJed Barber <jjbarber@y7mail.com>2017-07-28 10:57:19 +1000
commit2d00fe01eb5fb245d0ca4be020e5e08895631805 (patch)
treec4e615ac361fd0eabba5648adce0d76fa37bca9f /src
parent1e761c7b4491377fe9c91a37c438856178cc4f8e (diff)
Forgot to add exceptions to derivative Image constructors
Diffstat (limited to 'src')
-rw-r--r--src/fltk-images-bitmaps-xbm.adb10
-rw-r--r--src/fltk-images-rgb-bmp.adb10
-rw-r--r--src/fltk-images-rgb-jpeg.adb10
-rw-r--r--src/fltk-images-rgb-png.adb10
-rw-r--r--src/fltk-images-rgb-pnm.adb10
-rw-r--r--src/fltk-images.adb5
-rw-r--r--src/fltk-images.ads8
7 files changed, 58 insertions, 5 deletions
diff --git a/src/fltk-images-bitmaps-xbm.adb b/src/fltk-images-bitmaps-xbm.adb
index c7f3023..6bc9a1d 100644
--- a/src/fltk-images-bitmaps-xbm.adb
+++ b/src/fltk-images-bitmaps-xbm.adb
@@ -47,6 +47,16 @@ package body FLTK.Images.Bitmaps.XBM is
return This : XBM_Image do
This.Void_Ptr := new_fl_xbm_image
(Interfaces.C.To_C (Filename));
+ case fl_image_fail (This.Void_Ptr) is
+ when 1 =>
+ raise No_Image_Error;
+ when 2 =>
+ raise File_Access_Error;
+ when 3 =>
+ raise Format_Error;
+ when others =>
+ null;
+ end case;
end return;
end Create;
diff --git a/src/fltk-images-rgb-bmp.adb b/src/fltk-images-rgb-bmp.adb
index be6deb6..124cdd4 100644
--- a/src/fltk-images-rgb-bmp.adb
+++ b/src/fltk-images-rgb-bmp.adb
@@ -47,6 +47,16 @@ package body FLTK.Images.RGB.BMP is
return This : BMP_Image do
This.Void_Ptr := new_fl_bmp_image
(Interfaces.C.To_C (Filename));
+ case fl_image_fail (This.Void_Ptr) is
+ when 1 =>
+ raise No_Image_Error;
+ when 2 =>
+ raise File_Access_Error;
+ when 3 =>
+ raise Format_Error;
+ when others =>
+ null;
+ end case;
end return;
end Create;
diff --git a/src/fltk-images-rgb-jpeg.adb b/src/fltk-images-rgb-jpeg.adb
index 47ea386..a74604e 100644
--- a/src/fltk-images-rgb-jpeg.adb
+++ b/src/fltk-images-rgb-jpeg.adb
@@ -47,6 +47,16 @@ package body FLTK.Images.RGB.JPEG is
return This : JPEG_Image do
This.Void_Ptr := new_fl_jpeg_image
(Interfaces.C.To_C (Filename));
+ case fl_image_fail (This.Void_Ptr) is
+ when 1 =>
+ raise No_Image_Error;
+ when 2 =>
+ raise File_Access_Error;
+ when 3 =>
+ raise Format_Error;
+ when others =>
+ null;
+ end case;
end return;
end Create;
diff --git a/src/fltk-images-rgb-png.adb b/src/fltk-images-rgb-png.adb
index 9606e74..d50de04 100644
--- a/src/fltk-images-rgb-png.adb
+++ b/src/fltk-images-rgb-png.adb
@@ -47,6 +47,16 @@ package body FLTK.Images.RGB.PNG is
return This : PNG_Image do
This.Void_Ptr := new_fl_png_image
(Interfaces.C.To_C (Filename));
+ case fl_image_fail (This.Void_Ptr) is
+ when 1 =>
+ raise No_Image_Error;
+ when 2 =>
+ raise File_Access_Error;
+ when 3 =>
+ raise Format_Error;
+ when others =>
+ null;
+ end case;
end return;
end Create;
diff --git a/src/fltk-images-rgb-pnm.adb b/src/fltk-images-rgb-pnm.adb
index dd6ae26..5368b3e 100644
--- a/src/fltk-images-rgb-pnm.adb
+++ b/src/fltk-images-rgb-pnm.adb
@@ -47,6 +47,16 @@ package body FLTK.Images.RGB.PNM is
return This : PNM_Image do
This.Void_Ptr := new_fl_pnm_image
(Interfaces.C.To_C (Filename));
+ case fl_image_fail (This.Void_Ptr) is
+ when 1 =>
+ raise No_Image_Error;
+ when 2 =>
+ raise File_Access_Error;
+ when 3 =>
+ raise Format_Error;
+ when others =>
+ null;
+ end case;
end return;
end Create;
diff --git a/src/fltk-images.adb b/src/fltk-images.adb
index cadf47b..5d72e6d 100644
--- a/src/fltk-images.adb
+++ b/src/fltk-images.adb
@@ -54,11 +54,6 @@ package body FLTK.Images is
(I : in System.Address);
pragma Import (C, fl_image_inactive, "fl_image_inactive");
- function fl_image_fail
- (I : in System.Address)
- return Interfaces.C.int;
- pragma Import (C, fl_image_fail, "fl_image_fail");
-
diff --git a/src/fltk-images.ads b/src/fltk-images.ads
index 3e47ee6..a3138e9 100644
--- a/src/fltk-images.ads
+++ b/src/fltk-images.ads
@@ -87,5 +87,13 @@ private
(This : in out Image);
+
+
+ function fl_image_fail
+ (I : in System.Address)
+ return Interfaces.C.int;
+ pragma Import (C, fl_image_fail, "fl_image_fail");
+
+
end FLTK.Images;