From b51f35134bc68f09e6e3b90ea0eda5f10775ed0f Mon Sep 17 00:00:00 2001
From: dgp <dgp@users.sourceforge.net>
Date: Thu, 28 Aug 2008 18:13:34 +0000
Subject:         * generic/tkImgPhoto.c: Changed TclStack* calls to ck* calls
 so that         we don't create new dependencies on Tcl internals.

        * unix/tkUnixPort.h:    Removed #include of tclInt.h that has been
        * win/tkWinPort.h:      disabled for three years.  If we needed this
        we'd have noticed by now.
---
 ChangeLog            |  7 +++++++
 generic/tkImgPhoto.c | 18 ++++++++----------
 unix/tkUnixPort.h    | 13 +------------
 win/tkWinPort.h      | 11 +----------
 4 files changed, 17 insertions(+), 32 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 97f6a6f..215c609 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2008-08-22  Don Porter  <dgp@users.sourceforge.net>
 
+	* generic/tkImgPhoto.c:	Changed TclStack* calls to ck* calls so that
+	we don't create new dependencies on Tcl internals.
+
+	* unix/tkUnixPort.h:	Removed #include of tclInt.h that has been
+	* win/tkWinPort.h:	disabled for three years.  If we needed this
+	we'd have noticed by now.
+
 	* README:		Bump version number to 8.6a3
 	* generic/tk.h:
 	* library/tk.tcl:
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 2007559..9644ecf 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -17,10 +17,9 @@
  *	   Department of Computer Science,
  *	   Australian National University.
  *
- * RCS: @(#) $Id: tkImgPhoto.c,v 1.80 2008/08/25 17:19:43 dkf Exp $
+ * RCS: @(#) $Id: tkImgPhoto.c,v 1.81 2008/08/28 18:13:34 dgp Exp $
  */
 
-#include "tclInt.h"
 #include "tkImgPhoto.h"
 #include <ctype.h>
 
@@ -1668,7 +1667,7 @@ ImgPhotoConfigureMaster(
     Tk_PhotoImageFormat *imageFormat;
     const char **args;
 
-    args = TclStackAlloc(interp, (objc + 1) * sizeof(char *));
+    args = (const char **) ckalloc((objc + 1) * sizeof(char *));
     for (i = 0, j = 0; i < objc; i++,j++) {
 	args[j] = Tcl_GetStringFromObj(objv[i], &length);
 	if ((length > 1) && (args[j][0] == '-')) {
@@ -1678,7 +1677,7 @@ ImgPhotoConfigureMaster(
 		    data = objv[i];
 		    j--;
 		} else {
-		    TclStackFree(interp, args);
+		    ckfree((char *) args);
 		    Tcl_AppendResult(interp,
 			    "value for \"-data\" missing", NULL);
 		    return TCL_ERROR;
@@ -1689,7 +1688,7 @@ ImgPhotoConfigureMaster(
 		    format = objv[i];
 		    j--;
 		} else {
-		    TclStackFree(interp, args);
+		    ckfree((char *) args);
 		    Tcl_AppendResult(interp,
 			    "value for \"-format\" missing", NULL);
 		    return TCL_ERROR;
@@ -1727,10 +1726,10 @@ ImgPhotoConfigureMaster(
 
     if (Tk_ConfigureWidget(interp, Tk_MainWindow(interp), configSpecs,
 	    j, args, (char *) masterPtr, flags) != TCL_OK) {
-	TclStackFree(interp, args);
+	ckfree((char *) args);
 	goto errorExit;
     }
-    TclStackFree(interp, args);
+    ckfree((char *) args);
 
     /*
      * Regard the empty string for -file, -data or -format as the null value.
@@ -3698,8 +3697,7 @@ ImgStringWrite(
 
     Tcl_DStringInit(&data);
     if ((blockPtr->width > 0) && (blockPtr->height > 0)) {
-	char *line = TclStackAlloc(interp,
-		(unsigned) ((8 * blockPtr->width) + 2));
+	char *line = ckalloc((unsigned) ((8 * blockPtr->width) + 2));
 	int row, col;
 
 	for (row=0; row<blockPtr->height; row++) {
@@ -3715,7 +3713,7 @@ ImgStringWrite(
 	    }
 	    Tcl_DStringAppendElement(&data, line+1);
 	}
-	TclStackFree(interp, line);
+	ckfree(line);
     }
     Tcl_DStringResult(interp, &data);
     return TCL_OK;
diff --git a/unix/tkUnixPort.h b/unix/tkUnixPort.h
index 4805a6f..280c1db 100644
--- a/unix/tkUnixPort.h
+++ b/unix/tkUnixPort.h
@@ -11,7 +11,7 @@
  * See the file "license.terms" for information on usage and redistribution
  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  *
- * RCS: @(#) $Id: tkUnixPort.h,v 1.14 2007/12/13 15:28:50 dgp Exp $
+ * RCS: @(#) $Id: tkUnixPort.h,v 1.15 2008/08/28 18:13:36 dgp Exp $
  */
 
 #ifndef _UNIXPORT
@@ -204,15 +204,4 @@
 #define TkpPrintWindowId(buf,w) \
 	sprintf((buf), "%#08lx", (unsigned long) (w))
 
-/*
- * The following declaration is used to get access to a private Tcl interface
- * that is needed for portability reasons.
- *
- * Disabled for now to determined whether we really still need this.
-
-#ifndef _TCLINT
-#include <tclInt.h>
-#endif
- */
-
 #endif /* _UNIXPORT */
diff --git a/win/tkWinPort.h b/win/tkWinPort.h
index 282fa79..8069f46 100644
--- a/win/tkWinPort.h
+++ b/win/tkWinPort.h
@@ -10,7 +10,7 @@
  * See the file "license.terms" for information on usage and redistribution
  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  *
- * RCS: @(#) $Id: tkWinPort.h,v 1.11 2008/08/19 15:52:14 georgeps Exp $
+ * RCS: @(#) $Id: tkWinPort.h,v 1.12 2008/08/28 18:13:36 dgp Exp $
  */
 
 #ifndef _WINPORT
@@ -126,13 +126,4 @@ struct timezone {
     int tz_dsttime;
 };
 
-/*
- * Disabled inclusion of Tcl's private header in hope of discovering we
- * no longer need it.
- *
-#ifndef _TCLINT
-#include <tclInt.h>
-#endif
- */
-
 #endif /* _WINPORT */
-- 
cgit v0.12