Skip to content

Commit

Permalink
Return void from php_jpeg_emit_message()
Browse files Browse the repository at this point in the history
Instead of returning long and then casting to void.

This fixes a build warning on Ubuntu 20.04.

Closes phpGH-5742.
  • Loading branch information
nikic committed Jun 19, 2020
1 parent b4b5734 commit ca48129
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ext/gd/libgd/gd_jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit ca48129

Please sign in to comment.