diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-23 08:13:11 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-04-23 08:13:11 (GMT) |
| commit | 2b41b2d12bf50d873436d0ce09e1e7b8345d5540 (patch) | |
| tree | 6fb5f61f31dda4cc65bf9b4b66a9c598995749fe /unix | |
| parent | 9cd23041f3a73559c43adb6120b1ccdf4bd15604 (diff) | |
| parent | 6f566fc406752600f7ae67df0c7356d987b753fe (diff) | |
| download | tcl-2b41b2d12bf50d873436d0ce09e1e7b8345d5540.zip tcl-2b41b2d12bf50d873436d0ce09e1e7b8345d5540.tar.gz tcl-2b41b2d12bf50d873436d0ce09e1e7b8345d5540.tar.bz2 | |
Fix gcc type mismatch warnings exposed by disabling casts using disabletcl8api
Diffstat (limited to 'unix')
| -rw-r--r-- | unix/tclUnixFCmd.c | 8 | ||||
| -rw-r--r-- | unix/tclUnixFile.c | 4 | ||||
| -rw-r--r-- | unix/tclUnixInit.c | 14 |
3 files changed, 17 insertions, 9 deletions
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c index 8109202..b260cf4 100644 --- a/unix/tclUnixFCmd.c +++ b/unix/tclUnixFCmd.c @@ -1504,7 +1504,7 @@ SetGroupAttribute( Tcl_DString ds; struct group *groupPtr = NULL; const char *string; - size_t length; + Tcl_Size length; string = Tcl_GetStringFromObj(attributePtr, &length); @@ -1571,7 +1571,7 @@ SetOwnerAttribute( Tcl_DString ds; struct passwd *pwPtr = NULL; const char *string; - size_t length; + Tcl_Size length; string = Tcl_GetStringFromObj(attributePtr, &length); @@ -1947,7 +1947,7 @@ TclpObjNormalizePath( { const char *currentPathEndPosition; char cur; - size_t pathLen; + Tcl_Size pathLen; const char *path = Tcl_GetStringFromObj(pathPtr, &pathLen); Tcl_DString ds; const char *nativePath; @@ -2171,7 +2171,7 @@ TclUnixOpenTemporaryFile( Tcl_DString templ, tmp; const char *string; int fd; - size_t length; + Tcl_Size length; /* * We should also check against making more then TMP_MAX of these. diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 50ee64d..41985ab 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -946,7 +946,7 @@ TclpObjLink( if (linkAction & TCL_CREATE_SYMBOLIC_LINK) { Tcl_DString ds; Tcl_Obj *transPtr; - size_t length; + Tcl_Size length; /* * Now we don't want to link to the absolute, normalized path. @@ -1087,7 +1087,7 @@ TclNativeCreateNativeRep( const char *str; Tcl_DString ds; Tcl_Obj *validPathPtr; - size_t len; + Tcl_Size len; if (TclFSCwdIsNative()) { /* diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c index 9d1c192..1aecbd8 100644 --- a/unix/tclUnixInit.c +++ b/unix/tclUnixInit.c @@ -544,9 +544,17 @@ TclpInitLibraryPath( Tcl_DStringFree(&buffer); *encodingPtr = Tcl_GetEncoding(NULL, NULL); - str = Tcl_GetStringFromObj(pathPtr, lengthPtr); - *valuePtr = (char *)Tcl_Alloc(*lengthPtr + 1); - memcpy(*valuePtr, str, *lengthPtr + 1); + + /* + * Note lengthPtr is (TCL_HASH_TYPE *) which is unsigned so cannot + * pass directly to Tcl_GetStringFromObj. + * TODO - why is the type TCL_HASH_TYPE anyways? + */ + Tcl_Size length; + str = Tcl_GetStringFromObj(pathPtr, &length); + *lengthPtr = length; + *valuePtr = (char *)Tcl_Alloc(length + 1); + memcpy(*valuePtr, str, length + 1); Tcl_DecrRefCount(pathPtr); } |
