Tk Source Code

Check-in [0a0a44ba]
Login

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

Overview
Comment:Add semicolons needed to fix the build when the NEW_SEGMENT macro is used.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: 0a0a44ba2f1d3f96814a2d511f614651131b557bb06702ed92293971a7bb7ac9
User & Date: fvogel 2024-11-22 20:43:35
Context
2024-11-30
16:56
merge trunk check-in: 0cfeb5b2 user: fvogel tags: revised_text, tip-466
2024-11-22
20:43
Add semicolons needed to fix the build when the NEW_SEGMENT macro is used. check-in: 0a0a44ba user: fvogel tags: revised_text, tip-466
2024-11-17
18:25
Fix [d5a3b86f3a]: tablelist widget with header items and title columns crashes when run with revised_text. check-in: 947fbbd8 user: fvogel tags: revised_text, tip-466
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/tkTextBTree.c.
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
    unsigned capacity;
    TkTextSegment *newPtr;

    assert(length <= newSize);

    capacity = CSEG_CAPACITY(newSize);
    newPtr = (TkTextSegment *)ckalloc(CSEG_SIZE(capacity));
    memset(newPtr, 0, CSEG_SIZE(capacity))
    NEW_SEGMENT(newPtr);
    newPtr->typePtr = &tkTextCharType;
    newPtr->sectionPtr = sectionPtr;
    newPtr->size = newSize;
    newPtr->refCount = 1;
    memcpy(newPtr->body.chars, string, length);
    memset(newPtr->body.chars + length, 0, capacity - length);







|







6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
    unsigned capacity;
    TkTextSegment *newPtr;

    assert(length <= newSize);

    capacity = CSEG_CAPACITY(newSize);
    newPtr = (TkTextSegment *)ckalloc(CSEG_SIZE(capacity));
    memset(newPtr, 0, CSEG_SIZE(capacity));
    NEW_SEGMENT(newPtr);
    newPtr->typePtr = &tkTextCharType;
    newPtr->sectionPtr = sectionPtr;
    newPtr->size = newSize;
    newPtr->refCount = 1;
    memcpy(newPtr->body.chars, string, length);
    memset(newPtr->body.chars + length, 0, capacity - length);
Changes to generic/tkTextWind.c.
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
MakeWindow(
    TkText *textPtr)		/* Information about text widget that contains embedded image. */
{
    TkTextSegment *ewPtr;
    TkTextEmbWindowClient *client;

    ewPtr = (TkTextSegment *)ckalloc(SEG_SIZE(TkTextEmbWindow));
    memset(ewPtr, 0, SEG_SIZE(TkTextEmbWindow))
    NEW_SEGMENT(ewPtr);
    ewPtr->typePtr = &tkTextEmbWindowType;
    ewPtr->size = 1;
    ewPtr->refCount = 1;
    ewPtr->body.ew.sharedTextPtr = textPtr->sharedTextPtr;
    ewPtr->body.ew.align = ALIGN_CENTER;
    ewPtr->body.ew.isOwner = 1;







|







639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
MakeWindow(
    TkText *textPtr)		/* Information about text widget that contains embedded image. */
{
    TkTextSegment *ewPtr;
    TkTextEmbWindowClient *client;

    ewPtr = (TkTextSegment *)ckalloc(SEG_SIZE(TkTextEmbWindow));
    memset(ewPtr, 0, SEG_SIZE(TkTextEmbWindow));
    NEW_SEGMENT(ewPtr);
    ewPtr->typePtr = &tkTextEmbWindowType;
    ewPtr->size = 1;
    ewPtr->refCount = 1;
    ewPtr->body.ew.sharedTextPtr = textPtr->sharedTextPtr;
    ewPtr->body.ew.align = ALIGN_CENTER;
    ewPtr->body.ew.isOwner = 1;