Skip to content

Commit ca48129

Browse files
committed
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.
1 parent b4b5734 commit ca48129

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

ext/gd/libgd/gd_jpeg.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef struct _jmpbuf_wrapper
4747
int ignore_warning;
4848
} jmpbuf_wrapper;
4949

50-
static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
50+
static void php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
5151
{
5252
char message[JMSG_LENGTH_MAX];
5353
jmpbuf_wrapper *jmpbufw;
@@ -81,11 +81,9 @@ static long php_jpeg_emit_message(j_common_ptr jpeg_info, int level)
8181
}
8282
}
8383
}
84-
return 1;
8584
}
8685

8786

88-
8987
/* Called by the IJG JPEG library upon encountering a fatal error */
9088
static void fatal_jpeg_error (j_common_ptr cinfo)
9189
{
@@ -356,8 +354,7 @@ gdImagePtr gdImageCreateFromJpegCtxEx (gdIOCtx * infile, int ignore_warning)
356354

357355
cinfo.err = jpeg_std_error (&jerr);
358356
cinfo.client_data = &jmpbufw;
359-
360-
cinfo.err->emit_message = (void (*)(j_common_ptr,int)) php_jpeg_emit_message;
357+
cinfo.err->emit_message = php_jpeg_emit_message;
361358

362359
if (setjmp (jmpbufw.jmpbuf) != 0) {
363360
/* we're here courtesy of longjmp */

0 commit comments

Comments
 (0)