[IMAGE-SIG] declaration fixes for Imaging-0.3a1

gregc@cgl.ucsf.EDU gregc@cgl.ucsf.EDU
Fri, 5 Sep 1997 18:17:59 -0700


These fixes are not necessary, but stop various compiler warnings (type
mismatches, statements with "null effects").  I also included modifications
for the jpeg 6a library.

	Greg Couch
	gregc@cgl.ucsf.edu
-----
===================================================================
RCS file: RCS/_imagingmodule.c,v
retrieving revision 1.1
diff -c -r1.1 _imagingmodule.c
*** 1.1	1997/09/05 21:33:43
--- _imagingmodule.c	1997/09/05 21:36:07
***************
*** 828,835 ****
  static PyObject* 
  _getprojection(ImagingObject* self, PyObject* args)
  {
!     char* xprofile;
!     char* yprofile;
      PyObject* result;
  
      xprofile = malloc(self->image->xsize);
--- 828,835 ----
  static PyObject* 
  _getprojection(ImagingObject* self, PyObject* args)
  {
!     UINT8* xprofile;
!     UINT8* yprofile;
      PyObject* result;
  
      xprofile = malloc(self->image->xsize);
***************
*** 1234,1240 ****
  static PyObject* 
  _crc32(PyObject* self, PyObject* args)
  {
!     char* buffer;
      int bytes;
      int hi, lo;
      UINT32 crc;
--- 1234,1240 ----
  static PyObject* 
  _crc32(PyObject* self, PyObject* args)
  {
!     UINT8* buffer;
      int bytes;
      int hi, lo;
      UINT32 crc;
===================================================================
RCS file: libImaging/RCS/JpegDecode.c,v
retrieving revision 1.1
diff -c -r1.1 libImaging/JpegDecode.c
*** 1.1	1997/09/05 21:05:32
--- libImaging/JpegDecode.c	1997/09/05 21:06:10
***************
*** 33,45 ****
  /* Suspending input handler						*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF void
  stub(j_decompress_ptr cinfo)
  {
      /* empty */
  }
  
! METHODDEF boolean
  fill_input_buffer(j_decompress_ptr cinfo)
  {
      /* Suspension */
--- 33,45 ----
  /* Suspending input handler						*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF(void)
  stub(j_decompress_ptr cinfo)
  {
      /* empty */
  }
  
! METHODDEF(boolean)
  fill_input_buffer(j_decompress_ptr cinfo)
  {
      /* Suspension */
***************
*** 46,52 ****
      return FALSE;
  }
  
! METHODDEF void
  skip_input_data(j_decompress_ptr cinfo, long num_bytes)
  {
      JPEGSOURCE* source = (JPEGSOURCE*) cinfo->src;
--- 46,52 ----
      return FALSE;
  }
  
! METHODDEF(void)
  skip_input_data(j_decompress_ptr cinfo, long num_bytes)
  {
      JPEGSOURCE* source = (JPEGSOURCE*) cinfo->src;
***************
*** 66,72 ****
  }
  
  
! GLOBAL void
  jpeg_buffer_src(j_decompress_ptr cinfo, JPEGSOURCE* source)
  {
    cinfo->src = (void*) source;
--- 66,72 ----
  }
  
  
! GLOBAL(void)
  jpeg_buffer_src(j_decompress_ptr cinfo, JPEGSOURCE* source)
  {
    cinfo->src = (void*) source;
***************
*** 87,93 ****
  /* Error handler							*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF void
  error(j_common_ptr cinfo)
  {
    JPEGERROR* error;
--- 87,93 ----
  /* Error handler							*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF(void)
  error(j_common_ptr cinfo)
  {
    JPEGERROR* error;
===================================================================
RCS file: libImaging/RCS/JpegEncode.c,v
retrieving revision 1.1
diff -c -r1.1 libImaging/JpegEncode.c
*** 1.1	1997/09/05 21:05:39
--- libImaging/JpegEncode.c	1997/09/05 21:06:28
***************
*** 32,44 ****
  /* Suspending output handler						*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF void
  stub(j_compress_ptr cinfo)
  {
      /* empty */
  }
  
! METHODDEF boolean
  empty_output_buffer (j_compress_ptr cinfo)
  {
      /* Suspension */
--- 32,44 ----
  /* Suspending output handler						*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF(void)
  stub(j_compress_ptr cinfo)
  {
      /* empty */
  }
  
! METHODDEF(boolean)
  empty_output_buffer (j_compress_ptr cinfo)
  {
      /* Suspension */
***************
*** 45,51 ****
      return FALSE;
  }
  
! GLOBAL void
  jpeg_buffer_dest(j_compress_ptr cinfo, JPEGDESTINATION* destination)
  {
      cinfo->dest = (void*) destination;
--- 45,51 ----
      return FALSE;
  }
  
! GLOBAL(void)
  jpeg_buffer_dest(j_compress_ptr cinfo, JPEGDESTINATION* destination)
  {
      cinfo->dest = (void*) destination;
***************
*** 60,66 ****
  /* Error handler							*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF void
  error(j_common_ptr cinfo)
  {
    JPEGERROR* error;
--- 60,66 ----
  /* Error handler							*/
  /* -------------------------------------------------------------------- */
  
! METHODDEF(void)
  error(j_common_ptr cinfo)
  {
    JPEGERROR* error;
===================================================================
RCS file: libImaging/RCS/Draw.c,v
retrieving revision 1.1
diff -c -r1.1 libImaging/Draw.c
*** 1.1	1997/09/05 21:06:52
--- libImaging/Draw.c	1997/09/05 21:07:23
***************
*** 146,154 ****
  }
  
  static int
! _cmp(const float *y0, const float *y1)
  {
!     return y0[0] - y1[0];
  }
  
  static inline void
--- 146,154 ----
  }
  
  static int
! _cmp(const void *y0, const void *y1)
  {
!     return ((const float *) y0)[0] - ((const float *) y1)[0];
  }
  
  static inline void
===================================================================
RCS file: libImaging/RCS/BitDecode.c,v
retrieving revision 1.1
diff -c -r1.1 libImaging/BitDecode.c
*** 1.1	1997/09/05 21:12:33
--- libImaging/BitDecode.c	1997/09/05 21:12:50
***************
*** 28,40 ****
  
          /* this decoder only works for float32 image buffers */
          if (im->type != 2) {
! 	    state->errcode == IMAGING_CODEC_CONFIG;
  	    return -1;
          }
  
          /* sanity check */
          if (bitstate->bits < 1 || bitstate->bits >= 32) {
! 	    state->errcode == IMAGING_CODEC_CONFIG;
  	    return -1;
          }
  
--- 28,40 ----
  
          /* this decoder only works for float32 image buffers */
          if (im->type != 2) {
! 	    state->errcode = IMAGING_CODEC_CONFIG;
  	    return -1;
          }
  
          /* sanity check */
          if (bitstate->bits < 1 || bitstate->bits >= 32) {
! 	    state->errcode = IMAGING_CODEC_CONFIG;
  	    return -1;
          }
  
===================================================================
RCS file: libImaging/RCS/ZipEncode.c,v
retrieving revision 1.1
diff -c -r1.1 libImaging/ZipEncode.c
*** 1.1	1997/09/05 21:12:33
--- libImaging/ZipEncode.c	1997/09/05 21:12:54
***************
*** 79,85 ****
  			   (context->mode == ZIP_PNG) ? Z_FILTERED
  						      : Z_DEFAULT_STRATEGY);
  	if (err < 0) {
! 	    state->errcode == IMAGING_CODEC_CONFIG;
  	    return -1;
  	}
  
--- 79,85 ----
  			   (context->mode == ZIP_PNG) ? Z_FILTERED
  						      : Z_DEFAULT_STRATEGY);
  	if (err < 0) {
! 	    state->errcode = IMAGING_CODEC_CONFIG;
  	    return -1;
  	}
  
***************
*** 87,93 ****
  	    err = deflateSetDictionary(&context->z_stream, context->dictionary,
  				       context->dictionary_size);
  	    if (err < 0) {
! 		state->errcode == IMAGING_CODEC_CONFIG;
  		return -1;
  	    }
  	}
--- 87,93 ----
  	    err = deflateSetDictionary(&context->z_stream, context->dictionary,
  				       context->dictionary_size);
  	    if (err < 0) {
! 		state->errcode = IMAGING_CODEC_CONFIG;
  		return -1;
  	    }
  	}
===================================================================
RCS file: libImaging/RCS/Zip.h,v
retrieving revision 1.1
diff -c -r1.1 libImaging/Zip.h
*** 1.1	1997/09/05 21:15:55
--- libImaging/Zip.h	1997/09/05 21:17:39
***************
*** 1,6 ****
  /*
   * The Python Imaging Library.
!  * $Id: Zip.h,v 1.1 1997/09/05 21:15:55 gregc Exp gregc $
   *
   * declarations for the ZIP codecs
   *
--- 1,6 ----
  /*
   * The Python Imaging Library.
!  * $Id: Zip.h,v 1.2 1997/06/01 18:07:43 fl Exp $
   *
   * declarations for the ZIP codecs
   *
***************
*** 29,35 ****
      int optimize;
  
      /* Predefined dictionary (experimental) */
!     char* dictionary;
      int dictionary_size;
  
      /* PRIVATE CONTEXT (set by decoder/encoder) */
--- 29,35 ----
      int optimize;
  
      /* Predefined dictionary (experimental) */
!     Bytef *dictionary;
      int dictionary_size;
  
      /* PRIVATE CONTEXT (set by decoder/encoder) */
===================================================================
RCS file: libImaging/RCS/Quantize.c,v
retrieving revision 1.1
diff -c -r1.1 libImaging/Quantize.c
*** 1.1	1997/09/05 21:19:32
--- libImaging/Quantize.c	1997/09/05 21:20:52
***************
*** 184,190 ****
      } else if (strcmp(imIn->mode, "P") == 0 && imIn->palette &&
  	       strcmp(imIn->palette->mode, "RGB") == 0) {
  	/* Palette image */
! 	char* p = imIn->palette->palette;
  	for (y = 0; y < imIn->ysize; y++) {
  	    UINT8* in = imIn->image8[y];
  	    for (x = 0; x < imIn->xsize; x++) {
--- 184,190 ----
      } else if (strcmp(imIn->mode, "P") == 0 && imIn->palette &&
  	       strcmp(imIn->palette->mode, "RGB") == 0) {
  	/* Palette image */
! 	UINT8* p = imIn->palette->palette;
  	for (y = 0; y < imIn->ysize; y++) {
  	    UINT8* in = imIn->image8[y];
  	    for (x = 0; x < imIn->xsize; x++) {

_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________