summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvBmap.c
diff options
context:
space:
mode:
authordkf <dkf@noemail.net>2012-07-16 12:36:40 (GMT)
committerdkf <dkf@noemail.net>2012-07-16 12:36:40 (GMT)
commit5c569203bdf540f4fdc9fc63379c3c630866731d (patch)
tree83188d92aa77a52a178e0ae85ba5439c402f4eca /generic/tkCanvBmap.c
parent671fa12fa3a02c014800a309a90d4ea311d7e5bb (diff)
downloadtk-5c569203bdf540f4fdc9fc63379c3c630866731d.zip
tk-5c569203bdf540f4fdc9fc63379c3c630866731d.tar.gz
tk-5c569203bdf540f4fdc9fc63379c3c630866731d.tar.bz2
Working towards adding all the Tcl_SetErrorCode calls that should be there.
** WORK IN PROGRESS ** FossilOrigin-Name: 6f8f9336c381b81bbe323a8399eaf4dd3f89b34f
Diffstat (limited to 'generic/tkCanvBmap.c')
-rw-r--r--generic/tkCanvBmap.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/generic/tkCanvBmap.c b/generic/tkCanvBmap.c
index ea16a29..adaa184 100644
--- a/generic/tkCanvBmap.c
+++ b/generic/tkCanvBmap.c
@@ -249,10 +249,8 @@ BitmapCoords(
if (objc == 0) {
Tcl_Obj *obj = Tcl_NewObj();
- Tcl_Obj *subobj = Tcl_NewDoubleObj(bmapPtr->x);
- Tcl_ListObjAppendElement(interp, obj, subobj);
- subobj = Tcl_NewDoubleObj(bmapPtr->y);
- Tcl_ListObjAppendElement(interp, obj, subobj);
+ Tcl_ListObjAppendElement(NULL, obj, Tcl_NewDoubleObj(bmapPtr->x));
+ Tcl_ListObjAppendElement(NULL, obj, Tcl_NewDoubleObj(bmapPtr->y));
Tcl_SetObjResult(interp, obj);
} else if (objc < 3) {
if (objc == 1) {
@@ -260,10 +258,8 @@ BitmapCoords(
(Tcl_Obj ***) &objv) != TCL_OK) {
return TCL_ERROR;
} else if (objc != 2) {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "wrong # coordinates: expected 2, got %d", objc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "wrong # coordinates: expected 2, got %d", objc));
return TCL_ERROR;
}
}
@@ -275,10 +271,8 @@ BitmapCoords(
}
ComputeBitmapBbox(canvas, bmapPtr);
} else {
- char buf[64 + TCL_INTEGER_SPACE];
-
- sprintf(buf, "wrong # coordinates: expected 0 or 2, got %d", objc);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ Tcl_SetObjResult(interp, Tcl_ObjPrintf(
+ "wrong # coordinates: expected 0 or 2, got %d", objc));
return TCL_ERROR;
}
return TCL_OK;