summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-23 09:32:32 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-12-23 09:32:32 (GMT)
commit9394984c31c5ff3087bbdc784811b2d57fda1114 (patch)
treef5ec627adfbd07b7dc0f810e04d91ad232cc5ba3 /generic/tclStringObj.c
parenta728d03f7d2b232dbc44f2669d8eb326b1029d3d (diff)
parentdedbad27485a6129dc66cda6bb0c9f51ba639ae5 (diff)
downloadtcl-9394984c31c5ff3087bbdc784811b2d57fda1114.zip
tcl-9394984c31c5ff3087bbdc784811b2d57fda1114.tar.gz
tcl-9394984c31c5ff3087bbdc784811b2d57fda1114.tar.bz2
merge novem
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 77a613c..4cff70c 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -3081,10 +3081,10 @@ TclStringFind(
}
lh = Tcl_GetCharLength(haystack);
- if (haystack->bytes && (lh == haystack->length)) {
+ if (haystack->bytes && ((size_t)lh == haystack->length)) {
/* haystack is all single-byte chars */
- if (needle->bytes && (ln == needle->length)) {
+ if (needle->bytes && ((size_t)ln == needle->length)) {
/* needle is also all single-byte chars */
char *found = strstr(haystack->bytes + start, needle->bytes);
@@ -3183,10 +3183,10 @@ TclStringLast(
if (last + 1 > lh) {
last = lh - 1;
}
- if (haystack->bytes && (lh == haystack->length)) {
+ if (haystack->bytes && ((size_t)lh == haystack->length)) {
/* haystack is all single-byte chars */
- if (needle->bytes && (ln == needle->length)) {
+ if (needle->bytes && ((size_t)ln == needle->length)) {
/* needle is also all single-byte chars */
char *try = haystack->bytes + last + 1 - ln;
@@ -3245,7 +3245,7 @@ static void
ReverseBytes(
unsigned char *to, /* Copy bytes into here... */
unsigned char *from, /* ...from here... */
- int count) /* Until this many are copied, */
+ size_t count) /* Until this many are copied, */
/* reversing as you go. */
{
unsigned char *src = from + count;
@@ -3314,8 +3314,8 @@ TclStringObjReverse(
}
if (objPtr->bytes) {
- int numChars = stringPtr->numChars;
- int numBytes = objPtr->length;
+ size_t numChars = stringPtr->numChars;
+ size_t numBytes = objPtr->length;
char *to, *from = objPtr->bytes;
if (Tcl_IsShared(objPtr)) {
@@ -3333,8 +3333,8 @@ TclStringObjReverse(
*
* Pass 1. Reverse the bytes of each multi-byte character.
*/
- int charCount = 0;
- int bytesLeft = numBytes;
+ size_t charCount = 0;
+ size_t bytesLeft = numBytes;
while (bytesLeft) {
/*
@@ -3342,7 +3342,7 @@ TclStringObjReverse(
* It's part of the contract for objPtr->bytes values.
* Thus, we can skip calling Tcl_UtfCharComplete() here.
*/
- int bytesInChar = Tcl_UtfToUniChar(from, &ch);
+ size_t bytesInChar = Tcl_UtfToUniChar(from, &ch);
ReverseBytes((unsigned char *)to, (unsigned char *)from,
bytesInChar);