diff options
author | Pierre Joye <pierre.php@gmail.com> | 2015-01-17 09:10:31 +0100 |
---|---|---|
committer | Pierre Joye <pierre.php@gmail.com> | 2015-01-17 09:10:31 +0100 |
commit | 289c82929f0058da91b727de3b176e83f82d496b (patch) | |
tree | 9877c03b8afca20fb3c703c05ff78d3315f353ba /src/gd_jpeg.c | |
parent | 2b3130efe66f20547b55a030da84c63f21a3f5fb (diff) | |
download | libgd-289c82929f0058da91b727de3b176e83f82d496b.tar.gz |
port fix for saner boolean usage from https://reviews.facebook.net/D31695
Diffstat (limited to 'src/gd_jpeg.c')
-rw-r--r-- | src/gd_jpeg.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/src/gd_jpeg.c b/src/gd_jpeg.c index 925b417..760a51e 100644 --- a/src/gd_jpeg.c +++ b/src/gd_jpeg.c @@ -863,26 +863,12 @@ static int CMYKToRGB(int c, int m, int y, int k, int inverted) * almost a simple global replace from T. Lane's stdio versions. */ -/* Different versions of libjpeg use either 'jboolean' or 'boolean', and - * some platforms define 'boolean', and so forth. Deal with this - * madness by typedeffing 'safeboolean' to 'boolean' if HAVE_BOOLEAN - * is already set, because this is the test that libjpeg uses. - * Otherwise, typedef it to int, because that's what libjpeg does - * if HAVE_BOOLEAN is not defined. -TBB - */ - -#ifdef HAVE_BOOLEAN -typedef boolean safeboolean; -#else -typedef int safeboolean; -#endif /* HAVE_BOOLEAN */ - /* Expanded data source object for gdIOCtx input */ typedef struct { struct jpeg_source_mgr pub; /* public fields */ gdIOCtx *infile; /* source stream */ unsigned char *buffer; /* start of buffer */ - safeboolean start_of_file; /* have we gotten any data yet? */ + boolean start_of_file; /* have we gotten any data yet? */ } my_source_mgr; @@ -942,7 +928,7 @@ void init_source(j_decompress_ptr cinfo) #define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n" -safeboolean fill_input_buffer(j_decompress_ptr cinfo) +boolean fill_input_buffer(j_decompress_ptr cinfo) { my_src_ptr src = (my_src_ptr)cinfo->src; /* 2.0.12: signed size. Thanks to Geert Jansen */ @@ -1132,7 +1118,7 @@ void init_destination(j_compress_ptr cinfo) * write it out when emptying the buffer externally. */ -safeboolean empty_output_buffer(j_compress_ptr cinfo) +boolean empty_output_buffer(j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr)cinfo->dest; |