diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-24 21:29:59 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-05-24 21:29:59 (GMT) |
commit | a8636d143def6ec81330e49af713edbb2e08862a (patch) | |
tree | ecbaea802a0bc17da9aaadc8f12c97d15e9c768d /generic/tkTextBTree.c | |
parent | 334a6b720c513b352e0b4d13dc50b498a78c2ee4 (diff) | |
download | tk-a8636d143def6ec81330e49af713edbb2e08862a.zip tk-a8636d143def6ec81330e49af713edbb2e08862a.tar.gz tk-a8636d143def6ec81330e49af713edbb2e08862a.tar.bz2 |
More progress
Diffstat (limited to 'generic/tkTextBTree.c')
-rw-r--r-- | generic/tkTextBTree.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tkTextBTree.c b/generic/tkTextBTree.c index 2d8a6c3..5ce7a99 100644 --- a/generic/tkTextBTree.c +++ b/generic/tkTextBTree.c @@ -161,7 +161,7 @@ static int CharDeleteProc(TkTextSegment *segPtr, TkTextLine *linePtr, int treeGone); static TkTextSegment * CharCleanupProc(TkTextSegment *segPtr, TkTextLine *linePtr); -static TkTextSegment * CharSplitProc(TkTextSegment *segPtr, int index); +static TkTextSegment * CharSplitProc(TkTextSegment *segPtr, TkSizeT index); static void CheckNodeConsistency(Node *nodePtr, int references); static void CleanupLine(TkTextLine *linePtr); static void DeleteSummaries(Summary *tagPtr); @@ -1197,7 +1197,7 @@ SplitSeg( segPtr = linePtr->segPtr; while (segPtr != NULL) { - if (segPtr->size > count) { + if (segPtr->size > (TkSizeT)count) { if (count == 0) { return prevPtr; } @@ -3244,7 +3244,7 @@ TkBTreeCharTagged( toggleSegPtr = NULL; for (index = 0, segPtr = indexPtr->linePtr->segPtr; - (index + segPtr->size) <= indexPtr->byteIndex; + (index + (int)segPtr->size) <= indexPtr->byteIndex; index += segPtr->size, segPtr = segPtr->nextPtr) { if (((segPtr->typePtr == &tkTextToggleOnType) || (segPtr->typePtr == &tkTextToggleOffType)) @@ -3364,7 +3364,7 @@ TkBTreeGetTags( linePtr = indexPtr->linePtr; index = 0; segPtr = linePtr->segPtr; - while ((index + segPtr->size) <= indexPtr->byteIndex) { + while ((index + (int)segPtr->size) <= indexPtr->byteIndex) { if ((segPtr->typePtr == &tkTextToggleOnType) || (segPtr->typePtr == &tkTextToggleOffType)) { IncCount(segPtr->body.toggle.tagPtr, 1, &tagInfo); @@ -3528,7 +3528,7 @@ TkTextIsElided( index = 0; linePtr = indexPtr->linePtr; segPtr = linePtr->segPtr; - while ((index + segPtr->size) <= indexPtr->byteIndex) { + while ((index + (int)segPtr->size) <= indexPtr->byteIndex) { if ((segPtr->typePtr == &tkTextToggleOnType) || (segPtr->typePtr == &tkTextToggleOffType)) { tagPtr = segPtr->body.toggle.tagPtr; @@ -3865,7 +3865,7 @@ TkBTreeCheck( } if (segPtr->size != 1) { Tcl_Panic("TkBTreeCheck: last line has wrong # characters: %d", - segPtr->size); + (int)segPtr->size); } if ((segPtr->body.chars[0] != '\n') || (segPtr->body.chars[1] != 0)) { Tcl_Panic("TkBTreeCheck: last line had bad value: %s", @@ -4549,7 +4549,7 @@ TkBTreeNumPixels( static TkTextSegment * CharSplitProc( TkTextSegment *segPtr, /* Pointer to segment to split. */ - int index) /* Position within segment at which to + TkSizeT index) /* Position within segment at which to * split. */ { TkTextSegment *newPtr1, *newPtr2; @@ -4675,10 +4675,10 @@ CharCheckProc( * to each other: they should be merged together. */ - if (segPtr->size <= 0) { + if (segPtr->size + 1 <= 1) { Tcl_Panic("CharCheckProc: segment has size <= 0"); } - if (strlen(segPtr->body.chars) != (size_t) segPtr->size) { + if (strlen(segPtr->body.chars) != (size_t)segPtr->size) { Tcl_Panic("CharCheckProc: segment has wrong size"); } if (segPtr->nextPtr == NULL) { |