summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixSock.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-18 07:39:21 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-18 07:39:21 (GMT)
commit72275aed2c38b56ce2a3bbcc29547a2967d2fc2c (patch)
tree27563e9a6fe1f058242ca0ec4d562a68ca1890f2 /unix/tclUnixSock.c
parentfd54c8a9d81e0a3758b2029ab0d8d962a9038e14 (diff)
downloadtcl-72275aed2c38b56ce2a3bbcc29547a2967d2fc2c.zip
tcl-72275aed2c38b56ce2a3bbcc29547a2967d2fc2c.tar.gz
tcl-72275aed2c38b56ce2a3bbcc29547a2967d2fc2c.tar.bz2
Better programming practice, no literal '-1' in source code. Might even be useful for 64bit-sizes branch
<p>add TCL_NOSIZE as internal defined for -1, and use it in a lot of places Ass this function argument should be size_t, not ssize_t (still to be TIPped), something like this will be needed anyway.
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r--unix/tclUnixSock.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 102c620..c6f9d22 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -613,7 +613,7 @@ TcpClose2Proc(
default:
if (interp) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
- "socket close2proc called bidirectionally", -1));
+ "socket close2proc called bidirectionally", TCL_NOSIZE));
}
return TCL_ERROR;
}
@@ -681,7 +681,7 @@ TcpGetOptionProc(
statePtr->status = 0;
}
if (err != 0) {
- Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(err), -1);
+ Tcl_DStringAppend(dsPtr, Tcl_ErrnoMsg(err), TCL_NOSIZE);
}
return TCL_OK;
}
@@ -1397,13 +1397,13 @@ Tcl_OpenTcpServer(
return statePtr->channel;
}
if (interp != NULL) {
- Tcl_Obj *errorObj = Tcl_NewStringObj("couldn't open socket: ", -1);
+ Tcl_Obj *errorObj = Tcl_NewStringObj("couldn't open socket: ", TCL_NOSIZE);
if (errorMsg == NULL) {
errno = my_errno;
- Tcl_AppendToObj(errorObj, Tcl_PosixError(interp), -1);
+ Tcl_AppendToObj(errorObj, Tcl_PosixError(interp), TCL_NOSIZE);
} else {
- Tcl_AppendToObj(errorObj, errorMsg, -1);
+ Tcl_AppendToObj(errorObj, errorMsg, TCL_NOSIZE);
}
Tcl_SetObjResult(interp, errorObj);
}