]> Creatis software - gdcm.git/commitdiff
BUG: Fix compilation warning on SunOS-CC: Warning (Anachronism): Assigning void(...
authormalaterre <malaterre>
Fri, 4 Feb 2005 23:30:21 +0000 (23:30 +0000)
committermalaterre <malaterre>
Fri, 4 Feb 2005 23:30:21 +0000 (23:30 +0000)
src/gdcmJpeg.cxx
src/jdatadst.cxx
src/jdatasrc.cxx

index 762de9d4f70e69dc2d6dd688d469873308b52f0f..5a2fb98418b7eb04edc04fd06822f494d013187c 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmJpeg.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/02 10:02:18 $
-  Version:   $Revision: 1.40 $
+  Date:      $Date: 2005/02/04 23:30:21 $
+  Version:   $Revision: 1.41 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -173,6 +173,9 @@ bool gdcm_write_JPEG_file (std::ofstream *fp, void *im_buf,
   return true; //???
 }
 
+extern "C" {
+  typedef void(*void_jpeg_common_struct)(jpeg_common_struct*);
+}
 
 //-----------------------------------------------------------------------------
 struct my_error_mgr {
@@ -243,7 +246,7 @@ bool JPEGFragment::ReadJPEGFile (std::ifstream *fp, void *image_buffer, int &sta
   // We set up the normal JPEG error routines, then override error_exit.
   
   cinfo.err = jpeg_std_error(&jerr.pub);
-  jerr.pub.error_exit = my_error_exit;
+  jerr.pub.error_exit = reinterpret_cast<void_jpeg_common_struct>(my_error_exit);
   
   // Establish the setjmp return context for my_error_exit to use.
   if (setjmp(jerr.setjmp_buffer))
index 3b85057033088a5165efae472ad333dd43262b58..b07765539ed0b40c027e586f3862f6b7467fe2e2 100644 (file)
 
 /* Expanded data destination object for stdio output */
 
+extern "C" {
+  typedef  int(*int_jpeg_compress_struct)(jpeg_compress_struct*);
+  typedef  void(*void_jpeg_compress_struct)(jpeg_compress_struct*);
+}
+
 typedef struct {
   struct jpeg_destination_mgr pub; /* public fields */
 
@@ -159,8 +164,8 @@ jpeg_stdio_dest (j_compress_ptr cinfo, std::ofstream * outfile)
   }
 
   dest = (my_dest_ptr) cinfo->dest;
-  dest->pub.init_destination = init_destination;
-  dest->pub.empty_output_buffer = empty_output_buffer;
-  dest->pub.term_destination = term_destination;
+  dest->pub.init_destination = reinterpret_cast<void_jpeg_compress_struct>(init_destination);
+  dest->pub.empty_output_buffer = reinterpret_cast<int_jpeg_compress_struct>(empty_output_buffer);
+  dest->pub.term_destination = reinterpret_cast<void_jpeg_compress_struct>(term_destination);
   dest->outfile = outfile;
 }
index c0fb1220d5b923a6e5674effcc40f0e58c42434d..a7c0a368681f556e3cf0ed6f44c2bec3b31964fe 100644 (file)
 
 /* Expanded data source object for stdio input */
 
+extern "C" {
+  typedef  int(*int_jpeg_decompress_struct)(jpeg_decompress_struct*);
+  typedef  void(*void_jpeg_decompress_struct)(jpeg_decompress_struct*);
+  typedef  void(*void_jpeg_decompress_struct_long)(jpeg_decompress_struct*,long);
+}
+
 typedef struct {
   struct jpeg_source_mgr pub;  /* public fields */
 
@@ -214,11 +220,11 @@ jpeg_stdio_src (j_decompress_ptr cinfo, std::ifstream * infile, gdcm::JPEGFragme
   }
 
   src = (my_src_ptr) cinfo->src;
-  src->pub.init_source = init_source;
-  src->pub.fill_input_buffer = fill_input_buffer;
-  src->pub.skip_input_data = skip_input_data;
+  src->pub.init_source = reinterpret_cast<void_jpeg_decompress_struct>(init_source);
+  src->pub.fill_input_buffer = reinterpret_cast<int_jpeg_decompress_struct>(fill_input_buffer);
+  src->pub.skip_input_data = reinterpret_cast<void_jpeg_decompress_struct_long>(skip_input_data);
   src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */
-  src->pub.term_source = term_source;
+  src->pub.term_source = reinterpret_cast<void_jpeg_decompress_struct>(term_source);
   src->infile = infile;
   
   // Need to setup a new buffer, clean bytes_in_buffer and next_input_byte