This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch master
in repository legacy-imlib2.
View the commit online.
commit 1ba40142f702c8de34f321f11a9bd4f5f211c9d5
Author: Kim Woelders <[email protected]>
AuthorDate: Wed Feb 15 17:05:31 2023 +0100
api: Minor simplification in error handling in save functions
---
src/lib/api.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/lib/api.c b/src/lib/api.c
index ada98f3..3f160ba 100644
--- a/src/lib/api.c
+++ b/src/lib/api.c
@@ -1879,13 +1879,12 @@ imlib_image_remove_and_free_attached_data_value(const char *key)
}
static void
-_imlib_save_image(const char *file, int *err)
+_imlib_save_image(const char *file)
{
ImlibImage *im;
ImlibLoadArgs ila = { ILA0(ctx, 0, 0) };
CHECK_PARAM_POINTER("image", ctx->image);
- CHECK_PARAM_POINTER("file", file);
CAST_IMAGE(im, ctx->image);
ctx->error = __imlib_LoadImageData(im);
@@ -1894,38 +1893,37 @@ _imlib_save_image(const char *file, int *err)
__imlib_SaveImage(im, file, &ila);
ctx->error = ila.err;
- *err = ctx->error;
}
EAPI void
imlib_save_image(const char *file)
{
- int err;
+ CHECK_PARAM_POINTER("file", file);
- _imlib_save_image(file, &err);
+ _imlib_save_image(file);
}
EAPI void
imlib_save_image_with_error_return(const char *file,
Imlib_Load_Error * error_return)
{
- int err = 0;
+ CHECK_PARAM_POINTER("file", file);
- _imlib_save_image(file, &err);
+ _imlib_save_image(file);
if (error_return)
- *error_return = __imlib_ErrorFromErrno(err, 1);
+ *error_return = __imlib_ErrorFromErrno(ctx->error, 1);
}
EAPI void
imlib_save_image_with_errno_return(const char *file, int *error_return)
{
- int err = 0;
+ CHECK_PARAM_POINTER("file", file);
- _imlib_save_image(file, &err);
+ _imlib_save_image(file);
if (error_return)
- *error_return = err;
+ *error_return = ctx->error;
}
EAPI Imlib_Image
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.