summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvBmap.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-04-16 01:51:06 (GMT)
committerstanton <stanton>1999-04-16 01:51:06 (GMT)
commit03656f44f81469f459031fa3a4a7b09c8bc77712 (patch)
tree31378e81bd58f8c726fc552d6b30cbf3ca07497b /generic/tkCanvBmap.c
parent404fc236f34304df53b7e44bc7971d786b87d453 (diff)
downloadtk-03656f44f81469f459031fa3a4a7b09c8bc77712.zip
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.gz
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.bz2
* Merged 8.1 branch into the main trunk
Diffstat (limited to 'generic/tkCanvBmap.c')
-rw-r--r--generic/tkCanvBmap.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index a09bf8d..dedc4e7 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -4,12 +4,12 @@
* This file implements bitmap items for canvas widgets.
*
* Copyright (c) 1992-1994 The Regents of the University of California.
- * Copyright (c) 1994-1995 Sun Microsystems, Inc.
+ * Copyright (c) 1994-1997 Sun Microsystems, Inc.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkCanvBmap.c,v 1.2 1998/09/14 18:23:04 stanton Exp $
+ * RCS: @(#) $Id: tkCanvBmap.c,v 1.3 1999/04/16 01:51:11 stanton Exp $
*/
#include <stdio.h>
@@ -129,7 +129,7 @@ Tk_ItemType tkBitmapType = {
* Results:
* A standard Tcl return value. If an error occurred in
* creating the item, then an error message is left in
- * interp->result; in this case itemPtr is left uninitialized,
+ * the interp's result; in this case itemPtr is left uninitialized,
* so it can be safely freed by the caller.
*
* Side effects:
@@ -194,7 +194,7 @@ CreateBitmap(interp, canvas, itemPtr, argc, argv)
* details on what it does.
*
* Results:
- * Returns TCL_OK or TCL_ERROR, and sets interp->result.
+ * Returns TCL_OK or TCL_ERROR, and sets the interp's result.
*
* Side effects:
* The coordinates for the given item may be changed.
@@ -228,8 +228,10 @@ BitmapCoords(interp, canvas, itemPtr, argc, argv)
}
ComputeBitmapBbox(canvas, bmapPtr);
} else {
- sprintf(interp->result,
- "wrong # coordinates: expected 0 or 2, got %d", argc);
+ char buf[64 + TCL_INTEGER_SPACE];
+
+ sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", argc);
+ Tcl_SetResult(interp, buf, TCL_VOLATILE);
return TCL_ERROR;
}
return TCL_OK;
@@ -245,7 +247,7 @@ BitmapCoords(interp, canvas, itemPtr, argc, argv)
*
* Results:
* A standard Tcl result code. If an error occurs, then
- * an error message is left in interp->result.
+ * an error message is left in the interp's result.
*
* Side effects:
* Configuration information may be set for itemPtr.
@@ -690,7 +692,7 @@ TranslateBitmap(canvas, itemPtr, deltaX, deltaY)
* Results:
* The return value is a standard Tcl result. If an error
* occurs in generating Postscript then an error message is
- * left in interp->result, replacing whatever used to be there.
+ * left in the interp's result, replacing whatever used to be there.
* If no error occurs, then Postscript for the item is appended
* to the result.
*
@@ -715,7 +717,7 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
double x, y;
int width, height, rowsAtOnce, rowsThisTime;
int curRow;
- char buffer[200];
+ char buffer[100 + TCL_DOUBLE_SPACE * 2 + TCL_INTEGER_SPACE * 4];
if (bmapPtr->bitmap == None) {
return TCL_OK;
@@ -749,7 +751,7 @@ BitmapToPostscript(interp, canvas, itemPtr, prepass)
if (bmapPtr->bgColor != NULL) {
sprintf(buffer,
"%.15g %.15g moveto %d 0 rlineto 0 %d rlineto %d %s\n",
- x, y, width, height, -width,"0 rlineto closepath");
+ x, y, width, height, -width, "0 rlineto closepath");
Tcl_AppendResult(interp, buffer, (char *) NULL);
if (Tk_CanvasPsColor(interp, canvas, bmapPtr->bgColor) != TCL_OK) {
return TCL_ERROR;