summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-06-28 14:26:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-06-28 14:26:11 (GMT)
commit69471e1a17152088f9d8e90e684fd75e9fc99dfc (patch)
tree15eacd2c1053ac65edb0fe6309c2a2aac14c7f9f /generic
parent8bb026fed0f950dab2d7ce6600e7bde98edba550 (diff)
parent2453f30fb9e0fd71b6fc37ef6df3385f2efaf6d5 (diff)
downloadtcl-69471e1a17152088f9d8e90e684fd75e9fc99dfc.zip
tcl-69471e1a17152088f9d8e90e684fd75e9fc99dfc.tar.gz
tcl-69471e1a17152088f9d8e90e684fd75e9fc99dfc.tar.bz2
Diffstat (limited to 'generic')
-rw-r--r--generic/tclZlib.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/generic/tclZlib.c b/generic/tclZlib.c
index 691d57a..dac47cf 100644
--- a/generic/tclZlib.c
+++ b/generic/tclZlib.c
@@ -2906,9 +2906,9 @@ ZlibTransformClose(
}
}
} while (e != Z_STREAM_END);
- e = deflateEnd(&cd->outStream);
+ (void) deflateEnd(&cd->outStream);
} else {
- e = inflateEnd(&cd->inStream);
+ (void) inflateEnd(&cd->inStream);
}
/*
@@ -3344,10 +3344,13 @@ ZlibTransformGetOption(
Tcl_DStringAppendElement(dsPtr, "");
}
} else {
- int len;
- const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len);
+ if (cd->compDictObj) {
+ int len;
+ const char *str = Tcl_GetStringFromObj(cd->compDictObj, &len);
- Tcl_DStringAppend(dsPtr, str, len);
+ Tcl_DStringAppend(dsPtr, str, len);
+ }
+ return TCL_OK;
}
}
@@ -3549,7 +3552,6 @@ ZlibStackChannelTransform(
ZlibChannelData *cd = ckalloc(sizeof(ZlibChannelData));
Tcl_Channel chan;
int wbits = 0;
- int e;
if (mode != TCL_ZLIB_STREAM_DEFLATE && mode != TCL_ZLIB_STREAM_INFLATE) {
Tcl_Panic("unknown mode: %d", mode);
@@ -3603,43 +3605,35 @@ ZlibStackChannelTransform(
*/
if (mode == TCL_ZLIB_STREAM_INFLATE) {
- e = inflateInit2(&cd->inStream, wbits);
- if (e != Z_OK) {
+ if (inflateInit2(&cd->inStream, wbits) != Z_OK) {
goto error;
}
cd->inAllocated = DEFAULT_BUFFER_SIZE;
cd->inBuffer = ckalloc(cd->inAllocated);
if (cd->flags & IN_HEADER) {
- e = inflateGetHeader(&cd->inStream, &cd->inHeader.header);
- if (e != Z_OK) {
+ if (inflateGetHeader(&cd->inStream, &cd->inHeader.header) != Z_OK) {
goto error;
}
}
if (cd->format == TCL_ZLIB_FORMAT_RAW && cd->compDictObj) {
- e = SetInflateDictionary(&cd->inStream, cd->compDictObj);
- if (e != Z_OK) {
+ if (SetInflateDictionary(&cd->inStream, cd->compDictObj) != Z_OK) {
goto error;
}
- TclDecrRefCount(cd->compDictObj);
- cd->compDictObj = NULL;
}
} else {
- e = deflateInit2(&cd->outStream, level, Z_DEFLATED, wbits,
- MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY);
- if (e != Z_OK) {
+ if (deflateInit2(&cd->outStream, level, Z_DEFLATED, wbits,
+ MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) {
goto error;
}
cd->outAllocated = DEFAULT_BUFFER_SIZE;
cd->outBuffer = ckalloc(cd->outAllocated);
if (cd->flags & OUT_HEADER) {
- e = deflateSetHeader(&cd->outStream, &cd->outHeader.header);
- if (e != Z_OK) {
+ if (deflateSetHeader(&cd->outStream, &cd->outHeader.header) != Z_OK) {
goto error;
}
}
if (cd->compDictObj) {
- e = SetDeflateDictionary(&cd->outStream, cd->compDictObj);
- if (e != Z_OK) {
+ if (SetDeflateDictionary(&cd->outStream, cd->compDictObj) != Z_OK) {
goto error;
}
}