diff options
author | dkf <dkf@noemail.net> | 2010-03-05 14:34:02 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2010-03-05 14:34:02 (GMT) |
commit | 0beea22f470575ca4033d1d218b40cac85372822 (patch) | |
tree | f2dc6d4861ea238a538f41c4306249dad1ac3ea5 /generic/tclIORTrans.c | |
parent | 5ba7e23db54042b3bb546b0d227da32adcde8a1a (diff) | |
download | tcl-0beea22f470575ca4033d1d218b40cac85372822.zip tcl-0beea22f470575ca4033d1d218b40cac85372822.tar.gz tcl-0beea22f470575ca4033d1d218b40cac85372822.tar.bz2 |
Code Audit results:
* use do { ... } while (0) in macros
* avoid shadowing one local variable with another
* use clearer 'foo.bar++;' instead of '++foo.bar;' where result not
required (i.e., semantically equivalent)
* follow Engineering Manual rules on spacing and declarations
FossilOrigin-Name: 4d8a4f639d28df5b5dfabd407be8efbb44454601
Diffstat (limited to 'generic/tclIORTrans.c')
-rw-r--r-- | generic/tclIORTrans.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/generic/tclIORTrans.c b/generic/tclIORTrans.c index a6e7ed5..dcad087 100644 --- a/generic/tclIORTrans.c +++ b/generic/tclIORTrans.c @@ -15,7 +15,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIORTrans.c,v 1.12 2010/02/24 10:45:04 dkf Exp $ + * RCS: @(#) $Id: tclIORTrans.c,v 1.13 2010/03/05 14:34:04 dkf Exp $ */ #include <tclInt.h> @@ -1058,7 +1058,7 @@ ReflectInput( int *errorCodePtr) { ReflectedTransform *rtPtr = clientData; - int gotBytes, copied, read; + int gotBytes, copied, readBytes; /* * The following check can be done before thread redirection, because we @@ -1124,8 +1124,8 @@ ReflectInput( return gotBytes; } - read = Tcl_ReadRaw(rtPtr->parent, buf, toRead); - if (read < 0) { + readBytes = Tcl_ReadRaw(rtPtr->parent, buf, toRead); + if (readBytes < 0) { /* * Report errors to caller. The state of the seek system is * unchanged! @@ -1144,7 +1144,7 @@ ReflectInput( return -1; } - if (read == 0) { + if (readBytes == 0) { /* * Check wether we hit on EOF in 'parent' or not. If not * differentiate between blocking and non-blocking modes. In @@ -1200,7 +1200,7 @@ ReflectInput( ((Channel *) rtPtr->parent)->state->flags &= ~CHANNEL_EOF; continue; /* at: while (toRead > 0) */ } - } /* read == 0 */ + } /* readBytes == 0 */ /* * Transform the read chunk, which was not empty. Anything we got back @@ -1208,7 +1208,7 @@ ReflectInput( * iteration will put it into the result. */ - if (!TransformRead(rtPtr, errorCodePtr, UCHARP(buf), read)) { + if (!TransformRead(rtPtr, errorCodePtr, UCHARP(buf), readBytes)) { return -1; } } /* while toRead > 0 */ @@ -2656,9 +2656,7 @@ ForwardProc( break; } - case ForwardedLimit: { - Tcl_Obj *resObj; - + case ForwardedLimit: if (InvokeTclMethod(rtPtr, "limit?", NULL, NULL, &resObj) != TCL_OK) { ForwardSetObjError(paramPtr, resObj); paramPtr->limit.max = -1; @@ -2670,7 +2668,6 @@ ForwardProc( Tcl_DecrRefCount(resObj); break; - } default: /* |