diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-12 17:45:37 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-12 17:45:37 (GMT) |
commit | e0b895874d5fa39f6d4134b407e930b80ee3ecd7 (patch) | |
tree | 08a6b50f74f697e9ebc1f689f06d7318c0aa83a2 /generic/tkImgPPM.c | |
parent | 77d7867fd5b20233f0fa9163bd8a44d2ac274b0e (diff) | |
download | tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.zip tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.tar.gz tk-e0b895874d5fa39f6d4134b407e930b80ee3ecd7.tar.bz2 |
Remove casts from uses of ckalloc/ckfree/... now that Tcl declares them to be
using useful casts internally.
Diffstat (limited to 'generic/tkImgPPM.c')
-rw-r--r-- | generic/tkImgPPM.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c index 88f0858..71f4481 100644 --- a/generic/tkImgPPM.c +++ b/generic/tkImgPPM.c @@ -210,7 +210,7 @@ FileReadPPM( nLines = 1; } nBytes = nLines * block.pitch; - pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes); + pixelPtr = ckalloc(nBytes); block.pixelPtr = pixelPtr + srcX * block.pixelSize; for (h = height; h > 0; h -= nLines) { @@ -224,7 +224,7 @@ FileReadPPM( fileName, "\": ", Tcl_Eof(chan) ? "not enough data" : Tcl_PosixError(interp), NULL); - ckfree((char *) pixelPtr); + ckfree(pixelPtr); return TCL_ERROR; } if (maxIntensity != 255) { @@ -237,13 +237,13 @@ FileReadPPM( block.height = nLines; if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY, width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) { - ckfree((char *) pixelPtr); + ckfree(pixelPtr); return TCL_ERROR; } destY += nLines; } - ckfree((char *) pixelPtr); + ckfree(pixelPtr); return TCL_OK; } @@ -562,7 +562,7 @@ StringReadPPM( nLines = 1; } nBytes = nLines * block.pitch; - pixelPtr = (unsigned char *) ckalloc((unsigned) nBytes); + pixelPtr = ckalloc(nBytes); block.pixelPtr = pixelPtr + srcX * block.pixelSize; for (h = height; h > 0; h -= nLines) { @@ -573,7 +573,7 @@ StringReadPPM( nBytes = nLines * block.pitch; } if (dataSize < nBytes) { - ckfree((char *) pixelPtr); + ckfree(pixelPtr); Tcl_AppendResult(interp, "truncated PPM data", NULL); return TCL_ERROR; } @@ -584,13 +584,13 @@ StringReadPPM( block.height = nLines; if (Tk_PhotoPutBlock(interp, imageHandle, &block, destX, destY, width, nLines, TK_PHOTO_COMPOSITE_SET) != TCL_OK) { - ckfree((char *) pixelPtr); + ckfree(pixelPtr); return TCL_ERROR; } destY += nLines; } - ckfree((char *) pixelPtr); + ckfree(pixelPtr); return TCL_OK; } |