summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authordas <das>2009-02-19 06:35:01 (GMT)
committerdas <das>2009-02-19 06:35:01 (GMT)
commit59207d524457ce50296ceb2e91eba66bc0e1f4ec (patch)
tree9e1ee7c3b37ce4b2955876c2edec91ed0a2b6191 /generic/tclStringObj.c
parent26a75c8619e638a8cb57c46899fa77eb6fa1c8d8 (diff)
downloadtcl-59207d524457ce50296ceb2e91eba66bc0e1f4ec.zip
tcl-59207d524457ce50296ceb2e91eba66bc0e1f4ec.tar.gz
tcl-59207d524457ce50296ceb2e91eba66bc0e1f4ec.tar.bz2
fix signed/unsigned comparison warnings
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 2925a80..eb11b43 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -33,7 +33,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStringObj.c,v 1.118 2009/02/18 20:10:34 dgp Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.119 2009/02/19 06:35:01 das Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -119,7 +119,7 @@ typedef struct String {
#define STRING_SIZE(numChars) \
(sizeof(String) + ((numChars) * sizeof(Tcl_UniChar)))
#define stringCheckLimits(numChars) \
- if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
+ if ((numChars) < 0 || (size_t)(numChars) > STRING_MAXCHARS) { \
Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
STRING_MAXCHARS); \
}
@@ -246,7 +246,7 @@ GrowUnicodeBuffer(
if (stringPtr->maxChars > 0) {
/* Subsequent appends - apply the growth algorithm. */
attempt = 2 * needed;
- if (attempt >= 0 && attempt <= STRING_MAXCHARS) {
+ if (attempt >= 0 && (size_t)attempt <= STRING_MAXCHARS) {
ptr = stringAttemptRealloc(stringPtr, attempt);
}
if (ptr == NULL) {
@@ -947,7 +947,7 @@ Tcl_AttemptSetObjLength(
* Changing length of pure unicode string.
*/
- if (length > STRING_MAXCHARS) {
+ if ((size_t)length > STRING_MAXCHARS) {
return 0;
}
if (length > stringPtr->maxChars) {