summaryrefslogtreecommitdiff
path: root/src/Fl_JPEG_Image.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_JPEG_Image.cxx')
-rw-r--r--src/Fl_JPEG_Image.cxx52
1 files changed, 28 insertions, 24 deletions
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)
{