diff options
Diffstat (limited to 'win/tclWinInit.c')
| -rw-r--r-- | win/tclWinInit.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index a617f60..3ce0efa 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -607,7 +607,7 @@ TclpSetVariables( * * Results: * The return value is the index in environ of an entry with the name - * "name", or -1 if there is no such entry. The integer at *lengthPtr is + * "name", or (size_t)-1 if there is no such entry. The integer at *lengthPtr is * filled in with the length of name (if a matching entry is found) or * the length of the environ array (if no matching entry is found). * @@ -617,16 +617,16 @@ TclpSetVariables( *---------------------------------------------------------------------- */ -int +size_t TclpFindVariable( const char *name, /* Name of desired environment variable * (UTF-8). */ - int *lengthPtr) /* Used to return length of name (for + size_t *lengthPtr) /* Used to return length of name (for * successful searches) or number of non-NULL * entries in environ (for unsuccessful * searches). */ { - int i, length, result = -1; + size_t i, length, result = (size_t)-1; register const char *env, *p1, *p2; char *envUpper, *nameUpper; Tcl_DString envString; @@ -637,7 +637,7 @@ TclpFindVariable( length = strlen(name); nameUpper = ckalloc(length + 1); - memcpy(nameUpper, name, (size_t) length+1); + memcpy(nameUpper, name, length+1); Tcl_UtfToUpper(nameUpper); Tcl_DStringInit(&envString); @@ -653,7 +653,7 @@ TclpFindVariable( if (p1 == NULL) { continue; } - length = (int) (p1 - envUpper); + length = (size_t) (p1 - envUpper); Tcl_DStringSetLength(&envString, length+1); Tcl_UtfToUpper(envUpper); |
