From 2082d7e1978952138155be7dce29f20004bd71a5 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Sat, 21 Sep 2013 16:41:23 +0000 Subject: Fixes STR# 2973: collection of Sun compiler fixes. Applied str_2973_r9979_sun-fix-warnings-7.patch (with small mods) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9980 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_JPEG_Image.cxx | 52 +++++++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 24 deletions(-) (limited to 'src/Fl_JPEG_Image.cxx') diff --git a/src/Fl_JPEG_Image.cxx b/src/Fl_JPEG_Image.cxx index ade8df56e..47120a7de 100644 --- a/src/Fl_JPEG_Image.cxx +++ b/src/Fl_JPEG_Image.cxx @@ -212,35 +212,39 @@ typedef struct { typedef my_source_mgr *my_src_ptr; -void init_source (j_decompress_ptr cinfo) { - my_src_ptr src = (my_src_ptr)cinfo->src; - src->s = src->data; -} +extern "C" { -boolean fill_input_buffer(j_decompress_ptr cinfo) { - my_src_ptr src = (my_src_ptr)cinfo->src; - size_t nbytes = 4096; - src->pub.next_input_byte = src->s; - src->pub.bytes_in_buffer = nbytes; - src->s += nbytes; - return TRUE; -} + static void init_source(j_decompress_ptr cinfo) { + my_src_ptr src = (my_src_ptr)cinfo->src; + src->s = src->data; + } -void term_source(j_decompress_ptr cinfo) -{ -} + static boolean fill_input_buffer(j_decompress_ptr cinfo) { + my_src_ptr src = (my_src_ptr)cinfo->src; + size_t nbytes = 4096; + src->pub.next_input_byte = src->s; + src->pub.bytes_in_buffer = nbytes; + src->s += nbytes; + return TRUE; + } + + static void term_source(j_decompress_ptr cinfo) + { + } -void skip_input_data(j_decompress_ptr cinfo, long num_bytes) { - my_src_ptr src = (my_src_ptr)cinfo->src; - if (num_bytes > 0) { - while (num_bytes > (long)src->pub.bytes_in_buffer) { - num_bytes -= (long)src->pub.bytes_in_buffer; - fill_input_buffer(cinfo); + static void skip_input_data(j_decompress_ptr cinfo, long num_bytes) { + my_src_ptr src = (my_src_ptr)cinfo->src; + if (num_bytes > 0) { + while (num_bytes > (long)src->pub.bytes_in_buffer) { + num_bytes -= (long)src->pub.bytes_in_buffer; + fill_input_buffer(cinfo); + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; } - src->pub.next_input_byte += (size_t) num_bytes; - src->pub.bytes_in_buffer -= (size_t) num_bytes; } -} + +} // extern "C" static void jpeg_mem_src(j_decompress_ptr cinfo, const unsigned char *data) { -- cgit v1.2.3