summaryrefslogtreecommitdiffstats
path: root/generic/tclZlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclZlib.c')
-rw-r--r--generic/tclZlib.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index e70c4b3..ea6a1f2 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -354,7 +354,7 @@ ConvertErrorToList(
return Tcl_NewListObj(4, objv);
case Z_NEED_DICT:
TclNewLiteralStringObj(objv[2], "NEED_DICT");
- objv[3] = Tcl_NewWideIntObj((Tcl_WideInt) adler);
+ TclNewIntObj(objv[3], (Tcl_WideInt)adler);
return Tcl_NewListObj(4, objv);
/*
@@ -2162,7 +2162,7 @@ ZlibCmd(
break;
case 1:
headerVarObj = objv[i+1];
- headerDictObj = Tcl_NewObj();
+ TclNewObj(headerDictObj);
break;
}
}
@@ -2398,7 +2398,7 @@ ZlibPushSubcmd(
"-dictionary", "-header", "-level", "-limit", NULL
};
const char *const *pushOptions = pushDecompressOptions;
- enum pushOptions {poDictionary, poHeader, poLevel, poLimit};
+ enum pushOptionsEnum {poDictionary, poHeader, poLevel, poLimit};
Tcl_Obj *headerObj = NULL, *compDictObj = NULL;
int limit = DEFAULT_BUFFER_SIZE, dummy;
@@ -2480,7 +2480,7 @@ ZlibPushSubcmd(
Tcl_SetErrorCode(interp, "TCL", "ZIP", "NOVAL", NULL);
return TCL_ERROR;
}
- switch ((enum pushOptions) option) {
+ switch ((enum pushOptionsEnum) option) {
case poHeader:
headerObj = objv[i];
if (Tcl_DictObjSize(interp, headerObj, &dummy) != TCL_OK) {
@@ -2703,21 +2703,21 @@ ZlibStreamAddCmd(
switch ((enum addOptions) index) {
case ao_flush: /* -flush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_SYNC_FLUSH;
}
break;
case ao_fullflush: /* -fullflush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FULL_FLUSH;
}
break;
case ao_finalize: /* -finalize */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FINISH;
@@ -2830,21 +2830,21 @@ ZlibStreamPutCmd(
switch ((enum putOptions) index) {
case po_flush: /* -flush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_SYNC_FLUSH;
}
break;
case po_fullflush: /* -fullflush */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FULL_FLUSH;
}
break;
case po_finalize: /* -finalize */
- if (flush > -1) {
+ if (flush >= 0) {
flush = -2;
} else {
flush = Z_FINISH;
@@ -3484,8 +3484,9 @@ ZlibTransformGetOption(
if ((cd->flags & IN_HEADER) && ((optionName == NULL) ||
(strcmp(optionName, "-header") == 0))) {
- Tcl_Obj *tmpObj = Tcl_NewObj();
+ Tcl_Obj *tmpObj;
+ TclNewObj(tmpObj);
ExtractHeader(&cd->inHeader.header, tmpObj);
if (optionName == NULL) {
Tcl_DStringAppendElement(dsPtr, "-header");
@@ -3944,7 +3945,7 @@ TclZlibInit(
cfg[0].key = "zlibVersion";
cfg[0].value = zlibVersion();
cfg[1].key = NULL;
- Tcl_RegisterConfig(interp, "zlib", cfg, "iso8859-1");
+ Tcl_RegisterConfig(interp, "zlib", cfg, "utf-8");
/*
* Allow command type introspection to do something sensible with streams.