summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-12 19:38:33 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-12-12 19:38:33 (GMT)
commit1961633531b70d5a6e627f86153f4d15e722ea8b (patch)
treeae45ec4f7d15560e77c426d92540667e45095d50 /unix
parent00268d4ae68741fdbf73a54412cd38648f9d7302 (diff)
downloadtcl-1961633531b70d5a6e627f86153f4d15e722ea8b.zip
tcl-1961633531b70d5a6e627f86153f4d15e722ea8b.tar.gz
tcl-1961633531b70d5a6e627f86153f4d15e722ea8b.tar.bz2
If compiled with -DTCL_NO_DEPRECATED, remove Tcl_NewIntObj/Tcl_NewLongObj/Tcl_DbNewLongObj from stub table, as they will be gone in 9.0 (converted to a macro)
Use Tcl_WideInt's directly in more places, diminishing the possibility of inadvent overflow.
Diffstat (limited to 'unix')
-rw-r--r--unix/tclLoadAix.c4
-rw-r--r--unix/tclUnixFCmd.c8
-rw-r--r--unix/tclUnixPipe.c6
-rw-r--r--unix/tclUnixTest.c4
4 files changed, 11 insertions, 11 deletions
diff --git a/unix/tclLoadAix.c b/unix/tclLoadAix.c
index 88e6b50..e5d9729 100644
--- a/unix/tclLoadAix.c
+++ b/unix/tclLoadAix.c
@@ -134,7 +134,7 @@ dlopen(
return NULL;
}
- mp->name = malloc((unsigned) (strlen(path) + 1));
+ mp->name = malloc(strlen(path) + 1);
strcpy(mp->name, path);
/*
@@ -541,7 +541,7 @@ readExports(
tmpsym[SYMNMLEN] = '\0';
symname = tmpsym;
}
- ep->name = malloc((unsigned) (strlen(symname) + 1));
+ ep->name = malloc(strlen(symname) + 1);
strcpy(ep->name, symname);
ep->addr = (void *)((unsigned long)
mp->entry + ls->l_value - shdata.s_vaddr);
diff --git a/unix/tclUnixFCmd.c b/unix/tclUnixFCmd.c
index 548e96b..7205085 100644
--- a/unix/tclUnixFCmd.c
+++ b/unix/tclUnixFCmd.c
@@ -1369,7 +1369,7 @@ GetGroupAttribute(
groupPtr = TclpGetGrGid(statBuf.st_gid);
if (groupPtr == NULL) {
- *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_gid);
+ *attributePtrPtr = Tcl_NewWideIntObj(statBuf.st_gid);
} else {
Tcl_DString ds;
const char *utf;
@@ -1423,7 +1423,7 @@ GetOwnerAttribute(
pwPtr = TclpGetPwUid(statBuf.st_uid);
if (pwPtr == NULL) {
- *attributePtrPtr = Tcl_NewIntObj((int) statBuf.st_uid);
+ *attributePtrPtr = Tcl_NewWideIntObj(statBuf.st_uid);
} else {
Tcl_DString ds;
@@ -2340,8 +2340,8 @@ GetUnixFileAttributes(
return TCL_ERROR;
}
- *attributePtrPtr = Tcl_NewIntObj(
- (fileAttributes & attributeArray[objIndex]) != 0);
+ *attributePtrPtr = Tcl_NewBooleanObj(
+ fileAttributes & attributeArray[objIndex]);
return TCL_OK;
}
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index be7b4eb..93faec8 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -872,7 +872,7 @@ TclGetAndDetachPids(
pipePtr = Tcl_GetChannelInstanceData(chan);
TclNewObj(pidsObj);
for (i = 0; i < pipePtr->numPids; i++) {
- Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewIntObj(
+ Tcl_ListObjAppendElement(NULL, pidsObj, Tcl_NewWideIntObj(
PTR2INT(pipePtr->pidPtr[i])));
Tcl_DetachPids(1, &pipePtr->pidPtr[i]);
}
@@ -1268,7 +1268,7 @@ Tcl_PidObjCmd(
}
if (objc == 1) {
- Tcl_SetObjResult(interp, Tcl_NewLongObj((long) getpid()));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(getpid()));
} else {
/*
* Get the channel and make sure that it refers to a pipe.
@@ -1290,7 +1290,7 @@ Tcl_PidObjCmd(
resultPtr = Tcl_NewObj();
for (i = 0; i < pipePtr->numPids; i++) {
Tcl_ListObjAppendElement(NULL, resultPtr,
- Tcl_NewIntObj(PTR2INT(TclpGetPid(pipePtr->pidPtr[i]))));
+ Tcl_NewWideIntObj(PTR2INT(TclpGetPid(pipePtr->pidPtr[i]))));
}
Tcl_SetObjResult(interp, resultPtr);
}
diff --git a/unix/tclUnixTest.c b/unix/tclUnixTest.c
index ceb64d9..e59a0e3 100644
--- a/unix/tclUnixTest.c
+++ b/unix/tclUnixTest.c
@@ -570,7 +570,7 @@ TestforkObjCmd(
if (pid==0) {
Tcl_InitNotifier();
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(pid));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(pid));
return TCL_OK;
}
@@ -761,7 +761,7 @@ TestchmodCmd(
if (translated == NULL) {
return TCL_ERROR;
}
- if (chmod(translated, (unsigned) mode) != 0) {
+ if (chmod(translated, mode) != 0) {
Tcl_AppendResult(interp, translated, ": ", Tcl_PosixError(interp),
NULL);
return TCL_ERROR;