diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2012-07-30 09:08:25 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2012-07-30 09:08:25 (GMT) |
commit | 11f61544529c3da346ec22c04082f611a6848db5 (patch) | |
tree | 3df05098022fc5df53dd08bafb10f26ced4f36e7 | |
parent | 27f0a32c4c776d3b53f2ab234aef1e7bcc69a0b1 (diff) | |
download | tk-11f61544529c3da346ec22c04082f611a6848db5.zip tk-11f61544529c3da346ec22c04082f611a6848db5.tar.gz tk-11f61544529c3da346ec22c04082f611a6848db5.tar.bz2 |
more auditing of error codes
-rw-r--r-- | carbon/tkMacOSXWm.c | 5 | ||||
-rw-r--r-- | generic/tkBind.c | 3 | ||||
-rw-r--r-- | generic/tkBitmap.c | 3 | ||||
-rw-r--r-- | generic/tkBusy.c | 3 | ||||
-rw-r--r-- | generic/tkCanvUtil.c | 3 | ||||
-rw-r--r-- | generic/tkCanvas.c | 9 | ||||
-rw-r--r-- | generic/tkCmds.c | 10 | ||||
-rw-r--r-- | generic/tkGrid.c | 17 | ||||
-rw-r--r-- | generic/tkImage.c | 6 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 11 | ||||
-rw-r--r-- | generic/tkPack.c | 2 | ||||
-rw-r--r-- | generic/tkPanedWindow.c | 9 | ||||
-rw-r--r-- | generic/tkText.c | 10 | ||||
-rw-r--r-- | generic/tkTextIndex.c | 9 | ||||
-rw-r--r-- | generic/tkTextMark.c | 8 | ||||
-rw-r--r-- | generic/tkTextTag.c | 3 | ||||
-rw-r--r-- | generic/tkTrig.c | 2 | ||||
-rw-r--r-- | generic/tkWindow.c | 5 | ||||
-rw-r--r-- | generic/ttk/ttkLayout.c | 4 | ||||
-rw-r--r-- | generic/ttk/ttkPanedwindow.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkState.c | 2 | ||||
-rw-r--r-- | generic/ttk/ttkTheme.c | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXWm.c | 5 | ||||
-rw-r--r-- | tests/grid.test | 10 | ||||
-rw-r--r-- | unix/tkUnixSend.c | 3 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 17 | ||||
-rw-r--r-- | win/tkWinWm.c | 29 |
27 files changed, 107 insertions, 93 deletions
diff --git a/carbon/tkMacOSXWm.c b/carbon/tkMacOSXWm.c index 09c796b..508a5f8 100644 --- a/carbon/tkMacOSXWm.c +++ b/carbon/tkMacOSXWm.c @@ -614,7 +614,8 @@ Tk_WmObjCmd( && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't a top-level window", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "WM", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", winPtr->pathName, + NULL); return TCL_ERROR; } @@ -2009,7 +2010,7 @@ WmIconphotoCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use \"%s\" as iconphoto: not a photo image", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", "PHOTO", NULL); return TCL_ERROR; } Tk_PhotoGetSize(photo, &width, &height); diff --git a/generic/tkBind.c b/generic/tkBind.c index 974c1f9..4029571 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -3951,7 +3951,8 @@ ParseEventDescription( if (patPtr->detail.keySym == NoSymbol) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad event type or keysym \"%s\"", field)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYSYM", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "KEYSYM", field, + NULL); count = 0; goto done; } diff --git a/generic/tkBitmap.c b/generic/tkBitmap.c index 0815b3b..729fff4 100644 --- a/generic/tkBitmap.c +++ b/generic/tkBitmap.c @@ -389,7 +389,8 @@ GetBitmap( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bitmap \"%s\" not defined", string)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BITMAP", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BITMAP", string, + NULL); } goto error; } diff --git a/generic/tkBusy.c b/generic/tkBusy.c index 8fd53fa..8f73d80 100644 --- a/generic/tkBusy.c +++ b/generic/tkBusy.c @@ -689,7 +689,8 @@ GetBusy( if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't find busy window \"%s\"", Tcl_GetString(windowObj))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BUSY", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "BUSY", + Tcl_GetString(windowObj), NULL); return NULL; } return Tcl_GetHashValue(hPtr); diff --git a/generic/tkCanvUtil.c b/generic/tkCanvUtil.c index 120afd2..23c73e5 100644 --- a/generic/tkCanvUtil.c +++ b/generic/tkCanvUtil.c @@ -772,7 +772,8 @@ TkSmoothParseProc( if (smooth != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "ambiguous smooth method \"%s\"", value)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "SMOOTH", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "SMOOTH", value, + NULL); return TCL_ERROR; } smooth = &methods->smooth; diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c index d6b6959..07f1cfe 100644 --- a/generic/tkCanvas.c +++ b/generic/tkCanvas.c @@ -930,7 +930,8 @@ CanvasWidgetCmd( if (object == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item \"%s\" doesn't exist", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "CANVASITEM", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "CANVAS_ITEM", + Tcl_GetString(objv[2]), NULL); result = TCL_ERROR; goto done; } @@ -956,7 +957,8 @@ CanvasWidgetCmd( if (object == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "item \"%s\" doesn't exist", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "CANVASITEM", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "CANVAS_ITEM", + Tcl_GetString(objv[2]), NULL); result = TCL_ERROR; goto done; } @@ -1278,7 +1280,8 @@ CanvasWidgetCmd( badType: Tcl_SetObjResult(interp, Tcl_ObjPrintf( "unknown or ambiguous item type \"%s\"", arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "CANVASITEM", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "CANVAS_ITEM_TYPE", arg, + NULL); result = TCL_ERROR; goto done; } diff --git a/generic/tkCmds.c b/generic/tkCmds.c index 08eb377..2955105 100644 --- a/generic/tkCmds.c +++ b/generic/tkCmds.c @@ -1598,7 +1598,8 @@ Tk_WinfoObjCmd( if (strcmp(name, "?bad atom?") == 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no atom exists with id \"%s\"", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "ATOM", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "ATOM", + Tcl_GetString(objv[2]), NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Tcl_NewStringObj(name, -1)); @@ -1659,7 +1660,7 @@ Tk_WinfoObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window id \"%s\" doesn't exist in this application", string)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", string, NULL); return TCL_ERROR; } @@ -1781,7 +1782,7 @@ Tk_WinfoObjCmd( if (visInfoPtr == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "can't find any visuals for screen", -1)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "VISUAL", NULL); + Tcl_SetErrorCode(interp, "TK", "VISUAL", "NONE", NULL); return TCL_ERROR; } resultPtr = Tcl_NewObj(); @@ -1904,7 +1905,8 @@ Tk_WmObjCmd( if (!(winPtr->flags & TK_TOP_LEVEL)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't a top-level window", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", winPtr->pathName, + NULL); return TCL_ERROR; } diff --git a/generic/tkGrid.c b/generic/tkGrid.c index c11d342..19e4442 100644 --- a/generic/tkGrid.c +++ b/generic/tkGrid.c @@ -1015,9 +1015,8 @@ GridRowColumnConfigureCommand( if ((objc == 4) || (objc == 5)) { if (lObjc != 1) { - Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "%s %s: must specify a single element on retrieval", - Tcl_GetString(objv[0]), Tcl_GetString(objv[1]))); + Tcl_SetObjResult(interp, Tcl_NewStringObj( + "must specify a single element on retrieval", -1)); Tcl_SetErrorCode(interp, "TK", "GRID", "USAGE", NULL); Tcl_DecrRefCount(listCopy); return TCL_ERROR; @@ -1129,18 +1128,15 @@ GridRowColumnConfigureCommand( slavePtr = GetGrid(slave); if (slavePtr->masterPtr != masterPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "%s %s: the window \"%s\" is not managed by \"%s\"", - Tcl_GetString(objv[0]), Tcl_GetString(objv[1]), + "the window \"%s\" is not managed by \"%s\"", Tcl_GetString(lObjv[j]), Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "GRID_MASTER", NULL); + Tcl_SetErrorCode(interp, "TK", "GRID", "NOT_MASTER", NULL); Tcl_DecrRefCount(listCopy); return TCL_ERROR; } } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "%s %s: illegal index \"%s\"", - Tcl_GetString(objv[0]), Tcl_GetString(objv[1]), - Tcl_GetString(lObjv[j]))); + "illegal index \"%s\"", Tcl_GetString(lObjv[j]))); Tcl_SetErrorCode(interp, "TK", "VALUE", "GRID_INDEX", NULL); Tcl_DecrRefCount(listCopy); return TCL_ERROR; @@ -1162,8 +1158,7 @@ GridRowColumnConfigureCommand( ok = CheckSlotData(masterPtr, slot, slotType, /*checkOnly*/ 0); if (ok != TCL_OK) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "%s %s: \"%s\" is out of range", - Tcl_GetString(objv[0]), Tcl_GetString(objv[1]), + "\"%s\" is out of range", Tcl_GetString(lObjv[j]))); Tcl_SetErrorCode(interp, "TK", "GRID", "INDEX_RANGE", NULL); diff --git a/generic/tkImage.c b/generic/tkImage.c index bb115f6..ffa6f22 100644 --- a/generic/tkImage.c +++ b/generic/tkImage.c @@ -274,7 +274,7 @@ Tk_ImageObjCmd( if (typePtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image type \"%s\" doesn't exist", arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE_TYPE", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE_TYPE", arg, NULL); return TCL_ERROR; } @@ -500,7 +500,7 @@ Tk_ImageObjCmd( alreadyDeleted: Tcl_SetObjResult(interp, Tcl_ObjPrintf("image \"%s\" doesn't exist",arg)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", arg, NULL); return TCL_ERROR; } @@ -642,7 +642,7 @@ Tk_GetImage( if (interp) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image \"%s\" doesn't exist", name)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "IMAGE", name, NULL); } return NULL; } diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index db59b86..74ee564 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -565,7 +565,8 @@ ImgPhotoCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image \"%s\" doesn't exist or is not a photo image", Tcl_GetString(options.name))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO", + Tcl_GetString(options.name), NULL); return TCL_ERROR; } Tk_PhotoGetImage(srcHandle, &block); @@ -729,7 +730,7 @@ ImgPhotoCmd( Tcl_GetString(options.format), (matched ? "not supported" : "unknown"))); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT", - NULL); + Tcl_GetString(options.format), NULL); return TCL_ERROR; } } else { @@ -2461,7 +2462,8 @@ MatchFileFormat( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image file format \"%s\" is not supported", formatString)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT", + formatString, NULL); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "couldn't recognize data in image file \"%s\"", @@ -2586,7 +2588,8 @@ MatchStringFormat( if ((formatObj != NULL) && !matched) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "image format \"%s\" is not supported", formatString)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "PHOTO_FORMAT", + formatString, NULL); } else { Tcl_SetObjResult(interp, Tcl_NewStringObj( "couldn't recognize image data", -1)); diff --git a/generic/tkPack.c b/generic/tkPack.c index c600f34..d91fda7 100644 --- a/generic/tkPack.c +++ b/generic/tkPack.c @@ -301,7 +301,7 @@ Tk_PackObjCmd( if (argv2[0] != '.') { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad argument \"%s\": must be name of window", argv2)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", NULL); return TCL_ERROR; } return ConfigureSlaves(interp, tkwin, objc-2, objv+2); diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index b6080b1..4a4af53 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -662,7 +662,8 @@ PanedWindowWidgetObjCmd( if (i == pwPtr->numSlaves) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "not managed by this window", -1)); - Tcl_SetErrorCode(interp, "TK", "PANEDWIN", "UNMANAGED", NULL); + Tcl_SetErrorCode(interp, "TK", "PANEDWINDOW", "UNMANAGED", + NULL); } result = TCL_ERROR; } else { @@ -1102,7 +1103,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", -1)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_IDX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); return TCL_ERROR; } slavePtr = pwPtr->slaves[sash]; @@ -1125,7 +1126,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", -1)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_IDX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); return TCL_ERROR; } @@ -1161,7 +1162,7 @@ PanedWindowSashCommand( if (!ValidSashIndex(pwPtr, sash)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "invalid sash index", -1)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_IDX", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "SASH_INDEX", NULL); return TCL_ERROR; } diff --git a/generic/tkText.c b/generic/tkText.c index 0970794..e7b1c4d 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -1039,7 +1039,7 @@ TextWidgetObjCmd( "bad option \"%s\" must be -chars, -displaychars, " "-displayindices, -displaylines, -indices, -lines, -update, " "-xpixels, or -ypixels", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "INDEXOPT", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_OPTION", NULL); result = TCL_ERROR; goto done; } @@ -1403,7 +1403,7 @@ TextWidgetObjCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "index \"%s\" before \"%s\" in the text", Tcl_GetString(objv[3]), Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEXORDER", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", NULL); result = TCL_ERROR; goto done; } @@ -2066,7 +2066,7 @@ ConfigureText( if (start > end) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "-startline must be less than or equal to -endline", -1)); - Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEXORDER", NULL); + Tcl_SetErrorCode(interp, "TK", "TEXT", "INDEX_ORDER", NULL); Tk_RestoreSavedOptions(&savedOptions); return TCL_ERROR; } @@ -4421,7 +4421,7 @@ TkTextGetTabs( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tab stop \"%s\" is not at a positive distance", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "TABSTOP", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", NULL); goto error; } @@ -4455,7 +4455,7 @@ TkTextGetTabs( "tabs must be monotonically increasing, but \"%s\" is " "smaller than or equal to the previous tab", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "VALUE", "TABSTOP", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "TAB_STOP", NULL); goto error; #endif /* _TK_ALLOW_DECREASING_TABS */ } diff --git a/generic/tkTextIndex.c b/generic/tkTextIndex.c index b04eef2..25888d8 100644 --- a/generic/tkTextIndex.c +++ b/generic/tkTextIndex.c @@ -832,15 +832,14 @@ GetIndex( if (!TkBTreeCharTagged(&first, tagPtr) && !TkBTreeNextTag(&search)) { if (tagPtr == textPtr->selTagPtr) { tagName = "sel"; - } else { - if (hPtr != NULL) { - tagName = Tcl_GetHashKey(&sharedPtr->tagTable, hPtr); - } + } else if (hPtr != NULL) { + tagName = Tcl_GetHashKey(&sharedPtr->tagTable, hPtr); } Tcl_SetObjResult(interp, Tcl_ObjPrintf( "text doesn't contain any characters tagged with \"%s\"", tagName)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_INDEX", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_INDEX", tagName, + NULL); Tcl_DStringFree(©); return TCL_ERROR; } diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 77cf2c5..a306a05 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -133,7 +133,7 @@ TkTextMarkCmd( Tcl_WrongNumArgs(interp, 3, objv, "markName ?gravity?"); return TCL_ERROR; } - str = Tcl_GetStringFromObj(objv[3],&length); + str = Tcl_GetStringFromObj(objv[3], &length); if (length == 6 && !strcmp(str, "insert")) { markPtr = textPtr->insertMarkPtr; } else if (length == 7 && !strcmp(str, "current")) { @@ -142,9 +142,9 @@ TkTextMarkCmd( hPtr = Tcl_FindHashEntry(&textPtr->sharedTextPtr->markTable, str); if (hPtr == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( - "there is no mark named \"%s\"", - Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_MARK", NULL); + "there is no mark named \"%s\"", str)); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_MARK", str, + NULL); return TCL_ERROR; } markPtr = Tcl_GetHashValue(hPtr); diff --git a/generic/tkTextTag.c b/generic/tkTextTag.c index 19ea5f3..fb514bf 100644 --- a/generic/tkTextTag.c +++ b/generic/tkTextTag.c @@ -1073,7 +1073,8 @@ FindTag( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "tag \"%s\" isn't defined in text widget", Tcl_GetString(tagName))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TEXT_TAG", + Tcl_GetString(tagName), NULL); } return NULL; } diff --git a/generic/tkTrig.c b/generic/tkTrig.c index 3da1e5c..a2bf456 100644 --- a/generic/tkTrig.c +++ b/generic/tkTrig.c @@ -1375,7 +1375,6 @@ TkMakeBezierPostscript( int closed, i; int numCoords = numPoints*2; double control[8]; - char buffer[200]; Tcl_Obj *psObj; /* @@ -1477,7 +1476,6 @@ TkMakeRawCurvePostscript( { int i; double *segPtr; - char buffer[200]; Tcl_Obj *psObj; /* diff --git a/generic/tkWindow.c b/generic/tkWindow.c index 8b39da1..4e39d6e 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -1185,7 +1185,7 @@ Tk_CreateWindowFromPath( if (p == NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad window path name \"%s\"", pathName)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOWPATH", NULL); + Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOW_PATH", NULL); return NULL; } numChars = (int) (p-pathName); @@ -2351,7 +2351,8 @@ Tk_NameToWindow( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "bad window path name \"%s\"", pathName)); - Tcl_SetErrorCode(interp, "TK", "VALUE", "WINDOWNAME", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW", pathName, + NULL); } return NULL; } diff --git a/generic/ttk/ttkLayout.c b/generic/ttk/ttkLayout.c index 559d5d9..15ceaa8 100644 --- a/generic/ttk/ttkLayout.c +++ b/generic/ttk/ttkLayout.c @@ -878,7 +878,7 @@ Ttk_Layout Ttk_CreateLayout( if (!layoutTemplate) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Layout %s not found", styleName)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "LAYOUT", NULL); + Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "LAYOUT", styleName, NULL); return 0; } @@ -919,7 +919,7 @@ Ttk_CreateSublayout( if (!layoutTemplate) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Layout %s not found", styleName)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "LAYOUT", NULL); + Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "LAYOUT", styleName, NULL); return 0; } diff --git a/generic/ttk/ttkPanedwindow.c b/generic/ttk/ttkPanedwindow.c index 12d481f..f4b14c9 100644 --- a/generic/ttk/ttkPanedwindow.c +++ b/generic/ttk/ttkPanedwindow.c @@ -848,7 +848,7 @@ static int PanedSashposCommand( if (sashIndex < 0 || sashIndex >= Ttk_NumberSlaves(pw->paned.mgr) - 1) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "sash index %d out of range", sashIndex)); - Tcl_SetErrorCode(interp, "TTK", "PANE", "SASHIDX", NULL); + Tcl_SetErrorCode(interp, "TTK", "PANE", "SASH_INDEX", NULL); return TCL_ERROR; } diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index 151dc4d..c34b900 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -218,7 +218,7 @@ Tcl_Obj *Ttk_StateMapLookup( } if (interp) { Tcl_SetObjResult(interp, Tcl_NewStringObj("No match in state map", -1)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "STATE", NULL); + Tcl_SetErrorCode(interp, "TTK", "STATE", "UNMATCHED", NULL); } return NULL; } diff --git a/generic/ttk/ttkTheme.c b/generic/ttk/ttkTheme.c index 6e7b477..5097abc 100644 --- a/generic/ttk/ttkTheme.c +++ b/generic/ttk/ttkTheme.c @@ -594,7 +594,7 @@ static Ttk_Theme LookupTheme( if (!entryPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "theme \"%s\" doesn't exist", name)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "THEME", NULL); + Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "THEME", name, NULL); return NULL; } @@ -1499,7 +1499,8 @@ static int StyleElementCreateCmd( if (!entryPtr) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "No such element type %s", factoryName)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "ELEMENT_TYPE", NULL); + Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "ELEMENT_TYPE", factoryName, + NULL); return TCL_ERROR; } @@ -1560,7 +1561,7 @@ static int StyleElementOptionsCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "element %s not found", elementName)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "ELEMENT", NULL); + Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "ELEMENT", elementName, NULL); return TCL_ERROR; } @@ -1586,7 +1587,8 @@ static int StyleLayoutCmd( if (!layoutTemplate) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "Layout %s not found", layoutName)); - Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "LAYOUT", NULL); + Tcl_SetErrorCode(interp, "TTK", "LOOKUP", "LAYOUT", layoutName, + NULL); return TCL_ERROR; } Tcl_SetObjResult(interp, Ttk_UnparseLayoutTemplate(layoutTemplate)); diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index 98c6526..6ad7547 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -902,7 +902,8 @@ Tk_WmObjCmd( && (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't a top-level window", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "WM", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", winPtr->pathName, + NULL); return TCL_ERROR; } @@ -2221,7 +2222,7 @@ WmIconphotoCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use \"%s\" as iconphoto: not a photo image", Tcl_GetString(objv[i]))); - Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "ICONPHOTO", "PHOTO", NULL); return TCL_ERROR; } Tk_PhotoGetSize(photo, &width, &height); diff --git a/tests/grid.test b/tests/grid.test index 6b2dfe3..c1d9d06 100644 --- a/tests/grid.test +++ b/tests/grid.test @@ -662,7 +662,7 @@ test grid-10.19 {column/row configure} -body { grid columnconfigure . {0 -1 2} -weight 1 } -cleanup { grid_reset 10.19 -} -returnCodes error -result {grid columnconfigure: "-1" is out of range} +} -returnCodes error -result {"-1" is out of range} test grid-10.20 {column/row configure} -body { grid columnconfigure . 0 -uniform foo grid columnconfigure . 0 -uniform @@ -673,13 +673,13 @@ test grid-10.21 {column/row configure} -body { grid columnconfigure . .b -weight 1 } -cleanup { grid_reset 10.21 -} -returnCodes error -result {grid columnconfigure: illegal index ".b"} +} -returnCodes error -result {illegal index ".b"} test grid-10.22 {column/row configure} -body { button .b grid columnconfigure . .b -weight 1 } -cleanup { grid_reset 10.22 -} -returnCodes error -result {grid columnconfigure: the window ".b" is not managed by "."} +} -returnCodes error -result {the window ".b" is not managed by "."} test grid-10.23 {column/row configure} -body { button .b grid .b -column 1 -columnspan 2 @@ -747,10 +747,10 @@ test grid-10.28 {column/row configure - no indices} -body { } -returnCodes error -result {no row indices specified} test grid-10.29 {column/row configure - invalid indices} -body { grid columnconfigure . {0 1 2} -weight -} -returnCodes error -result {grid columnconfigure: must specify a single element on retrieval} +} -returnCodes error -result {must specify a single element on retrieval} test grid-10.30 {column/row configure - invalid indices} -body { grid rowconfigure . {0 1 2} -weight -} -returnCodes error -result {grid rowconfigure: must specify a single element on retrieval} +} -returnCodes error -result {must specify a single element on retrieval} test grid-10.31 {column/row configure - empty 'all' configure} -body { # Bug 1422430 set t [toplevel .test] diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index a263a61..54c3cf2 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -1073,7 +1073,8 @@ Tk_SendCmd( if (commWindow == None) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "no application named \"%s\"", destName)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "APPLICATION", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "APPLICATION", destName, + NULL); return TCL_ERROR; } diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index e63da88..bcd3fcb 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.c @@ -1084,7 +1084,8 @@ Tk_WmObjCmd( (index != WMOPT_MANAGE) && (index != WMOPT_FORGET)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't a top-level window", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", winPtr->pathName, + NULL); return TCL_ERROR; } @@ -2622,7 +2623,7 @@ WmIconwindowCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use %s as icon window: not at top level", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "WM", "ICONWIN", "INNER", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "ICONWINDOW", "INNER", NULL); return TCL_ERROR; } wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr; @@ -2630,7 +2631,7 @@ WmIconwindowCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s is already an icon for %s", Tcl_GetString(objv[3]), Tk_PathName(wmPtr2->iconFor))); - Tcl_SetErrorCode(interp, "TK", "WM", "ICONWIN", "ICON", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "ICONWINDOW", "ICON", NULL); return TCL_ERROR; } if (wmPtr->icon != NULL) { @@ -2709,7 +2710,7 @@ WmManageCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" is not manageable: must be a frame," " labelframe or toplevel", Tk_PathName(frameWin))); - Tcl_SetErrorCode(interp, "TK", "WM", "MANAGE", "TYPE", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "MANAGE", NULL); return TCL_ERROR; } TkFocusSplit(winPtr); @@ -3302,7 +3303,7 @@ WmStackorderCmd( if (windows == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "TkWmStackorderToplevel failed", -1)); - Tcl_SetErrorCode(interp, "TK", "WM", "STACK", "INTERNAL", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "COMMUNICATION", NULL); return TCL_ERROR; } @@ -3391,15 +3392,15 @@ WmStateCmd( "can't iconify \"%s\": override-redirect flag is set", winPtr->pathName)); Tcl_SetErrorCode(interp, "TK", "WM", "STATE", - "ICONIFY_REDIRECTED", NULL); + "OVERRIDE_REDIRECT", NULL); return TCL_ERROR; } if (wmPtr->masterPtr != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify \"%s\": it is a transient", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "WM", "STATE", - "ICONIFY_TRANSIENT", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "STATE", "TRANSIENT", + NULL); return TCL_ERROR; } if (TkpWmSetState(winPtr, IconicState) == 0) { diff --git a/win/tkWinWm.c b/win/tkWinWm.c index da65a65..cfa04e1 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -974,7 +974,8 @@ WinSetIcon( if (!(Tk_IsTopLevel(tkw))) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't a top-level window", Tk_PathName(tkw))); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", Tk_PathName(tkw), + NULL); return TCL_ERROR; } if (Tk_WindowId(tkw) == None) { @@ -2854,7 +2855,8 @@ Tk_WmObjCmd( && (index != WMOPT_FORGET)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" isn't a top-level window", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", NULL); + Tcl_SetErrorCode(interp, "TK", "LOOKUP", "TOPLEVEL", winPtr->pathName, + NULL); return TCL_ERROR; } @@ -3570,7 +3572,7 @@ WmDeiconifyCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't deiconify %s: the container does not support the request", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "WM", "DEICONIFY", "WHAT", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "COMMUNICATION", NULL); return TCL_ERROR; } return TCL_OK; @@ -4572,7 +4574,7 @@ WmIconwindowCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't use %s as icon window: not at top level", Tcl_GetString(objv[3]))); - Tcl_SetErrorCode(interp, "TK", "WM", "ICONWIN", "INNER", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "ICONWINDOW", "INNER", NULL); return TCL_ERROR; } wmPtr2 = ((TkWindow *) tkwin2)->wmInfoPtr; @@ -4580,7 +4582,7 @@ WmIconwindowCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s is already an icon for %s", Tcl_GetString(objv[3]), Tk_PathName(wmPtr2->iconFor))); - Tcl_SetErrorCode(interp, "TK", "WM", "ICONWIN", "ICON", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "ICONWINDOW", "ICON", NULL); return TCL_ERROR; } if (wmPtr->icon != NULL) { @@ -4651,7 +4653,7 @@ WmManageCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "window \"%s\" is not manageable: must be a frame," " labelframe or toplevel", Tk_PathName(frameWin))); - Tcl_SetErrorCode(interp, "TK", "WM", "MANAGE", "TYPE", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "MANAGE", NULL); return TCL_ERROR; } TkFocusSplit(winPtr); @@ -4812,8 +4814,7 @@ WmOverrideredirectCmd( if (curValue < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "Container does not support overrideredirect", -1)); - Tcl_SetErrorCode(interp, "TK", "WM", "OVERRIDE_REDIRECT", "WHAT", - NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "COMMUNICATION", NULL); return TCL_ERROR; } } else { @@ -5236,7 +5237,7 @@ WmStackorderCmd( if (windows == NULL) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "TkWmStackorderToplevel failed", -1)); - Tcl_SetErrorCode(interp, "TK", "WM", "STACK", "INTERNAL", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "COMMUNICATION", NULL); return TCL_ERROR; } @@ -5350,7 +5351,7 @@ WmStateCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't change state of %s: the container does not support the request", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "WM", "STATE", "WHAT", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "COMMUNICATION", NULL); return TCL_ERROR; } return TCL_OK; @@ -5370,15 +5371,15 @@ WmStateCmd( "can't iconify \"%s\": override-redirect flag is set", winPtr->pathName)); Tcl_SetErrorCode(interp, "TK", "WM", "STATE", - "ICONIFY_REDIRECTED", NULL); + "OVERRIDE_REDIRECT", NULL); return TCL_ERROR; } if (wmPtr->masterPtr != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify \"%s\": it is a transient", winPtr->pathName)); - Tcl_SetErrorCode(interp, "TK", "WM", "STATE", - "ICONIFY_TRANSIENT", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "STATE", "TRANSIENT", + NULL); return TCL_ERROR; } TkpWmSetState(winPtr, IconicState); @@ -5658,7 +5659,7 @@ WmWithdrawCmd( Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't withdraw %s: the container does not support the request", Tcl_GetString(objv[2]))); - Tcl_SetErrorCode(interp, "TK", "WM", "WITHDRAW", "WHAT", NULL); + Tcl_SetErrorCode(interp, "TK", "WM", "COMMUNICATION", NULL); return TCL_ERROR; } } else { |