Skip to content

Commit

Permalink
Merge pull request #22 from chrstphrchvz/no-TCL_VARARGS
Browse files Browse the repository at this point in the history
Remove `TCL_VARARGS_DEF`/`TCL_VARARGS_START` usage
  • Loading branch information
bovine authored Jan 18, 2024
2 parents 2e0d889 + 2bc5687 commit 0f6ff65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion generic/tclExtend.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ EXTERN void TclX_SplitWinCmdLine (int *argcPtr, char ***argvPtr);
#if defined(__GNUC__) && __GNUC__ >= 4
__attribute__((sentinel))
#endif
EXTERN void TclX_AppendObjResult TCL_VARARGS_DEF(Tcl_Interp *, interpArg);
EXTERN void TclX_AppendObjResult (Tcl_Interp *interp, ...);

EXTERN char * TclX_DownShift (char *targetStr, const char *sourceStr);

Expand Down
6 changes: 2 additions & 4 deletions generic/tclXutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,22 +791,20 @@ TclX_WrongArgs (Tcl_Interp *interp, Tcl_Obj *commandNameObj, char *string)
*-----------------------------------------------------------------------------
*/
void
TclX_AppendObjResult TCL_VARARGS_DEF (Tcl_Interp *, arg1)
TclX_AppendObjResult (Tcl_Interp *interp, ...)
{
Tcl_Interp *interp;
Tcl_Obj *resultPtr;
va_list argList;
char *string;

interp = TCL_VARARGS_START (Tcl_Interp *, arg1, argList);
resultPtr = Tcl_GetObjResult (interp);

if (Tcl_IsShared(resultPtr)) {
resultPtr = Tcl_NewStringObj((char *)NULL, 0);
Tcl_SetObjResult(interp, resultPtr);
}

TCL_VARARGS_START(Tcl_Interp *,arg1,argList);
va_start(argList, interp);
while (1) {
string = va_arg(argList, char *);
if (string == NULL) {
Expand Down

0 comments on commit 0f6ff65

Please sign in to comment.