diff options
-rw-r--r-- | generic/tkTextMark.c | 10 | ||||
-rw-r--r-- | library/tk.tcl | 16 |
2 files changed, 10 insertions, 16 deletions
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c index 4cfa0ea..6a41c77 100644 --- a/generic/tkTextMark.c +++ b/generic/tkTextMark.c @@ -838,13 +838,10 @@ MarkFindNext( * For non-mark name indices we want to return any marks that are * right at the index. */ - const TkTextIndex *indexFromPtr; - indexFromPtr = TkTextGetIndexFromObj(interp, textPtr, obj); - if (indexFromPtr == NULL) { + if (TkTextGetObjIndex(interp, textPtr, obj, &index) != TCL_OK) { return TCL_ERROR; } - memcpy(&index, indexFromPtr, sizeof(TkTextIndex)); for (offset = 0, segPtr = index.linePtr->segPtr; segPtr != NULL && offset < index.byteIndex; offset += segPtr->size, segPtr = segPtr->nextPtr) { @@ -929,13 +926,10 @@ MarkFindPrev( * For non-mark name indices we do not return any marks that are * right at the index. */ - const TkTextIndex *indexFromPtr; - indexFromPtr = TkTextGetIndexFromObj(interp, textPtr, obj); - if (indexFromPtr == NULL) { + if (TkTextGetObjIndex(interp, textPtr, obj, &index) != TCL_OK) { return TCL_ERROR; } - memcpy(&index, indexFromPtr, sizeof(TkTextIndex)); for (offset = 0, segPtr = index.linePtr->segPtr; segPtr != NULL && offset < index.byteIndex; offset += segPtr->size, segPtr = segPtr->nextPtr) { diff --git a/library/tk.tcl b/library/tk.tcl index 0110fe3..c490797 100644 --- a/library/tk.tcl +++ b/library/tk.tcl @@ -24,7 +24,7 @@ namespace eval ::tk { # The msgcat package is not available. Supply our own # minimal replacement. proc mc {src args} { - return [format $src {*}$args] + tailcall format $src {*}$args } proc mcmax {args} { set max 0 @@ -334,35 +334,35 @@ proc ::tk::EventMotifBindings {n1 dummy dummy} { if {![llength [info commands tk_chooseColor]]} { proc ::tk_chooseColor {args} { - return [::tk::dialog::color:: {*}$args] + tailcall ::tk::dialog::color:: {*}$args } } if {![llength [info commands tk_getOpenFile]]} { proc ::tk_getOpenFile {args} { if {$::tk_strictMotif} { - return [::tk::MotifFDialog open {*}$args] + tailcall ::tk::MotifFDialog open {*}$args } else { - return [::tk::dialog::file:: open {*}$args] + tailcall ::tk::dialog::file:: open {*}$args } } } if {![llength [info commands tk_getSaveFile]]} { proc ::tk_getSaveFile {args} { if {$::tk_strictMotif} { - return [::tk::MotifFDialog save {*}$args] + tailcall ::tk::MotifFDialog save {*}$args } else { - return [::tk::dialog::file:: save {*}$args] + tailcall ::tk::dialog::file:: save {*}$args } } } if {![llength [info commands tk_messageBox]]} { proc ::tk_messageBox {args} { - return [::tk::MessageBox {*}$args] + tailcall ::tk::MessageBox {*}$args } } if {![llength [info command tk_chooseDirectory]]} { proc ::tk_chooseDirectory {args} { - return [::tk::dialog::file::chooseDir:: {*}$args] + tailcall ::tk::dialog::file::chooseDir:: {*}$args } } |