1 As of JPEG-9, the type 'boolean' is an enumeration, but since glib defines
2 TRUE and FALSE as numeric constants and this is C++, they need to be explicitly
5 --- a/src/af/util/xp/ut_jpeg.cpp
6 +++ b/src/af/util/xp/ut_jpeg.cpp
7 @@ -102,7 +102,7 @@ static boolean _jpegFillInputBuffer (j_decompress_ptr cinfo)
8 src->pub.next_input_byte = src->sourceBuf->getPointer (src->pos);
9 src->pub.bytes_in_buffer = src->sourceBuf->getLength ();
11 - return 1; // boolean is a libjpeg type that is an int.
12 + return (boolean)TRUE;
18 In the following file, we also need to reverse header include order: JPEG needs
19 to be included before Glib, which is included by "abiword-garble.h" for this fix
22 The JPEG header needs the types FILE and size_t, we can get them from cstdio.
24 --- a/plugins/garble/xp/abiword-garble-jpeg.cpp 2009-09-05 17:49:53.000000000 +0200
25 +++ b/plugins/garble/xp/abiword-garble-jpeg.cpp 2014-09-07 21:28:49.364008571 +0200
30 -#include "abiword-garble.h"
37 +#include "abiword-garble.h"
39 //-----------------------------------------------------------------------------
41 struct jpeg_destination_mgr pub;
43 mem_dest_ptr dest = (mem_dest_ptr) cinfo->dest;
44 dest->pub.next_output_byte = dest->buf;
45 dest->pub.free_in_buffer = dest->bufsize;
47 + return (boolean)FALSE;
50 //-----------------------------------------------------------------------------
52 cinfo.image_width = (JDIMENSION) w;
53 cinfo.image_height = (JDIMENSION) h;
54 jpeg_set_defaults (&cinfo);
55 - jpeg_set_quality ( &cinfo, 50, TRUE );
56 + jpeg_set_quality ( &cinfo, 50, (boolean)TRUE );
57 cinfo.dest = (struct jpeg_destination_mgr *) (*cinfo.mem->alloc_small)((j_common_ptr)&cinfo, JPOOL_PERMANENT, sizeof(mem_destination_mgr));
58 dest = (mem_dest_ptr) cinfo.dest;
59 dest->pub.init_destination = _jpeg_init_destination;
61 dest->buf = (JOCTET*)data;
62 dest->bufsize = length;
64 - jpeg_start_compress (&cinfo, TRUE);
65 + jpeg_start_compress (&cinfo, (boolean)TRUE);
68 for (int i=0; i<h; ++i)
74 \ No newline at end of file