Tk Source Code

Check-in [1b803cf9]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix gcc warning: tkText.c:5159:55: warning: division ‘sizeof (TkTextPosition * {aka struct TkTextPosition *}) / sizeof (TkTextPosition {aka struct TkTextPosition})’ does not compute the number of array elements [-Wsizeof-pointer-div] which turns out to be an actual - but harmless - bug
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text-aside
Files: files | file ages | folders
SHA3-256: 1b803cf914f833ce1a9462be2d8f6f38c58eb57bb3362dff4bfa5353f004f67b
User & Date: jan.nijtmans 2018-12-31 16:32:19
Context
2019-01-03
21:44
Fix gcc warning: tkText.c:5159:55: warning: division ‘sizeof (TkTextPosition * {aka struct TkTextPosition *}) / sizeof (TkTextPosition {aka struct TkTextPosition})’ does not compute the number of array elements [-Wsizeof-pointer-div] which turns out to be an actual - but harmless - bug check-in: aea5f1b7 user: jan.nijtmans tags: revised_text, tip-466
2019-01-01
15:00
Realization of global default value for tag option -undo (bug report [5a670c16ba]). check-in: 1a6d9912 user: gcramer tags: revised_text-aside
2018-12-31
16:32
Fix gcc warning: tkText.c:5159:55: warning: division ‘sizeof (TkTextPosition * {aka struct TkTextPosition *}) / sizeof (TkTextPosition {aka struct TkTextPosition})’ does not compute the number of array elements [-Wsizeof-pointer-div] which turns out to be an actual - but harmless - bug check-in: 1b803cf9 user: jan.nijtmans tags: revised_text-aside
16:19
Merge trunk check-in: e4700191 user: jan.nijtmans tags: revised_text-aside
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkText.c.

5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
    /*
     * Notify the display module that lines are about to change, then do the
     * insertion. If the insertion occurs on the top line of the widget
     * (textPtr->topIndex), then we have to recompute topIndex after the
     * insertion, since the insertion could invalidate it.
     */

    if (sharedTextPtr->numPeers > sizeof(textPosition)/sizeof(textPosition[0])) {
	textPosition = malloc(sizeof(textPosition[0])*sharedTextPtr->numPeers);
    } else {
	textPosition = textPosBuf;
    }
    InitPosition(sharedTextPtr, textPosition);
    FindNewTopPosition(sharedTextPtr, textPosition, index1Ptr, NULL, length);

    TkTextChanged(sharedTextPtr, NULL, index1Ptr, index1Ptr);






|
|







5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
    /*
     * Notify the display module that lines are about to change, then do the
     * insertion. If the insertion occurs on the top line of the widget
     * (textPtr->topIndex), then we have to recompute topIndex after the
     * insertion, since the insertion could invalidate it.
     */

    if (sharedTextPtr->numPeers > sizeof(textPosBuf)/sizeof(textPosBuf[0])) {
	textPosition = malloc(sizeof(TkTextPosition)*sharedTextPtr->numPeers);
    } else {
	textPosition = textPosBuf;
    }
    InitPosition(sharedTextPtr, textPosition);
    FindNewTopPosition(sharedTextPtr, textPosition, index1Ptr, NULL, length);

    TkTextChanged(sharedTextPtr, NULL, index1Ptr, index1Ptr);