Skip to content

Commit

Permalink
Fix the build with -DTK_NO_DEPRECATED=1 (errors and warnings).
Browse files Browse the repository at this point in the history
  • Loading branch information
fvogelnew1 committed Dec 4, 2023
1 parent 184dd43 commit f627725
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion generic/tkText.c
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,12 @@ ErrorNotAllowed(

int
TkTextAttemptToModifyDisabledWidget(
TCL_UNUSED(Tcl_Interp *))
#if SUPPORT_DEPRECATED_MODS_OF_DISABLED_WIDGET
TCL_UNUSED(Tcl_Interp *)
#else
Tcl_Interp *interp
#endif
)
{
#if SUPPORT_DEPRECATED_MODS_OF_DISABLED_WIDGET
static int showWarning = 1;
Expand Down Expand Up @@ -1616,6 +1621,8 @@ TextWidgetObjCmd(

#else /* if !SUPPORT_DEPRECATED_STARTLINE_ENDLINE */

Tcl_Obj *objPtr = NULL;

objPtr = Tk_GetOptionValue(interp, textPtr,
textPtr->optionTable, objv[2], textPtr->tkwin);

Expand Down Expand Up @@ -3298,8 +3305,10 @@ ClearText(
tPtr->abortSelections = 1;
textPtr->lastLineY = TK_TEXT_NEARBY_IS_UNDETERMINED;
tPtr->refCount -= 1;
#if SUPPORT_DEPRECATED_STARTLINE_ENDLINE
tPtr->startLine = NULL;
tPtr->endLine = NULL;
#endif /* SUPPORT_DEPRECATED_STARTLINE_ENDLINE */

if (tPtr->startMarker->refCount == 1) {
assert(textPtr->startMarker != textPtr->sharedTextPtr->startMarker);
Expand Down Expand Up @@ -3784,6 +3793,7 @@ TkTextTestLangCode(
*----------------------------------------------------------------------
*/

#if SUPPORT_DEPRECATED_STARTLINE_ENDLINE
static int
IsNumberOrEmpty(
const char *str)
Expand All @@ -3795,6 +3805,7 @@ IsNumberOrEmpty(
}
return 1;
}
#endif /* SUPPORT_DEPRECATED_STARTLINE_ENDLINE */

int
TkConfigureText(
Expand Down
2 changes: 2 additions & 0 deletions generic/tkTextBTree.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ SegIsAtStartOfLine(
return 1; /* never reached */
}

#if SUPPORT_DEPRECATED_STARTLINE_ENDLINE
static int
SegIsAtEndOfLine(
const TkTextSegment *segPtr)
Expand All @@ -583,6 +584,7 @@ SegIsAtEndOfLine(
}
return !segPtr->nextPtr;
}
#endif /* SUPPORT_DEPRECATED_STARTLINE_ENDLINE */

static TkTextSegment *
GetPrevTagInfoSegment(
Expand Down

0 comments on commit f627725

Please sign in to comment.