diff options
Diffstat (limited to 'macosx/tkMacOSXSend.c')
-rw-r--r-- | macosx/tkMacOSXSend.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/macosx/tkMacOSXSend.c b/macosx/tkMacOSXSend.c index b563817..9b18424 100644 --- a/macosx/tkMacOSXSend.c +++ b/macosx/tkMacOSXSend.c @@ -210,7 +210,7 @@ Tk_SetAppName( TkWindow *winPtr = (TkWindow *) tkwin; Tcl_Interp *interp = winPtr->mainPtr->interp; int suffix, result; - int i, offset; + Tcl_Size i, offset; RegisteredInterp *riPtr, *prevPtr; const char *actualName; Tcl_DString dString; @@ -261,7 +261,7 @@ Tk_SetAppName( interpName = Tcl_GetString(interpNamePtr); if (strcmp(actualName, interpName) == 0) { if (suffix == 1) { - Tcl_DStringAppend(&dString, name, -1); + Tcl_DStringAppend(&dString, name, TCL_INDEX_NONE); Tcl_DStringAppend(&dString, " #", 2); offset = Tcl_DStringLength(&dString); Tcl_DStringSetLength(&dString, offset + TCL_INTEGER_SPACE); @@ -321,33 +321,42 @@ Tk_SetAppName( int Tk_SendObjCmd( - TCL_UNUSED(void *), + TCL_UNUSED(void *), /* Not used */ Tcl_Interp *interp, /* The interp we are sending from */ int objc, /* Number of arguments */ Tcl_Obj *const objv[]) /* The arguments */ { - const char *const sendOptions[] = {"-async", "-displayof", "--", NULL}; - char *stringRep, *destName; + enum { + SEND_ASYNC, SEND_DISPLAYOF, SEND_LAST + }; + static const char *const sendOptions[] = { + "-async", "-displayof", "--", NULL + }; + const char *stringRep, *destName; /*int async = 0;*/ - int i, index, firstArg; + int i, firstArg, index; RegisteredInterp *riPtr; Tcl_Obj *listObjPtr; int result = TCL_OK; - for (i = 1; i < (objc - 1); ) { + /* + * Process the command options. + */ + + for (i = 1; i < (objc - 1); i++) { stringRep = Tcl_GetString(objv[i]); if (stringRep[0] == '-') { if (Tcl_GetIndexFromObjStruct(interp, objv[i], sendOptions, sizeof(char *), "option", 0, &index) != TCL_OK) { return TCL_ERROR; } - if (index == 0) { + if (index == SEND_ASYNC) { /*async = 1;*/ + } else if (index == SEND_DISPLAYOF) { i++; - } else if (index == 1) { - i += 2; - } else { + } else /* if (index == SEND_LAST) */ { i++; + break; } } else { break; @@ -472,7 +481,7 @@ TkGetInterpNames( riPtr = interpListPtr; while (riPtr != NULL) { Tcl_ListObjAppendElement(interp, listObjPtr, - Tcl_NewStringObj(riPtr->name, -1)); + Tcl_NewStringObj(riPtr->name, TCL_INDEX_NONE)); riPtr = riPtr->nextPtr; } @@ -499,7 +508,7 @@ TkGetInterpNames( static int SendInit( - TCL_UNUSED(Tcl_Interp *)) + TCL_UNUSED(Tcl_Interp *)) /* Not used */ { return TCL_OK; } |