From 22946a8cd411fca97059fd12ff2e1b015afc922c Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 8 Feb 2002 02:57:10 +0000 Subject: * modified some callers of Tcl routines that were restored to return (char *) pointing into Tcl_DStrings. --- ChangeLog | 9 +++++++++ generic/tkMain.c | 5 ++--- mac/tkMacInit.c | 8 +++----- mac/tkMacKeyboard.c | 5 ++--- win/tkWinDialog.c | 5 ++--- win/tkWinTest.c | 5 ++--- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 908f297..fc4e6aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-02-07 Don Porter + + * generic/tkMain.c: + * mac/tkMacInit.c: + * mac/tkMacKeyboard.c: + * win/tkWinDialog.c: + * win/tkWinTest.c: modified some callers of Tcl routines that + were restored to return (char *) pointing into Tcl_DStrings. + 2002-02-03 eric melski * generic/tkImage.c (Tk_ImageObjCmd): Clean up bogus for loop in diff --git a/generic/tkMain.c b/generic/tkMain.c index d5c6acb..34fa5b3 100644 --- a/generic/tkMain.c +++ b/generic/tkMain.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMain.c,v 1.12 2002/01/25 21:09:37 dgp Exp $ + * RCS: @(#) $Id: tkMain.c,v 1.13 2002/02/08 02:57:11 dgp Exp $ */ #include @@ -335,8 +335,7 @@ StdinProc(clientData, mask) (void) Tcl_DStringAppend(&tsdPtr->command, Tcl_DStringValue( &tsdPtr->line), -1); - Tcl_DStringAppend(&tsdPtr->command, "\n", -1); - cmd = Tcl_DStringValue(&tsdPtr->command); + cmd = Tcl_DStringAppend(&tsdPtr->command, "\n", -1); Tcl_DStringFree(&tsdPtr->line); if (!Tcl_CommandComplete(cmd)) { gotPartial = 1; diff --git a/mac/tkMacInit.c b/mac/tkMacInit.c index 277bbc6..9602304 100644 --- a/mac/tkMacInit.c +++ b/mac/tkMacInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacInit.c,v 1.7 2002/01/27 11:10:53 das Exp $ + * RCS: @(#) $Id: tkMacInit.c,v 1.8 2002/02/08 02:57:11 dgp Exp $ */ #include @@ -121,11 +121,9 @@ tkInit"; argv[1] = "Tool Command Language"; Tcl_DStringInit(&libPath); Tcl_DStringAppend(&libPath, "tk", -1); - Tcl_DStringAppend(&libPath, TK_VERSION, -1); - argv[2] = Tcl_DStringValue(&libPath); - Tcl_JoinPath(3, argv, &path); + argv[2] = Tcl_DStringAppend(&libPath, TK_VERSION, -1); + libDir = Tcl_JoinPath(3, argv, &path); Tcl_DStringFree(&libPath); - libDir = Tcl_DStringValue(&path); } } if (libDir == NULL) { diff --git a/mac/tkMacKeyboard.c b/mac/tkMacKeyboard.c index def5b19..2cf8d0a 100644 --- a/mac/tkMacKeyboard.c +++ b/mac/tkMacKeyboard.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacKeyboard.c,v 1.7 2002/01/27 11:10:57 das Exp $ + * RCS: @(#) $Id: tkMacKeyboard.c,v 1.8 2002/02/08 02:57:11 dgp Exp $ */ #include "tkInt.h" @@ -247,8 +247,7 @@ TkpGetString( len = 0; } } - Tcl_ExternalToUtfDString(NULL, string, len, dsPtr); - return Tcl_DStringValue(dsPtr); + return Tcl_ExternalToUtfDString(NULL, string, len, dsPtr); } /* diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index 2b52978..8e0640f 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinDialog.c,v 1.24 2002/01/18 13:29:05 dgp Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.25 2002/02/08 02:57:11 dgp Exp $ * */ @@ -393,9 +393,8 @@ ColorDlgHookProc(hDlg, uMsg, wParam, lParam) ccPtr = (CHOOSECOLOR *) lParam; title = (const char *) ccPtr->lCustData; if ((title != NULL) && (title[0] != '\0')) { - Tcl_WinUtfToTChar(title, -1, &ds); (*tkWinProcs->setWindowText)(hDlg, - (TCHAR *) Tcl_DStringValue(&ds)); + Tcl_WinUtfToTChar(title, -1, &ds)); Tcl_DStringFree(&ds); } if (tsdPtr->debugFlag) { diff --git a/win/tkWinTest.c b/win/tkWinTest.c index bc84e85..ce0259d 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinTest.c,v 1.5 2001/10/01 21:20:36 hobbs Exp $ + * RCS: @(#) $Id: tkWinTest.c,v 1.6 2002/02/08 02:57:11 dgp Exp $ */ #include "tkWinInt.h" @@ -121,11 +121,10 @@ AppendSystemError( Tcl_Encoding encoding; encoding = Tcl_GetEncoding(NULL, "unicode"); - Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds); + msg = Tcl_ExternalToUtfDString(encoding, (char *) wMsgPtr, -1, &ds); Tcl_FreeEncoding(encoding); LocalFree(wMsgPtr); - msg = Tcl_DStringValue(&ds); length = Tcl_DStringLength(&ds); /* -- cgit v0.12