summaryrefslogtreecommitdiffstats
path: root/generic/tclIORTrans.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclIORTrans.c')
-rw-r--r--generic/tclIORTrans.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c
index 678fcc1..3769533 100644
--- a/generic/tclIORTrans.c
+++ b/generic/tclIORTrans.c
@@ -89,8 +89,8 @@ static const Tcl_ChannelType tclRTransformType = {
typedef struct {
unsigned char *buf; /* Reference to the buffer area. */
- int allocated; /* Allocated size of the buffer area. */
- int used; /* Number of bytes in the buffer,
+ size_t allocated; /* Allocated size of the buffer area. */
+ size_t used; /* Number of bytes in the buffer,
* <= allocated. */
} ResultBuffer;
@@ -270,7 +270,7 @@ struct ForwardParamTransform {
ForwardParamBase base; /* "Supertype". MUST COME FIRST. */
char *buf; /* I: Bytes to transform,
* O: Bytes in transform result */
- int size; /* I: #bytes to transform,
+ size_t size; /* I: #bytes to transform,
* O: #bytes in the transform result */
};
struct ForwardParamLimit {
@@ -620,7 +620,7 @@ TclChanPushObjCmd(
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
"chan handler \"%s initialize\" returned %s",
TclGetString(cmdObj),
- Tcl_GetString(Tcl_GetObjResult(interp))));
+ Tcl_GetStringResult(interp)));
Tcl_DecrRefCount(resObj);
goto error;
}
@@ -1014,7 +1014,7 @@ ReflectClose(
if (!rtPtr->dead) {
rtmPtr = GetReflectedTransformMap(rtPtr->interp);
- hPtr = Tcl_FindHashEntry(&rtmPtr->map, Tcl_GetString(rtPtr->handle));
+ hPtr = Tcl_FindHashEntry(&rtmPtr->map, TclGetString(rtPtr->handle));
if (hPtr) {
Tcl_DeleteHashEntry(hPtr);
}
@@ -2041,7 +2041,7 @@ InvokeTclMethod(
*/
if (result != TCL_ERROR) {
Tcl_Obj *cmd = Tcl_NewListObj(cmdc, rtPtr->argv);
- int cmdLen;
+ size_t cmdLen;
const char *cmdString = TclGetStringFromObj(cmd, &cmdLen);
Tcl_IncrRefCount(cmd);
@@ -2590,7 +2590,7 @@ ForwardProc(
if (InvokeTclMethod(rtPtr, "read", bufObj, NULL, &resObj) != TCL_OK) {
ForwardSetObjError(paramPtr, resObj);
- paramPtr->transform.size = -1;
+ paramPtr->transform.size = TCL_AUTO_LENGTH;
} else {
/*
* Process a regular return. Contains the transformation result.
@@ -2624,7 +2624,7 @@ ForwardProc(
if (InvokeTclMethod(rtPtr, "write", bufObj, NULL, &resObj) != TCL_OK) {
ForwardSetObjError(paramPtr, resObj);
- paramPtr->transform.size = -1;
+ paramPtr->transform.size = TCL_AUTO_LENGTH;
} else {
/*
* Process a regular return. Contains the transformation result.
@@ -2654,7 +2654,7 @@ ForwardProc(
case ForwardedDrain:
if (InvokeTclMethod(rtPtr, "drain", NULL, NULL, &resObj) != TCL_OK) {
ForwardSetObjError(paramPtr, resObj);
- paramPtr->transform.size = -1;
+ paramPtr->transform.size = TCL_AUTO_LENGTH;
} else {
/*
* Process a regular return. Contains the transformation result.
@@ -2680,7 +2680,7 @@ ForwardProc(
case ForwardedFlush:
if (InvokeTclMethod(rtPtr, "flush", NULL, NULL, &resObj) != TCL_OK) {
ForwardSetObjError(paramPtr, resObj);
- paramPtr->transform.size = -1;
+ paramPtr->transform.size = TCL_AUTO_LENGTH;
} else {
/*
* Process a regular return. Contains the transformation result.
@@ -3037,7 +3037,7 @@ ResultCopy(
*/
copied = 0;
- } else if (rPtr->used == toRead) {
+ } else if (rPtr->used == (size_t)toRead) {
/*
* We have just enough. Copy everything to the caller.
*/
@@ -3045,7 +3045,7 @@ ResultCopy(
memcpy(buf, rPtr->buf, toRead);
rPtr->used = 0;
copied = toRead;
- } else if (rPtr->used > toRead) {
+ } else if (rPtr->used > (size_t)toRead) {
/*
* The internal buffer contains more than requested. Copy the
* requested subset to the caller, and shift the remaining bytes down.