Tk Source Code

Check-in [aea5f1b7]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
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 | tip-466
Files: files | file ages | folders
SHA3-256:aea5f1b7fdf9e32987c156039578a542447f1a60c7420151f4ffa0bed229a613
User & Date: jan.nijtmans 2019-01-03 21:44:17
Context
2019-01-03
21:45
Realization of global default value for tag option -undo (bug report [5a670c16ba]). check-in: a263e6c9 user: jan.nijtmans tags: revised_text, tip-466
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
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
2018-12-09
19:45
merge trunk (except changes in generic/tkText*) check-in: 5858e784 user: fvogel tags: revised_text, tip-466
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);