diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-02 16:48:36 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-02 16:48:36 (GMT) |
commit | cc824aa94cc4916ea5ae3f1fc7d905de78e31304 (patch) | |
tree | 013fd174da1697cb869a6c10ae82507be24c9cbc /generic | |
parent | ff0c5e412d60d05f5bcb191a4c3a5142a45f684b (diff) | |
parent | fd9dbdd294fbd96680bd4235087d418bc1cd6935 (diff) | |
download | tcl-cc824aa94cc4916ea5ae3f1fc7d905de78e31304.zip tcl-cc824aa94cc4916ea5ae3f1fc7d905de78e31304.tar.gz tcl-cc824aa94cc4916ea5ae3f1fc7d905de78e31304.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclMain.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/generic/tclMain.c b/generic/tclMain.c index be9ec4c..5083383 100644 --- a/generic/tclMain.c +++ b/generic/tclMain.c @@ -28,7 +28,7 @@ * The default prompt used when the user has not overridden it. */ -#define DEFAULT_PRIMARY_PROMPT "% " +static const char DEFAULT_PRIMARY_PROMPT[] = "% "; /* * This file can be compiled on Windows in UNICODE mode, as well as on all @@ -43,7 +43,7 @@ # define _tcscmp strcmp #endif -static Tcl_Obj * +static inline Tcl_Obj * NewNativeObj( TCHAR *string) { @@ -517,7 +517,7 @@ Tcl_MainEx( * error messages troubles deeper in, so lop it back off. */ - TclGetStringFromObj(is.commandPtr, &length); + (void)Tcl_GetStringFromObj(is.commandPtr, &length); Tcl_SetObjLength(is.commandPtr, --length); code = Tcl_RecordAndEvalObj(interp, is.commandPtr, TCL_EVAL_GLOBAL); @@ -534,7 +534,7 @@ Tcl_MainEx( } else if (is.tty) { resultPtr = Tcl_GetObjResult(interp); Tcl_IncrRefCount(resultPtr); - TclGetStringFromObj(resultPtr, &length); + (void)Tcl_GetStringFromObj(resultPtr, &length); chan = Tcl_GetStdChannel(TCL_STDOUT); if ((length > 0) && chan) { Tcl_WriteObj(chan, resultPtr); @@ -737,7 +737,8 @@ StdinProc( ClientData clientData, /* The state of interactive cmd line */ TCL_UNUSED(int) /*mask*/) { - int code, length; + int code; + int length; InteractiveState *isPtr = (InteractiveState *)clientData; Tcl_Channel chan = isPtr->input; Tcl_Obj *commandPtr = isPtr->commandPtr; @@ -777,7 +778,7 @@ StdinProc( goto prompt; } isPtr->prompt = PROMPT_START; - TclGetStringFromObj(commandPtr, &length); + (void)Tcl_GetStringFromObj(commandPtr, &length); Tcl_SetObjLength(commandPtr, --length); /* @@ -809,7 +810,7 @@ StdinProc( chan = Tcl_GetStdChannel(TCL_STDOUT); Tcl_IncrRefCount(resultPtr); - TclGetStringFromObj(resultPtr, &length); + (void)Tcl_GetStringFromObj(resultPtr, &length); if ((length > 0) && (chan != NULL)) { Tcl_WriteObj(chan, resultPtr); Tcl_WriteChars(chan, "\n", 1); @@ -872,7 +873,7 @@ Prompt( chan = Tcl_GetStdChannel(TCL_STDOUT); if (chan != NULL) { Tcl_WriteChars(chan, DEFAULT_PRIMARY_PROMPT, - strlen(DEFAULT_PRIMARY_PROMPT)); + sizeof(DEFAULT_PRIMARY_PROMPT) - 1); } } } else { |