Tk Source Code

Check-in [25847994]
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 [7ef5bdc18527dcaa3ab] (one more warning): trunk/revised_text : mac os x: compilation warnings
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | revised_text | tip-466
Files: files | file ages | folders
SHA3-256: 2584799400a2ba01b3a95e2e01e6e98171dd39076d30edd0a172eb6a2da2de0a
User & Date: jan.nijtmans 2018-10-19 21:48:16
Context
2018-10-19
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
21:40
Fix [7ef5bdc18527dcaa3ab]: trunk/revised_text : mac os x: compilation warnings check-in: 25a4eae2 user: jan.nijtmans tags: revised_text, tip-466
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/tkTextDisp.c.

302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
.....
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
typedef struct CharInfo {
    union {
	const char *chars;	/* UTF characters to display. Actually points into the baseChars of
				 * the base chunk. */
	struct CharInfo *next;	/* Pointer to next free info struct. */
    } u;
    int32_t numBytes;		/* Number of bytes that belong to this chunk. */
    int32_t baseOffset;		/* Starting offset in baseChars of base chunk; always zero if
    				 * context drawing is not used. */
    TkTextSegment *segPtr;	/* Pointer to char segment containing the chars. */
} CharInfo;

typedef struct PixelPos {
    int32_t xFirst, xLast; 	/* Horizontal pixel position. */
    int32_t yFirst, yLast;	/* Vertical pixel position. */
................................................................................
    CharInfo *ciPtr = chunkPtr->clientData;
    int offset = ciPtr->baseOffset + byteIndex;
    int maxX = chunkPtr->width + chunkPtr->x;
    int nextX;

    CharChunkMeasureChars(chunkPtr, NULL, 0, 0, byteIndex, chunkPtr->x, -1, textPtr->spaceMode, 0, xPtr);

    if (byteIndex >= ciPtr->numBytes) {
	/*
	 * This situation only happens if the last character in a line is a
	 * space character, in which case it absorbs all of the extra space in
	 * the line (see TkTextCharLayoutProc).
	 */

	*widthPtr = maxX - *xPtr;
    } else if (ciPtr->u.chars[offset] == '\t' && byteIndex == ciPtr->numBytes - 1) {
	/*
	 * The desired character is a tab character that terminates a chunk;
	 * give it all the space left in the chunk.
	 */

	*widthPtr = maxX - *xPtr;
    } else {






|
|







 







|







|







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
.....
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
typedef struct CharInfo {
    union {
	const char *chars;	/* UTF characters to display. Actually points into the baseChars of
				 * the base chunk. */
	struct CharInfo *next;	/* Pointer to next free info struct. */
    } u;
    TkSizeT numBytes;		/* Number of bytes that belong to this chunk. */
    TkSizeT baseOffset;		/* Starting offset in baseChars of base chunk; always zero if
    				 * context drawing is not used. */
    TkTextSegment *segPtr;	/* Pointer to char segment containing the chars. */
} CharInfo;

typedef struct PixelPos {
    int32_t xFirst, xLast; 	/* Horizontal pixel position. */
    int32_t yFirst, yLast;	/* Vertical pixel position. */
................................................................................
    CharInfo *ciPtr = chunkPtr->clientData;
    int offset = ciPtr->baseOffset + byteIndex;
    int maxX = chunkPtr->width + chunkPtr->x;
    int nextX;

    CharChunkMeasureChars(chunkPtr, NULL, 0, 0, byteIndex, chunkPtr->x, -1, textPtr->spaceMode, 0, xPtr);

    if (byteIndex >= (int)ciPtr->numBytes) {
	/*
	 * This situation only happens if the last character in a line is a
	 * space character, in which case it absorbs all of the extra space in
	 * the line (see TkTextCharLayoutProc).
	 */

	*widthPtr = maxX - *xPtr;
    } else if (ciPtr->u.chars[offset] == '\t' && byteIndex == (int)ciPtr->numBytes - 1) {
	/*
	 * The desired character is a tab character that terminates a chunk;
	 * give it all the space left in the chunk.
	 */

	*widthPtr = maxX - *xPtr;
    } else {