summaryrefslogtreecommitdiffstats
path: root/generic/tclEnv.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-28 12:46:42 (GMT)
commit4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f (patch)
treed5db4ca8a1fecbd63d9e72730fad2f404367daff /generic/tclEnv.c
parent63994a73e3f641451b26f48f697b6a069863751c (diff)
parent52e543c5691a60c3ef802fecf1ae08e7efcf19b7 (diff)
downloadtcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.zip
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.gz
tcl-4af90e27e5e22978b56d6cb5d0d1ecd90af0f48f.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclEnv.c')
-rw-r--r--generic/tclEnv.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/generic/tclEnv.c b/generic/tclEnv.c
index eb62ca3..30589c2 100644
--- a/generic/tclEnv.c
+++ b/generic/tclEnv.c
@@ -123,7 +123,7 @@ TclSetupEnv(
char *p2;
p1 = Tcl_ExternalToUtfDString(NULL, environ[i], -1, &envString);
- p2 = strchr(p1, '=');
+ p2 = (char *)strchr(p1, '=');
if (p2 == NULL) {
/*
* This condition seem to happen occasionally under some
@@ -172,7 +172,7 @@ TclSetupEnv(
for (hPtr=Tcl_FirstHashEntry(&namesHash, &search); hPtr!=NULL;
hPtr=Tcl_NextHashEntry(&search)) {
- Tcl_Obj *elemName = Tcl_GetHashValue(hPtr);
+ Tcl_Obj *elemName = (Tcl_Obj *)Tcl_GetHashValue(hPtr);
TclObjUnsetVar2(interp, varNamePtr, elemName, TCL_GLOBAL_ONLY);
}
@@ -239,7 +239,7 @@ TclSetEnv(
*/
if ((env.ourEnviron != environ) || (length+2 > env.ourEnvironSize)) {
- char **newEnviron = Tcl_Alloc((length + 5) * sizeof(char *));
+ char **newEnviron = (char **)Tcl_Alloc((length + 5) * sizeof(char *));
memcpy(newEnviron, environ, length * sizeof(char *));
if ((env.ourEnvironSize != 0) && (env.ourEnviron != NULL)) {
@@ -283,7 +283,7 @@ TclSetEnv(
*/
valueLength = strlen(value);
- p = Tcl_Alloc(nameLength + valueLength + 2);
+ p = (char *)Tcl_Alloc(nameLength + valueLength + 2);
memcpy(p, name, nameLength);
p[nameLength] = '=';
memcpy(p+nameLength+1, value, valueLength+1);
@@ -293,7 +293,7 @@ TclSetEnv(
* Copy the native string to heap memory.
*/
- p = Tcl_Realloc(p, Tcl_DStringLength(&envString) + 1);
+ p = (char *)Tcl_Realloc(p, Tcl_DStringLength(&envString) + 1);
memcpy(p, p2, Tcl_DStringLength(&envString) + 1);
Tcl_DStringFree(&envString);
@@ -379,7 +379,7 @@ Tcl_PutEnv(
*/
name = Tcl_ExternalToUtfDString(NULL, assignment, -1, &nameString);
- value = strchr(name, '=');
+ value = (char *)strchr(name, '=');
if ((value != NULL) && (value != name)) {
value[0] = '\0';
@@ -453,18 +453,18 @@ TclUnsetEnv(
*/
#if defined(_WIN32)
- string = Tcl_Alloc(length + 2);
+ string = (char *)Tcl_Alloc(length + 2);
memcpy(string, name, length);
string[length] = '=';
string[length+1] = '\0';
#else
- string = Tcl_Alloc(length + 1);
+ string = (char *)Tcl_Alloc(length + 1);
memcpy(string, name, length);
string[length] = '\0';
#endif /* _WIN32 */
Tcl_UtfToExternalDString(NULL, string, -1, &envString);
- string = Tcl_Realloc(string, Tcl_DStringLength(&envString) + 1);
+ string = (char *)Tcl_Realloc(string, Tcl_DStringLength(&envString) + 1);
memcpy(string, Tcl_DStringValue(&envString),
Tcl_DStringLength(&envString)+1);
Tcl_DStringFree(&envString);
@@ -578,7 +578,7 @@ TclGetEnv(
/* ARGSUSED */
static char *
EnvTraceProc(
- ClientData clientData, /* Not used. */
+ ClientData dummy, /* Not used. */
Tcl_Interp *interp, /* Interpreter whose "env" variable is being
* modified. */
const char *name1, /* Better be "env". */
@@ -586,6 +586,7 @@ EnvTraceProc(
* whole array is being deleted (UTF-8). */
int flags) /* Indicates what's happening. */
{
+ (void)dummy;
/*
* For array traces, let TclSetupEnv do all the work.
*/
@@ -700,7 +701,7 @@ ReplaceString(
const int growth = 5;
- env.cache = Tcl_Realloc(env.cache,
+ env.cache = (char **)Tcl_Realloc(env.cache,
(env.cacheSize + growth) * sizeof(char *));
env.cache[env.cacheSize] = newStr;
(void) memset(env.cache+env.cacheSize+1, 0,