summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-19 16:07:14 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-19 16:59:29 +0200
commitca48129caefa15548fec9bd4779dd87bde75f453 (patch)
tree5777a2cb72b2dc91144f973e3c12f3b81e9614cc
parentb4b5734d808fef558e715fff3529a2e6907e8041 (diff)
downloadphp-git-ca48129caefa15548fec9bd4779dd87bde75f453.tar.gz
Return void from php_jpeg_emit_message()
Instead of returning long and then casting to void. This fixes a build warning on Ubuntu 20.04. Closes GH-5742.
-rw-r--r--ext/gd/libgd/gd_jpeg.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/gd/libgd/gd_jpeg.c b/ext/gd/libgd/gd_jpeg.c
index 3f0241a8e0..e7c3d75291 100644
--- a/ext/gd/libgd/gd_jpeg.c
+++ b/ext/gd/libgd/gd_jpeg.c
@@ -47,7 +47,7 @@ typedef struct _jmpbuf_wrapper
int ignore_warning;
} jmpbuf_wrapper;
-static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
+static void php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
{
char message[JMSG_LENGTH_MAX];
jmpbuf_wrapper *jmpbufw;
@@ -81,11 +81,9 @@ static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
}
}
}
- return 1;
}
-
/* Called by the IJG JPEG library upon encountering a fatal error */
static void fatal_jpeg_error (j_common_ptr cinfo)
{
@@ -356,8 +354,7 @@ gdImagePtr gdImageCreateFromJpegCtxEx (gdIOCtx * infile, int ignore_warning)
cinfo.err = jpeg_std_error (&jerr);
cinfo.client_data = &jmpbufw;
-
- cinfo.err->emit_message = (void (*)(j_common_ptr,int)) php_jpeg_emit_message;
+ cinfo.err->emit_message = php_jpeg_emit_message;
if (setjmp (jmpbufw.jmpbuf) != 0) {
/* we're here courtesy of longjmp */