summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index e083243..d2f5db1 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -171,11 +171,11 @@ static Tcl_DriverInputProc ZlibTransformInput;
static Tcl_DriverOutputProc ZlibTransformOutput;
static Tcl_DriverSetOptionProc ZlibTransformSetOption;
static Tcl_DriverWatchProc ZlibTransformWatch;
-static Tcl_ObjCmdProc ZlibCmd;
-static Tcl_ObjCmdProc ZlibStreamCmd;
-static Tcl_ObjCmdProc ZlibStreamAddCmd;
-static Tcl_ObjCmdProc ZlibStreamHeaderCmd;
-static Tcl_ObjCmdProc ZlibStreamPutCmd;
+static Tcl_ObjCmdProc2 ZlibCmd;
+static Tcl_ObjCmdProc2 ZlibStreamCmd;
+static Tcl_ObjCmdProc2 ZlibStreamAddCmd;
+static Tcl_ObjCmdProc2 ZlibStreamHeaderCmd;
+static Tcl_ObjCmdProc2 ZlibStreamPutCmd;
static void ConvertError(Tcl_Interp *interp, int code,
uLong adler);
@@ -185,7 +185,7 @@ static inline int Deflate(z_streamp strm, void *bufferPtr,
static void ExtractHeader(gz_header *headerPtr, Tcl_Obj *dictObj);
static int GenerateHeader(Tcl_Interp *interp, Tcl_Obj *dictObj,
GzipHeader *headerPtr, int *extraSizePtr);
-static int ZlibPushSubcmd(Tcl_Interp *interp, int objc,
+static int ZlibPushSubcmd(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[]);
static int ResultDecompress(ZlibChannelData *cd, char *buf,
int toRead, int flush, int *errorCodePtr);
@@ -194,7 +194,7 @@ static Tcl_Channel ZlibStackChannelTransform(Tcl_Interp *interp,
Tcl_Channel channel, Tcl_Obj *gzipHeaderDictPtr,
Tcl_Obj *compDictObj);
static void ZlibStreamCleanup(ZlibStreamHandle *zshPtr);
-static int ZlibStreamSubcmd(Tcl_Interp *interp, int objc,
+static int ZlibStreamSubcmd(Tcl_Interp *interp, Tcl_Size objc,
Tcl_Obj *const objv[]);
static inline void ZlibTransformEventTimerKill(ZlibChannelData *cd);
static void ZlibTransformTimerRun(void *clientData);
@@ -860,7 +860,7 @@ Tcl_ZlibStreamInit(
* Create the command.
*/
- zshPtr->cmd = Tcl_CreateObjCommand(interp, Tcl_DStringValue(&cmdname),
+ zshPtr->cmd = Tcl_CreateObjCommand2(interp, Tcl_DStringValue(&cmdname),
ZlibStreamCmd, zshPtr, ZlibStreamCmdDelete);
Tcl_DStringFree(&cmdname);
if (zshPtr->cmd == NULL) {
@@ -1986,14 +1986,12 @@ static int
ZlibCmd(
TCL_UNUSED(void *),
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
- int i, option, level = -1;
- size_t buffersize = 0;
- Tcl_Size dlen = 0;
- unsigned int start;
- Tcl_WideInt wideLen;
+ int option, level = -1;
+ Tcl_Size i, dlen = 0, buffersize = 0;
+ Tcl_WideInt wideLen, start;
Byte *data;
Tcl_Obj *headerDictObj;
const char *extraInfoStr = NULL;
@@ -2027,8 +2025,8 @@ ZlibCmd(
if (data == NULL) {
return TCL_ERROR;
}
- if (objc>3 && Tcl_GetIntFromObj(interp, objv[3],
- (int *) &start) != TCL_OK) {
+ if (objc>3 && Tcl_GetWideIntFromObj(interp, objv[3],
+ &start) != TCL_OK) {
return TCL_ERROR;
}
if (objc < 4) {
@@ -2266,7 +2264,7 @@ ZlibCmd(
static int
ZlibStreamSubcmd(
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
static const char *const stream_formats[] = {
@@ -2277,7 +2275,8 @@ ZlibStreamSubcmd(
FMT_COMPRESS, FMT_DECOMPRESS, FMT_DEFLATE, FMT_GUNZIP, FMT_GZIP,
FMT_INFLATE
} fmt;
- int i, format, mode = 0, option, level;
+ Tcl_Size i;
+ int format, mode = 0, option, level;
enum objIndices {
OPT_COMPRESSION_DICTIONARY = 0,
OPT_GZIP_HEADER = 1,
@@ -2426,7 +2425,7 @@ ZlibStreamSubcmd(
static int
ZlibPushSubcmd(
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
static const char *const stream_formats[] = {
@@ -2438,7 +2437,7 @@ ZlibPushSubcmd(
FMT_INFLATE
} fmt;
Tcl_Channel chan;
- int chanMode, format, mode = 0, level, i;
+ int chanMode, format, mode = 0, level;
static const char *const pushCompressOptions[] = {
"-dictionary", "-header", "-level", NULL
};
@@ -2449,7 +2448,7 @@ ZlibPushSubcmd(
enum pushOptionsEnum {poDictionary, poHeader, poLevel, poLimit} option;
Tcl_Obj *headerObj = NULL, *compDictObj = NULL;
int limit = DEFAULT_BUFFER_SIZE;
- Tcl_Size dummy;
+ Tcl_Size i, dummy;
if (objc < 4) {
Tcl_WrongNumArgs(interp, 2, objv, "mode channel ?options...?");
@@ -2605,7 +2604,7 @@ static int
ZlibStreamCmd(
void *cd,
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd;
@@ -2731,11 +2730,12 @@ static int
ZlibStreamAddCmd(
void *cd,
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd;
- int code, buffersize = -1, flush = -1, i;
+ int code, buffersize = -1, flush = -1;
+ Tcl_Size i;
Tcl_Obj *obj, *compDictObj = NULL;
static const char *const add_options[] = {
"-buffer", "-dictionary", "-finalize", "-flush", "-fullflush", NULL
@@ -2858,11 +2858,12 @@ static int
ZlibStreamPutCmd(
void *cd,
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
Tcl_ZlibStream zstream = (Tcl_ZlibStream)cd;
- int flush = -1, i;
+ int flush = -1;
+ Tcl_Size i;
Tcl_Obj *compDictObj = NULL;
static const char *const put_options[] = {
"-dictionary", "-finalize", "-flush", "-fullflush", NULL
@@ -2949,7 +2950,7 @@ static int
ZlibStreamHeaderCmd(
void *cd,
Tcl_Interp *interp,
- int objc,
+ Tcl_Size objc,
Tcl_Obj *const objv[])
{
ZlibStreamHandle *zshPtr = (ZlibStreamHandle *)cd;
@@ -3985,7 +3986,7 @@ TclZlibInit(
* Create the public scripted interface to this file's functionality.
*/
- Tcl_CreateObjCommand(interp, "zlib", ZlibCmd, 0, 0);
+ Tcl_CreateObjCommand2(interp, "zlib", ZlibCmd, 0, 0);
/*
* Store the underlying configuration information.