diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2007-11-17 23:07:45 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2007-11-17 23:07:45 (GMT) |
commit | 564fb4d84402fcf9765bc3e2319aa11e4cdd8030 (patch) | |
tree | 23a7a36869acb014ae54c3af70058f4134ecac67 /generic | |
parent | cd3db4fab4487f93d083f8de89bfe41a4556b090 (diff) | |
download | tk-564fb4d84402fcf9765bc3e2319aa11e4cdd8030.zip tk-564fb4d84402fcf9765bc3e2319aa11e4cdd8030.tar.gz tk-564fb4d84402fcf9765bc3e2319aa11e4cdd8030.tar.bz2 |
Tidy up some variable types.
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkArgv.c | 6 | ||||
-rw-r--r-- | generic/tkBind.c | 6 | ||||
-rw-r--r-- | generic/tkClipboard.c | 8 | ||||
-rw-r--r-- | generic/tkEntry.c | 8 | ||||
-rw-r--r-- | generic/tkOption.c | 5 | ||||
-rw-r--r-- | generic/tkScale.c | 4 | ||||
-rw-r--r-- | generic/tkScrollbar.c | 4 | ||||
-rw-r--r-- | generic/tkTextImage.c | 4 | ||||
-rw-r--r-- | generic/tkVisual.c | 5 | ||||
-rw-r--r-- | generic/tkWindow.c | 4 |
10 files changed, 29 insertions, 25 deletions
diff --git a/generic/tkArgv.c b/generic/tkArgv.c index 15f032a..ed7b2cd 100644 --- a/generic/tkArgv.c +++ b/generic/tkArgv.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkArgv.c,v 1.9 2007/10/15 07:24:48 das Exp $ + * RCS: @(#) $Id: tkArgv.c,v 1.10 2007/11/17 23:07:45 patthoyts Exp $ */ #include "tkInt.h" @@ -337,7 +337,7 @@ PrintUsage( * for default options. */ { register Tk_ArgvInfo *infoPtr; - int width, i, numSpaces; + size_t width, i, numSpaces; #define NUM_SPACES 20 static char spaces[] = " "; char tmp[TCL_DOUBLE_SPACE]; @@ -351,7 +351,7 @@ PrintUsage( for (i = 0; i < 2; i++) { for (infoPtr = i ? defaultTable : argTable; infoPtr->type != TK_ARGV_END; infoPtr++) { - int length; + size_t length; if (infoPtr->key == NULL) { continue; } diff --git a/generic/tkBind.c b/generic/tkBind.c index d834f0e..542b6b3 100644 --- a/generic/tkBind.c +++ b/generic/tkBind.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkBind.c,v 1.43 2007/09/07 00:34:51 dgp Exp $ + * RCS: @(#) $Id: tkBind.c,v 1.44 2007/11/17 23:07:45 patthoyts Exp $ */ #include "tkInt.h" @@ -1002,7 +1002,7 @@ Tk_CreateBinding( oldStr = (char *) psPtr->clientData; if ((append != 0) && (oldStr != NULL)) { - int length; + size_t length; length = strlen(oldStr) + strlen(command) + 2; newStr = (char *) ckalloc((unsigned) length); @@ -3935,7 +3935,7 @@ GetVirtualEventUid( char *virtString) { Tk_Uid uid; - int length; + size_t length; length = strlen(virtString); diff --git a/generic/tkClipboard.c b/generic/tkClipboard.c index 0caae15..9dda480 100644 --- a/generic/tkClipboard.c +++ b/generic/tkClipboard.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkClipboard.c,v 1.16 2007/09/07 00:34:52 dgp Exp $ + * RCS: @(#) $Id: tkClipboard.c,v 1.17 2007/11/17 23:07:45 patthoyts Exp $ */ #include "tkInt.h" @@ -61,7 +61,7 @@ ClipboardHandler( TkClipboardTarget *targetPtr = (TkClipboardTarget*) clientData; TkClipboardBuffer *cbPtr; char *srcPtr, *destPtr; - int count = 0; + size_t count = 0; int scanned = 0; size_t length, freeCount; @@ -104,7 +104,7 @@ ClipboardHandler( srcPtr = cbPtr->buffer; length = cbPtr->length; } - return count; + return (int)count; } /* @@ -150,7 +150,7 @@ ClipboardAppHandler( length = maxBytes; } strncpy(buffer, p, length); - return length; + return (int)length; } /* diff --git a/generic/tkEntry.c b/generic/tkEntry.c index ae0500c..30b525b 100644 --- a/generic/tkEntry.c +++ b/generic/tkEntry.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkEntry.c,v 1.45 2007/05/24 14:46:24 dkf Exp $ + * RCS: @(#) $Id: tkEntry.c,v 1.46 2007/11/17 23:07:45 patthoyts Exp $ */ #include "tkInt.h" @@ -2008,7 +2008,9 @@ InsertChars( char *value) /* New characters to add (NULL-terminated * string). */ { - int byteIndex, byteCount, oldChars, charsAdded, newByteCount; + ptrdiff_t byteIndex; + size_t byteCount, newByteCount; + int oldChars, charsAdded; CONST char *string; char *newStr; @@ -2021,7 +2023,7 @@ InsertChars( newByteCount = entryPtr->numBytes + byteCount + 1; newStr = (char *) ckalloc((unsigned) newByteCount); - memcpy(newStr, string, (size_t) byteIndex); + memcpy(newStr, string, byteIndex); strcpy(newStr + byteIndex, value); strcpy(newStr + byteIndex + byteCount, string + byteIndex); diff --git a/generic/tkOption.c b/generic/tkOption.c index 254443b..4bb74c8 100644 --- a/generic/tkOption.c +++ b/generic/tkOption.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkOption.c,v 1.22 2007/09/07 00:34:53 dgp Exp $ + * RCS: @(#) $Id: tkOption.c,v 1.23 2007/11/17 23:07:46 patthoyts Exp $ */ #include "tkInt.h" @@ -261,7 +261,8 @@ Tk_AddOption( Element newEl; register CONST char *p; CONST char *field; - int count, firstField, length; + int count, firstField; + ptrdiff_t length; #define TMP_SIZE 100 char tmp[TMP_SIZE+1]; ThreadSpecificData *tsdPtr = (ThreadSpecificData *) diff --git a/generic/tkScale.c b/generic/tkScale.c index 42b88b5..07b4406 100644 --- a/generic/tkScale.c +++ b/generic/tkScale.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScale.c,v 1.26 2007/09/07 00:34:53 dgp Exp $ + * RCS: @(#) $Id: tkScale.c,v 1.27 2007/11/17 23:07:46 patthoyts Exp $ */ #include "default.h" @@ -636,7 +636,7 @@ ConfigureScale( ComputeFormat(scalePtr); - scalePtr->labelLength = scalePtr->label ? strlen(scalePtr->label) : 0; + scalePtr->labelLength = scalePtr->label ? (int)strlen(scalePtr->label) : 0; Tk_SetBackgroundFromBorder(scalePtr->tkwin, scalePtr->bgBorder); diff --git a/generic/tkScrollbar.c b/generic/tkScrollbar.c index 932b6dd..99947cc 100644 --- a/generic/tkScrollbar.c +++ b/generic/tkScrollbar.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkScrollbar.c,v 1.10 2007/09/08 16:01:20 dkf Exp $ + * RCS: @(#) $Id: tkScrollbar.c,v 1.11 2007/11/17 23:07:46 patthoyts Exp $ */ #include "tkInt.h" @@ -542,7 +542,7 @@ ConfigureScrollbar( */ if (scrollPtr->command != NULL) { - scrollPtr->commandSize = strlen(scrollPtr->command); + scrollPtr->commandSize = (int)strlen(scrollPtr->command); } else { scrollPtr->commandSize = 0; } diff --git a/generic/tkTextImage.c b/generic/tkTextImage.c index 5f08da7..d65abc1 100644 --- a/generic/tkTextImage.c +++ b/generic/tkTextImage.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTextImage.c,v 1.20 2007/09/07 00:34:54 dgp Exp $ + * RCS: @(#) $Id: tkTextImage.c,v 1.21 2007/11/17 23:07:46 patthoyts Exp $ */ #include "tkPort.h" @@ -328,7 +328,7 @@ EmbImageConfigure( char *name; int count = 0; /* The counter for picking a unique name */ int conflict = 0; /* True if we have a name conflict */ - unsigned int len; /* length of image name */ + size_t len; /* length of image name */ if (Tk_SetOptions(textPtr->interp, (char*)&eiPtr->body.ei, eiPtr->body.ei.optionTable, diff --git a/generic/tkVisual.c b/generic/tkVisual.c index 7c79ea2..d34b548 100644 --- a/generic/tkVisual.c +++ b/generic/tkVisual.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkVisual.c,v 1.8 2007/09/07 00:34:54 dgp Exp $ + * RCS: @(#) $Id: tkVisual.c,v 1.9 2007/11/17 23:07:46 patthoyts Exp $ */ #include "tkInt.h" @@ -101,7 +101,8 @@ Tk_GetVisual( XVisualInfo template, *visInfoList, *bestPtr; long mask; Visual *visual; - int length, c, numVisuals, prio, bestPrio, i; + ptrdiff_t length; + int c, numVisuals, prio, bestPrio, i; CONST char *p; VisualDictionary *dictPtr; TkColormap *cmapPtr; diff --git a/generic/tkWindow.c b/generic/tkWindow.c index c2e12f8..872a30b 100644 --- a/generic/tkWindow.c +++ b/generic/tkWindow.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWindow.c,v 1.87 2007/10/24 00:16:43 patthoyts Exp $ + * RCS: @(#) $Id: tkWindow.c,v 1.88 2007/11/17 23:07:46 patthoyts Exp $ */ #include "tkInt.h" @@ -744,7 +744,7 @@ NameWindow( char *pathName; int isNew; Tcl_HashEntry *hPtr; - int length1, length2; + size_t length1, length2; /* * Setup all the stuff except name right away, then do the name stuff |