From a7e88f6d17b8ff68c0cb6f10840445088d5264f0 Mon Sep 17 00:00:00 2001 From: dkf Date: Sat, 27 Dec 2008 10:07:05 +0000 Subject: Fix my silly blunders. [Bug 2470237] --- ChangeLog | 3 +++ generic/tcl.decls | 8 +++++--- generic/tclDecls.h | 12 ++++++------ generic/tclZlib.c | 16 +++++++--------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9daefa6..cd14668 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-12-27 Donal K. Fellows + * generic/tclZlib.c (ZlibStreamCmd): Fix compilation consistency. [Bug + * generic/tcl.decls: 2470237] + * generic/tclZlib.c (Tcl_ZlibStreamGet): Corrected the semantics of this function to be useful to the PNG implementation. If the argument object is empty, this gives the previous semantics. diff --git a/generic/tcl.decls b/generic/tcl.decls index dff3242..a9a5bcf 100644 --- a/generic/tcl.decls +++ b/generic/tcl.decls @@ -12,7 +12,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tcl.decls,v 1.166 2008/12/27 00:04:17 dkf Exp $ +# RCS: @(#) $Id: tcl.decls,v 1.167 2008/12/27 10:07:06 dkf Exp $ library tcl @@ -2249,10 +2249,12 @@ declare 611 generic { int buffersize, Tcl_Obj *gzipHeaderDictObj) } declare 612 generic { - unsigned int Tcl_ZlibCRC32(unsigned int crc, const char *buf, int len) + unsigned int Tcl_ZlibCRC32(unsigned int crc, const unsigned char *buf, + int len) } declare 613 generic { - unsigned int Tcl_ZlibAdler32(unsigned int adler, const char *buf, int len) + unsigned int Tcl_ZlibAdler32(unsigned int adler, const unsigned char *buf, + int len) } declare 614 generic { int Tcl_ZlibStreamInit(Tcl_Interp *interp, int mode, int format, diff --git a/generic/tclDecls.h b/generic/tclDecls.h index 74284ed..a680700 100644 --- a/generic/tclDecls.h +++ b/generic/tclDecls.h @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclDecls.h,v 1.167 2008/12/27 00:04:17 dkf Exp $ + * RCS: @(#) $Id: tclDecls.h,v 1.168 2008/12/27 10:07:06 dkf Exp $ */ #ifndef _TCLDECLS @@ -3704,14 +3704,14 @@ EXTERN int Tcl_ZlibInflate (Tcl_Interp * interp, int format, #ifndef Tcl_ZlibCRC32_TCL_DECLARED #define Tcl_ZlibCRC32_TCL_DECLARED /* 612 */ -EXTERN unsigned int Tcl_ZlibCRC32 (unsigned int crc, const char * buf, - int len); +EXTERN unsigned int Tcl_ZlibCRC32 (unsigned int crc, + const unsigned char * buf, int len); #endif #ifndef Tcl_ZlibAdler32_TCL_DECLARED #define Tcl_ZlibAdler32_TCL_DECLARED /* 613 */ EXTERN unsigned int Tcl_ZlibAdler32 (unsigned int adler, - const char * buf, int len); + const unsigned char * buf, int len); #endif #ifndef Tcl_ZlibStreamInit_TCL_DECLARED #define Tcl_ZlibStreamInit_TCL_DECLARED @@ -4446,8 +4446,8 @@ typedef struct TclStubs { void (*tcl_BackgroundException) (Tcl_Interp * interp, int code); /* 609 */ int (*tcl_ZlibDeflate) (Tcl_Interp * interp, int format, Tcl_Obj * data, int level, Tcl_Obj * gzipHeaderDictObj); /* 610 */ int (*tcl_ZlibInflate) (Tcl_Interp * interp, int format, Tcl_Obj * data, int buffersize, Tcl_Obj * gzipHeaderDictObj); /* 611 */ - unsigned int (*tcl_ZlibCRC32) (unsigned int crc, const char * buf, int len); /* 612 */ - unsigned int (*tcl_ZlibAdler32) (unsigned int adler, const char * buf, int len); /* 613 */ + unsigned int (*tcl_ZlibCRC32) (unsigned int crc, const unsigned char * buf, int len); /* 612 */ + unsigned int (*tcl_ZlibAdler32) (unsigned int adler, const unsigned char * buf, int len); /* 613 */ int (*tcl_ZlibStreamInit) (Tcl_Interp * interp, int mode, int format, int level, Tcl_Obj * dictObj, Tcl_ZlibStream * zshandle); /* 614 */ Tcl_Obj * (*tcl_ZlibStreamGetCommandName) (Tcl_ZlibStream zshandle); /* 615 */ int (*tcl_ZlibStreamEof) (Tcl_ZlibStream zshandle); /* 616 */ diff --git a/generic/tclZlib.c b/generic/tclZlib.c index 8db482a..f932525 100644 --- a/generic/tclZlib.c +++ b/generic/tclZlib.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclZlib.c,v 1.19 2008/12/27 00:04:17 dkf Exp $ + * RCS: @(#) $Id: tclZlib.c,v 1.20 2008/12/27 10:07:06 dkf Exp $ */ #include "tclInt.h" @@ -1612,11 +1612,10 @@ TclZlibCmd( return TCL_ERROR; } if (objc < 4) { - start = Tcl_ZlibAdler32(0, 0, 0); + start = Tcl_ZlibAdler32(0, NULL, 0); } data = Tcl_GetByteArrayFromObj(objv[2], &dlen); - Tcl_SetIntObj(obj, (int) - Tcl_ZlibAdler32(start, (const char *) data, dlen)); + Tcl_SetIntObj(obj, (int) Tcl_ZlibAdler32(start, data, dlen)); return TCL_OK; case z_crc32: /* crc32 str ?startvalue? * -> checksum */ @@ -1629,11 +1628,10 @@ TclZlibCmd( return TCL_ERROR; } if (objc < 4) { - start = Tcl_ZlibCRC32(0, 0, 0); + start = Tcl_ZlibCRC32(0, NULL, 0); } - data = Tcl_GetByteArrayFromObj(objv[2],&dlen); - Tcl_SetIntObj(obj, (int) - Tcl_ZlibCRC32(start, (const char *) data, dlen)); + data = Tcl_GetByteArrayFromObj(objv[2], &dlen); + Tcl_SetIntObj(obj, (int) Tcl_ZlibCRC32(start, data, dlen)); return TCL_OK; case z_deflate: /* deflate data ?level? * -> rawCompressedData */ @@ -2187,7 +2185,7 @@ ZlibStreamCmd( Tcl_WrongNumArgs(interp, 2, objv, NULL); return TCL_ERROR; } - Tcl_SetIntObj(obj, Tcl_ZlibStreamAdler32(zstream)); + Tcl_SetIntObj(obj, Tcl_ZlibStreamChecksum(zstream)); return TCL_OK; case zs_reset: /* $strm reset */ if (objc != 2) { -- cgit v0.12