From 29df448c956c297a8f4c1dfda0ee2c257c48e030 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 20 May 2020 23:02:59 +0000 Subject: Slightly biger "lenght" variables, in case we are using Tcl 9 --- generic/tkClipboard.c | 4 ++-- generic/tkSelect.h | 2 +- macosx/tkMacOSXFont.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index ed555a9..f09958e 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -60,7 +60,7 @@ ClipboardHandler( TkClipboardBuffer *cbPtr; char *srcPtr, *destPtr; size_t count = 0; - int scanned = 0; + size_t scanned = 0; size_t length, freeCount; /* @@ -71,7 +71,7 @@ ClipboardHandler( if (cbPtr == NULL) { return 0; } - if (scanned + cbPtr->length > offset) { + if (scanned + cbPtr->length > (size_t)offset) { break; } scanned += cbPtr->length; diff --git a/generic/tkSelect.h b/generic/tkSelect.h index d7df94e..405cbea 100644 --- a/generic/tkSelect.h +++ b/generic/tkSelect.h @@ -107,7 +107,7 @@ typedef struct TkSelRetrievalInfo { typedef struct TkClipboardBuffer { char *buffer; /* Null terminated data buffer. */ - long length; /* Length of string in buffer. */ + size_t length; /* Length of string in buffer. */ struct TkClipboardBuffer *nextPtr; /* Next in list of buffers. NULL means end of * list . */ diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index 8acba68..7527429 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -166,7 +166,7 @@ static void DrawCharsInContext(Display *display, Drawable drawable, * our string's unicode characters. */ char *p; - unsigned int index; + NSUInteger index; Tcl_DStringInit(&_ds); Tcl_DStringSetLength(&_ds, 3 * [_string length]); -- cgit v0.12