diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-28 11:24:03 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-01-28 11:24:03 (GMT) |
commit | 389232d83af4ed09331f33a3eb217b28aa5b0d80 (patch) | |
tree | 65123df923e2cd33f1a897da5b4a37c2e704270f /generic | |
parent | 0de9e7c313ad8508a10b915e34dd00c65618c794 (diff) | |
download | tk-389232d83af4ed09331f33a3eb217b28aa5b0d80.zip tk-389232d83af4ed09331f33a3eb217b28aa5b0d80.tar.gz tk-389232d83af4ed09331f33a3eb217b28aa5b0d80.tar.bz2 |
Convert all Tcl_SetResult calls to Tcl_SetObjResult calls.
Convert Tcl_GetStringFromObj to Tcl_GetString when possible.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkConfig.c | 4 | ||||
-rw-r--r-- | generic/tkObj.c | 10 | ||||
-rw-r--r-- | generic/tkOldConfig.c | 2 | ||||
-rw-r--r-- | generic/tkPanedWindow.c | 2 | ||||
-rw-r--r-- | generic/tkTest.c | 10 | ||||
-rw-r--r-- | generic/tkUtil.c | 2 |
6 files changed, 14 insertions, 16 deletions
diff --git a/generic/tkConfig.c b/generic/tkConfig.c index 375bca7..2503f31 100644 --- a/generic/tkConfig.c +++ b/generic/tkConfig.c @@ -1347,7 +1347,7 @@ Tk_SetOptions( if (interp != NULL) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "value for \"%s\" missing", - Tcl_GetStringFromObj(*objv, NULL))); + Tcl_GetString(*objv))); Tcl_SetErrorCode(interp, "TK", "VALUE_MISSING", NULL); goto error; } @@ -1372,7 +1372,7 @@ Tk_SetOptions( : NULL) != TCL_OK) { Tcl_AppendObjToErrorInfo(interp, Tcl_ObjPrintf( "\n (processing \"%.40s\" option)", - Tcl_GetStringFromObj(*objv, NULL))); + Tcl_GetString(*objv))); goto error; } if (savePtr != NULL) { diff --git a/generic/tkObj.c b/generic/tkObj.c index ed947d3..1ccf3c5 100644 --- a/generic/tkObj.c +++ b/generic/tkObj.c @@ -447,7 +447,7 @@ SetPixelFromAny( double d; int i, units; - string = Tcl_GetStringFromObj(objPtr, NULL); + string = Tcl_GetString(objPtr); d = strtod(string, &rest); if (rest == string) { @@ -719,13 +719,13 @@ SetMMFromAny( * ints again from mm obj types. */ - (void) Tcl_GetStringFromObj(objPtr, NULL); + (void) Tcl_GetString(objPtr); } else { /* * It wasn't a known int or double, so parse it. */ - string = Tcl_GetStringFromObj(objPtr, NULL); + string = Tcl_GetString(objPtr); d = strtod(string, &rest); if (rest == string) { @@ -834,7 +834,7 @@ TkGetWindowFromObj( */ winPtr->tkwin = Tk_NameToWindow(interp, - Tcl_GetStringFromObj(objPtr, NULL), tkwin); + Tcl_GetString(objPtr), tkwin); if (winPtr->tkwin == NULL) { /* ASSERT: Tk_NameToWindow has left error message in interp */ return TCL_ERROR; @@ -880,7 +880,7 @@ SetWindowFromAny( * Free the old internalRep before setting the new one. */ - Tcl_GetStringFromObj(objPtr, NULL); + Tcl_GetString(objPtr); typePtr = objPtr->typePtr; if ((typePtr != NULL) && (typePtr->freeIntRepProc != NULL)) { typePtr->freeIntRepProc(objPtr); diff --git a/generic/tkOldConfig.c b/generic/tkOldConfig.c index 5496076..f9a69de 100644 --- a/generic/tkOldConfig.c +++ b/generic/tkOldConfig.c @@ -122,7 +122,7 @@ Tk_ConfigureWidget( const char *arg; if (flags & TK_CONFIG_OBJS) { - arg = Tcl_GetStringFromObj((Tcl_Obj *) *argv, NULL); + arg = Tcl_GetString((Tcl_Obj *) *argv); } else { arg = *argv; } diff --git a/generic/tkPanedWindow.c b/generic/tkPanedWindow.c index 4a4af53..eb92aae 100644 --- a/generic/tkPanedWindow.c +++ b/generic/tkPanedWindow.c @@ -384,7 +384,7 @@ Tk_PanedWindowObjCmd( } tkwin = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), - Tcl_GetStringFromObj(objv[1], NULL), NULL); + Tcl_GetString(objv[1]), NULL); if (tkwin == NULL) { return TCL_ERROR; } diff --git a/generic/tkTest.c b/generic/tkTest.c index e084a52..13415c4 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -1734,8 +1734,7 @@ TestmenubarCmd( return TCL_OK; #else - Tcl_SetResult(interp, "testmenubar is supported only under Unix", - TCL_STATIC); + Tcl_AppendResult(interp, "testmenubar is supported only under Unix", NULL); return TCL_ERROR; #endif } @@ -1868,7 +1867,7 @@ TestpropCmd( *p = '\n'; } } - Tcl_SetResult(interp, (/*!unsigned*/char*)property, TCL_VOLATILE); + Tcl_SetObjResult(interp, Tcl_NewStringObj((/*!unsigned*/char*)property, -1)); } else { for (p = property; length > 0; length--) { if (actualFormat == 32) { @@ -1939,7 +1938,7 @@ TestwrapperCmd( char buf[TCL_INTEGER_SPACE]; TkpPrintWindowId(buf, Tk_WindowId(wrapperPtr)); - Tcl_SetResult(interp, buf, TCL_VOLATILE); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); } return TCL_OK; } @@ -2013,8 +2012,7 @@ CustomOptionSet( string = Tcl_GetStringFromObj((*value), &length); Tcl_UtfToUpper(string); if (strcmp(string, "BAD") == 0) { - Tcl_SetResult(interp, "expected good value, got \"BAD\"", - TCL_STATIC); + Tcl_SetObjResult(interp, Tcl_NewStringObj("expected good value, got \"BAD\"", -1)); return TCL_ERROR; } } diff --git a/generic/tkUtil.c b/generic/tkUtil.c index 385d1cb..0290c94 100644 --- a/generic/tkUtil.c +++ b/generic/tkUtil.c @@ -970,7 +970,7 @@ TkFindStateNumObj( * Not there. Look in the state map. */ - key = Tcl_GetStringFromObj(keyPtr, NULL); + key = Tcl_GetString(keyPtr); for (mPtr = mapPtr; mPtr->strKey != NULL; mPtr++) { if (strcmp(key, mPtr->strKey) == 0) { typePtr = keyPtr->typePtr; |