/* zlibmodule.c -- gzip-compatible data compression */
-#include <Python.h>
-#include <zlib.h>
+#include "Python.h"
+#include "zlib.h"
/* The following parameters are copied from zutil.h, version 0.95 */
#define DEFLATED 8
"Can't allocate memory to compress data");
return NULL;
}
- zst.zalloc=(alloc_func)zst.zfree=(free_func)Z_NULL;
+ zst.zalloc=(alloc_func)NULL;
+ zst.zfree=(free_func)Z_NULL;
zst.next_out=(Byte *)output;
zst.next_in =(Byte *)input;
zst.avail_in=length;
free(output);
return NULL;
}
- ReturnVal=PyString_FromStringAndSize(output, zst.total_out);
+ ReturnVal=PyString_FromStringAndSize((char *)output, zst.total_out);
free(output);
return ReturnVal;
}
"Can't allocate memory to decompress data");
return NULL;
}
- zst.zalloc=(alloc_func)zst.zfree=(free_func)Z_NULL;
+ zst.zalloc=(alloc_func)NULL;
+ zst.zfree=(free_func)Z_NULL;
zst.next_out=(Byte *)output;
zst.next_in =(Byte *)input;
err=inflateInit(&zst);
free(output);
return NULL;
}
- ReturnVal=PyString_FromStringAndSize(output, zst.total_out);
+ ReturnVal=PyString_FromStringAndSize((char *)output, zst.total_out);
free(output);
return ReturnVal;
}
}
self=newcompobject(&Comptype);
if (self==NULL) return(NULL);
- self->zst.zalloc=(alloc_func)self->zst.zfree=(free_func)Z_NULL;
+ self->zst.zalloc=(alloc_func)NULL;
+ self->zst.zfree=(free_func)Z_NULL;
err=deflateInit2(&self->zst, level, method, wbits, memLevel, strategy);
switch(err)
{
}
self=newcompobject(&Decomptype);
if (self==NULL) return(NULL);
- self->zst.zalloc=(alloc_func)self->zst.zfree=(free_func)Z_NULL;
+ self->zst.zalloc=(alloc_func)NULL;
+ self->zst.zfree=(free_func)Z_NULL;
/* XXX If illegal values of wbits are allowed to get here, Python
coredumps, instead of raising an exception as it should.
This is a bug in zlib 0.95; I have reported it. */
PyErr_SetString(ZlibError, temp);
return NULL;
}
- RetVal=PyString_FromStringAndSize(buf, self->zst.next_out-buf);
+ RetVal=PyString_FromStringAndSize((char *)buf, self->zst.next_out-buf);
free(buf);
return RetVal;
}
PyErr_SetString(ZlibError, temp);
return NULL;
}
- RetVal=PyString_FromStringAndSize(buf, self->zst.next_out-buf);
+ RetVal=PyString_FromStringAndSize((char *)buf, self->zst.next_out-buf);
free(buf);
return RetVal;
}
PyErr_SetString(ZlibError, temp);
return NULL;
}
- RetVal=PyString_FromStringAndSize(buf, self->zst.next_out-buf);
+ RetVal=PyString_FromStringAndSize((char *)buf, self->zst.next_out-buf);
free(buf);
err=deflateEnd(&(self->zst));
if (err!=Z_OK)
PyErr_SetString(ZlibError, temp);
return NULL;
}
- RetVal=PyString_FromStringAndSize(buf, self->zst.next_out - buf);
+ RetVal=PyString_FromStringAndSize((char *)buf, self->zst.next_out - buf);
free(buf);
err=inflateEnd(&(self->zst));
if (err!=Z_OK)