summaryrefslogtreecommitdiffstats
path: root/generic/tclIOCmd.c
diff options
context:
space:
mode:
authorgriffin <briang42@easystreet.net>2023-03-25 00:29:59 (GMT)
committergriffin <briang42@easystreet.net>2023-03-25 00:29:59 (GMT)
commit879e7b7112b429b14e6c6bb70873c4fe41d59e1c (patch)
tree8afefec0015395ec4eceda2146ca978b63782cb3 /generic/tclIOCmd.c
parentef7bbf24e8812d54b66b071036a2ff875ccb98d6 (diff)
parentb0a23df7d6a04013d6ee706f7c7a7f12b6d5b3ef (diff)
downloadtcl-879e7b7112b429b14e6c6bb70873c4fe41d59e1c.zip
tcl-879e7b7112b429b14e6c6bb70873c4fe41d59e1c.tar.gz
tcl-879e7b7112b429b14e6c6bb70873c4fe41d59e1c.tar.bz2
Merge trunk
Diffstat (limited to 'generic/tclIOCmd.c')
-rw-r--r--generic/tclIOCmd.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/generic/tclIOCmd.c b/generic/tclIOCmd.c
index 4ce27bb..cdb8083 100644
--- a/generic/tclIOCmd.c
+++ b/generic/tclIOCmd.c
@@ -10,6 +10,7 @@
*/
#include "tclInt.h"
+#include "tclTomMath.h"
/*
* Callback structure for accept callback in a TCP server.
@@ -44,7 +45,7 @@ static void RegisterTcpServerInterpCleanup(
Tcl_Interp *interp,
AcceptCallback *acceptCallbackPtr);
static Tcl_InterpDeleteProc TcpAcceptCallbacksDeleteProc;
-static void TcpServerCloseProc(ClientData callbackData);
+static void TcpServerCloseProc(void *callbackData);
static void UnregisterTcpServerInterpCleanupProc(
Tcl_Interp *interp,
AcceptCallback *acceptCallbackPtr);
@@ -106,7 +107,7 @@ Tcl_PutsObjCmd(
Tcl_Obj *string; /* String to write. */
Tcl_Obj *chanObjPtr = NULL; /* channel object. */
int newline; /* Add a newline at end? */
- int result; /* Result of puts operation. */
+ size_t result; /* Result of puts operation. */
int mode; /* Mode in which channel is opened. */
switch (objc) {
@@ -163,12 +164,12 @@ Tcl_PutsObjCmd(
TclChannelPreserve(chan);
result = Tcl_WriteObj(chan, string);
- if (result == -1) {
+ if (result == TCL_INDEX_NONE) {
goto error;
}
if (newline != 0) {
result = Tcl_WriteChars(chan, "\n", 1);
- if (result == -1) {
+ if (result == TCL_INDEX_NONE) {
goto error;
}
}
@@ -330,7 +331,9 @@ Tcl_GetsObjCmd(
code = TCL_ERROR;
goto done;
}
- Tcl_SetObjResult(interp, Tcl_NewWideIntObj((Tcl_WideInt)((Tcl_WideUInt)(lineLen + 1U)) - 1));
+ Tcl_Obj *lineLenObj;
+ TclNewIndexObj(lineLenObj, lineLen);
+ Tcl_SetObjResult(interp, lineLenObj);
} else {
Tcl_SetObjResult(interp, linePtr);
}
@@ -1080,7 +1083,7 @@ Tcl_OpenObjCmd(
if (objc == 4) {
const char *permString = TclGetString(objv[3]);
int code = TCL_ERROR;
- int scanned = TclParseAllWhiteSpace(permString, -1);
+ int scanned = TclParseAllWhiteSpace(permString, TCL_INDEX_NONE);
/*
* Support legacy octal numbers.
@@ -1183,7 +1186,7 @@ Tcl_OpenObjCmd(
static void
TcpAcceptCallbacksDeleteProc(
- ClientData clientData, /* Data which was passed when the assocdata
+ void *clientData, /* Data which was passed when the assocdata
* was registered. */
TCL_UNUSED(Tcl_Interp *))
{
@@ -1311,7 +1314,7 @@ UnregisterTcpServerInterpCleanupProc(
static void
AcceptCallbackProc(
- ClientData callbackData, /* The data stored when the callback was
+ void *callbackData, /* The data stored when the callback was
* created in the call to
* Tcl_OpenTcpServer. */
Tcl_Channel chan, /* Channel for the newly accepted
@@ -1402,7 +1405,7 @@ AcceptCallbackProc(
static void
TcpServerCloseProc(
- ClientData callbackData) /* The data passed in the call to
+ void *callbackData) /* The data passed in the call to
* Tcl_CreateCloseHandler. */
{
AcceptCallback *acceptCallbackPtr = (AcceptCallback *)callbackData;