summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-20 11:40:02 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-01-20 11:40:02 (GMT)
commit3286abb818c5973935f5de72f244cb860f965202 (patch)
tree495216539d1f5c026c3ccc2a6bf9bb9817bad4e8 /generic
parent127870d786aa7e9a5cb0538d40152202bdd28854 (diff)
downloadtk-3286abb818c5973935f5de72f244cb860f965202.zip
tk-3286abb818c5973935f5de72f244cb860f965202.tar.gz
tk-3286abb818c5973935f5de72f244cb860f965202.tar.bz2
eliminate use of deprecated Tcl_SaveResult API
Diffstat (limited to 'generic')
-rw-r--r--generic/tkImgPNG.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index b159c45..267b1d9 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -334,9 +334,11 @@ InitPNGImage(
if (Tcl_ZlibStreamInit(NULL, dir, TCL_ZLIB_FORMAT_ZLIB,
TCL_ZLIB_COMPRESS_DEFAULT, NULL, &pngPtr->stream) != TCL_OK) {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "zlib initialization failed", -1));
- Tcl_SetErrorCode(interp, "TK", "IMAGE", "PNG", "ZLIB_INIT", NULL);
+ if (interp) {
+ Tcl_SetObjResult(interp, Tcl_NewStringObj(
+ "zlib initialization failed", -1));
+ Tcl_SetErrorCode(interp, "TK", "IMAGE", "PNG", "ZLIB_INIT", NULL);
+ }
if (objPtr) {
Tcl_DecrRefCount(objPtr);
}
@@ -2667,11 +2669,8 @@ FileMatchPNG(
{
PNGImage png;
int match = 0;
- Tcl_SavedResult sya;
-
- Tcl_SaveResult(interp, &sya);
- InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE);
+ InitPNGImage(NULL, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE);
if (ReadIHDR(interp, &png) == TCL_OK) {
*widthPtr = png.block.width;
@@ -2680,7 +2679,6 @@ FileMatchPNG(
}
CleanupPNGImage(&png);
- Tcl_RestoreResult(interp, &sya);
return match;
}
@@ -2759,10 +2757,8 @@ StringMatchPNG(
{
PNGImage png;
int match = 0;
- Tcl_SavedResult sya;
- Tcl_SaveResult(interp, &sya);
- InitPNGImage(interp, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE);
+ InitPNGImage(NULL, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE);
png.strDataBuf = Tcl_GetByteArrayFromObj(pObjData, &png.strDataLen);
@@ -2773,7 +2769,6 @@ StringMatchPNG(
}
CleanupPNGImage(&png);
- Tcl_RestoreResult(interp, &sya);
return match;
}