Tk Source Code

Check-in [c36d1ff4]
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 a few more warnings, when compiling against Tcl 9.0
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256:c36d1ff4feaae67e8af1f3439acd33a5b6aea5c82c18d4d867e5ac3d28883213
User & Date: jan.nijtmans 2018-10-19 22:02:32
Context
2018-10-19
22:20
Two more warnings, back with compiling against Tcl 8.7 check-in: fd92f39c user: jan.nijtmans tags: revised_text, tip-466
22:02
Fix a few more warnings, when compiling against Tcl 9.0 check-in: c36d1ff4 user: jan.nijtmans tags: revised_text, tip-466
21:48
Fix [7ef5bdc18527dcaa3ab] (one more warning): trunk/revised_text : mac os x: compilation warnings check-in: 25847994 user: jan.nijtmans tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextDisp.c.

2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
.....
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
.....
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
.....
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
LayoutFinalizeCharInfo(
    LayoutData *data,
    bool gotTab)
{
    CharInfo *ciPtr = data->chunkPtr->clientData;

    assert(data->trimSpaces ?
	    (int) data->chunkPtr->numBytes >= ciPtr->numBytes :
	    (int) data->chunkPtr->numBytes == ciPtr->numBytes);

    /*
     * Update the character information. Take into account that we don't want
     * to display the newline character.
     */

    if (ciPtr->u.chars[ciPtr->baseOffset + ciPtr->numBytes - 1] == '\n') {
................................................................................
	}
	if (chunkPtr->wrappedAtSpace) {
	    assert(charsLen >= 1);
	    charsLen -= 1;
	}
    }

    if (start == ciPtr->baseOffset) {
	/*
	 * This is a very frequent case, and MeasureChars() is not needed here.
	 */

	startX -= chunkPtr->x - baseChunkPtr->x;
    } else {
	int widthUntilStart;
................................................................................
	GC fgGC;

	string = Tcl_DStringValue(&baseChunkPtr->baseChars);
	ciPtr = chunkPtr->clientData;
	start = ciPtr->baseOffset + offsetBytes;
	len = ciPtr->numBytes - offsetBytes;

	assert(ciPtr->numBytes >= offsetBytes);

	if (len == 0 || (string[start + len - 1] == '\t' && --len == 0)) {
	    return;
	}

	stylePtr = chunkPtr->stylePtr;
	sValuePtr = stylePtr->sValuePtr;
................................................................................
    int x, y, width, height;

    switch (chunkPtr->layoutProcs->type) {
    case TEXT_DISP_CHAR:
	fprintf(stdout, "CHAR=");
	if (chunkPtr->clientData) {
	    const CharInfo *ciPtr = (const CharInfo *) chunkPtr->clientData;
	    int i;

	    for (i = 0; i < ciPtr->numBytes; ++i) {
		char c = ciPtr->u.chars[i];

		switch (c) {
		case '\t': fprintf(stdout, "\\t"); break;
		case '\n': fprintf(stdout, "\\n"); break;







|
|







 







|







 







|







 







|







2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
.....
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
.....
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
.....
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
LayoutFinalizeCharInfo(
    LayoutData *data,
    bool gotTab)
{
    CharInfo *ciPtr = data->chunkPtr->clientData;

    assert(data->trimSpaces ?
	    data->chunkPtr->numBytes >= ciPtr->numBytes :
	    data->chunkPtr->numBytes == ciPtr->numBytes);

    /*
     * Update the character information. Take into account that we don't want
     * to display the newline character.
     */

    if (ciPtr->u.chars[ciPtr->baseOffset + ciPtr->numBytes - 1] == '\n') {
................................................................................
	}
	if (chunkPtr->wrappedAtSpace) {
	    assert(charsLen >= 1);
	    charsLen -= 1;
	}
    }

    if ((TkSizeT)start == ciPtr->baseOffset) {
	/*
	 * This is a very frequent case, and MeasureChars() is not needed here.
	 */

	startX -= chunkPtr->x - baseChunkPtr->x;
    } else {
	int widthUntilStart;
................................................................................
	GC fgGC;

	string = Tcl_DStringValue(&baseChunkPtr->baseChars);
	ciPtr = chunkPtr->clientData;
	start = ciPtr->baseOffset + offsetBytes;
	len = ciPtr->numBytes - offsetBytes;

	assert(ciPtr->numBytes >= (TkSizeT)offsetBytes);

	if (len == 0 || (string[start + len - 1] == '\t' && --len == 0)) {
	    return;
	}

	stylePtr = chunkPtr->stylePtr;
	sValuePtr = stylePtr->sValuePtr;
................................................................................
    int x, y, width, height;

    switch (chunkPtr->layoutProcs->type) {
    case TEXT_DISP_CHAR:
	fprintf(stdout, "CHAR=");
	if (chunkPtr->clientData) {
	    const CharInfo *ciPtr = (const CharInfo *) chunkPtr->clientData;
	    TkSizeT i;

	    for (i = 0; i < ciPtr->numBytes; ++i) {
		char c = ciPtr->u.chars[i];

		switch (c) {
		case '\t': fprintf(stdout, "\\t"); break;
		case '\n': fprintf(stdout, "\\n"); break;