From 199732899ee8edcd64fef50ed92b9937bb8d8a12 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 22 Sep 2006 14:53:05 +0000 Subject: Fix [Bug 1562528] --- ChangeLog | 6 ++++++ generic/tkImgBmap.c | 19 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ef0652f..bb95a0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-09-22 Donal K. Fellows + + * generic/tkImgBmap.c (ImgBmapPostscript): Use NULL instead of 0 as + end-of-strings marker to Tcl_AppendResult; the difference matters on + 64-bit machines. [Bug 1562528] + 2006-09-20 Jeff Hobbs * win/tkWinMenu.c (TkpPostMenu): disable menu animation in menus diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index b4ae169..27af046 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -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: tkImgBmap.c,v 1.15.2.1 2006/02/27 11:12:29 dkf Exp $ + * RCS: @(#) $Id: tkImgBmap.c,v 1.15.2.2 2006/09/22 14:53:06 dkf Exp $ */ #include "tkInt.h" @@ -1183,21 +1183,21 @@ ImgBmapPsImagemask(interp, width, height, data) if (width*height > 60000) { Tcl_ResetResult(interp); Tcl_AppendResult(interp, "unable to generate postscript for bitmaps " - "larger than 60000 pixels", 0); + "larger than 60000 pixels", NULL); return TCL_ERROR; } sprintf(buffer, "0 0 moveto %d %d true [%d 0 0 %d 0 %d] {<\n", width, height, width, -height, height); - Tcl_AppendResult(interp, buffer, 0); + Tcl_AppendResult(interp, buffer, NULL); nBytePerRow = (width+7)/8; for(i=0; i} imagemask \n", 0); + Tcl_AppendResult(interp, ">} imagemask \n", NULL); return TCL_OK; } @@ -1252,11 +1252,11 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height, */ if( x!=0 || y!=0 ){ sprintf(buffer, "%d %d moveto\n", x, y); - Tcl_AppendResult(interp, buffer, 0); + Tcl_AppendResult(interp, buffer, NULL); } if( width!=1 || height!=1 ){ sprintf(buffer, "%d %d scale\n", width, height); - Tcl_AppendResult(interp, buffer, 0); + Tcl_AppendResult(interp, buffer, NULL); } /* @@ -1276,8 +1276,7 @@ ImgBmapPostscript(clientData, interp, tkwin, psinfo, x, y, width, height, if (masterPtr->maskData == NULL) { Tcl_AppendResult(interp, "0 0 moveto 1 0 rlineto 0 1 rlineto -1 0 rlineto " - "closepath fill\n", 0 - ); + "closepath fill\n", NULL); } else if (ImgBmapPsImagemask(interp, masterPtr->width, masterPtr->height, masterPtr->maskData) != TCL_OK) { return TCL_ERROR; -- cgit v0.12