diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-23 13:59:40 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-07-23 13:59:40 (GMT) |
commit | 22a0b0ed3f7f0da75210a6d854fc4a7703b3c640 (patch) | |
tree | 46a3064598e4a36c7ca561f9c08f5d22de4b2b9e /generic/tkOldConfig.c | |
parent | 7c4fea3383697638df3c0d27196fc5ba61591ad7 (diff) | |
download | tk-22a0b0ed3f7f0da75210a6d854fc4a7703b3c640.zip tk-22a0b0ed3f7f0da75210a6d854fc4a7703b3c640.tar.gz tk-22a0b0ed3f7f0da75210a6d854fc4a7703b3c640.tar.bz2 |
Much more cleaning up of result handling.
Diffstat (limited to 'generic/tkOldConfig.c')
-rw-r--r-- | generic/tkOldConfig.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 49d505e..5496076 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -95,7 +95,7 @@ Tk_ConfigureWidget( * we're on our way out of the application */ - Tcl_AppendResult(interp, "NULL main window", NULL); + Tcl_SetObjResult(interp, Tcl_NewStringObj("NULL main window", -1)); Tcl_SetErrorCode(interp, "TK", "NO_MAIN_WINDOW", NULL); return TCL_ERROR; } @@ -136,7 +136,8 @@ Tk_ConfigureWidget( */ if (argc < 2) { - Tcl_AppendResult(interp, "value for \"", arg, "\" missing", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "value for \"%s\" missing", arg)); Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", NULL); return TCL_ERROR; } @@ -266,8 +267,8 @@ FindConfigSpec( goto gotMatch; } if (matchPtr != NULL) { - Tcl_AppendResult(interp, "ambiguous option \"", argvName, - "\"", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "ambiguous option \"%s\"", argvName)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "OPTION", argvName,NULL); return NULL; } @@ -275,7 +276,8 @@ FindConfigSpec( } if (matchPtr == NULL) { - Tcl_AppendResult(interp, "unknown option \"", argvName, "\"", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "unknown option \"%s\"", argvName)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "OPTION", argvName, NULL); return NULL; } @@ -290,8 +292,9 @@ FindConfigSpec( if (specPtr->type == TK_CONFIG_SYNONYM) { for (specPtr = specs; ; specPtr++) { if (specPtr->type == TK_CONFIG_END) { - Tcl_AppendResult(interp, "couldn't find synonym for option \"", - argvName, "\"", NULL); + Tcl_SetObjResult(interp, Tcl_ObjPrintf( + "couldn't find synonym for option \"%s\"", + argvName)); Tcl_SetErrorCode(interp, "TK", "LOOKUP", "OPTION", argvName, NULL); return NULL; @@ -622,12 +625,13 @@ Tk_ConfigureInfo( Tcl_ResetResult(interp); if (argvName != NULL) { - specPtr = FindConfigSpec(interp, staticSpecs, argvName, needFlags,hateFlags); + specPtr = FindConfigSpec(interp, staticSpecs, argvName, needFlags, + hateFlags); if (specPtr == NULL) { return TCL_ERROR; } list = FormatConfigInfo(interp, tkwin, specPtr, widgRec); - Tcl_SetResult(interp, list, TCL_VOLATILE); + Tcl_SetObjResult(interp, Tcl_NewStringObj(list, -1)); ckfree(list); return TCL_OK; } @@ -932,7 +936,7 @@ Tk_ConfigureValue( } result = FormatConfigValue(interp, tkwin, specPtr, widgRec, buffer, &freeProc); - Tcl_SetResult(interp, (char *) result, TCL_VOLATILE); + Tcl_SetObjResult(interp, Tcl_NewStringObj(result, -1)); if (freeProc != NULL) { if ((freeProc == TCL_DYNAMIC) || (freeProc == (Tcl_FreeProc *) free)) { ckfree(result); |