summaryrefslogtreecommitdiffstats
path: root/generic/tkSelect.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-21 16:44:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-21 16:44:10 (GMT)
commitfe47d608d0455a3b06522f85f4ccc238e76549bd (patch)
tree5ed0d5752ddf00acb5159003f2af1f47e31e11ff /generic/tkSelect.c
parent29df448c956c297a8f4c1dfda0ee2c257c48e030 (diff)
downloadtk-fe47d608d0455a3b06522f85f4ccc238e76549bd.zip
tk-fe47d608d0455a3b06522f85f4ccc238e76549bd.tar.gz
tk-fe47d608d0455a3b06522f85f4ccc238e76549bd.tar.bz2
Use more size_t for *Sel*-related functions, in case compiling with Tcl 9
Diffstat (limited to 'generic/tkSelect.c')
-rw-r--r--generic/tkSelect.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index a6548b6..81c6bfe 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -59,8 +59,8 @@ static Tcl_ThreadDataKey dataKey;
* Forward declarations for functions defined in this file:
*/
-static int HandleTclCommand(ClientData clientData,
- int offset, char *buffer, int maxBytes);
+static TkSizeT HandleTclCommand(ClientData clientData,
+ TkSizeT offset, char *buffer, TkSizeT maxBytes);
static void LostSelection(ClientData clientData);
static int SelGetProc(ClientData clientData,
Tcl_Interp *interp, const char *portion);
@@ -1319,13 +1319,13 @@ SelGetProc(
*----------------------------------------------------------------------
*/
-static int
+static TkSizeT
HandleTclCommand(
ClientData clientData, /* Information about command to execute. */
- int offset, /* Return selection bytes starting at this
+ TkSizeT offset, /* Return selection bytes starting at this
* offset. */
char *buffer, /* Place to store converted selection. */
- int maxBytes) /* Maximum # of bytes to store at buffer. */
+ TkSizeT maxBytes) /* Maximum # of bytes to store at buffer. */
{
CommandInfo *cmdInfoPtr = (CommandInfo *)clientData;
int length;
@@ -1349,7 +1349,7 @@ HandleTclCommand(
* character.
*/
- if (offset == cmdInfoPtr->byteOffset) {
+ if ((int)offset == cmdInfoPtr->byteOffset) {
charOffset = cmdInfoPtr->charOffset;
extraBytes = strlen(cmdInfoPtr->buffer);
if (extraBytes > 0) {
@@ -1369,7 +1369,7 @@ HandleTclCommand(
* the offset and maximum # of bytes.
*/
- command = Tcl_ObjPrintf("%s %d %d",
+ command = Tcl_ObjPrintf("%s %d %" TCL_Z_MODIFIER "d",
cmdInfoPtr->command, charOffset, maxBytes);
Tcl_IncrRefCount(command);
@@ -1387,7 +1387,7 @@ HandleTclCommand(
*/
string = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), &length);
- count = (length > maxBytes) ? maxBytes : length;
+ count = (length > (int)maxBytes) ? (int)maxBytes : length;
memcpy(buffer, string, count);
buffer[count] = '\0';
@@ -1397,7 +1397,7 @@ HandleTclCommand(
*/
if (cmdInfoPtr->interp != NULL) {
- if (length <= maxBytes) {
+ if (length <= (int)maxBytes) {
cmdInfoPtr->charOffset += Tcl_NumUtfChars(string, -1);
cmdInfoPtr->buffer[0] = '\0';
} else {