summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPNG.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-20 10:41:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2019-12-20 10:41:43 (GMT)
commit2f89fa96c29e874b87523d628df15c62984dd9b7 (patch)
tree512c62f76a0e9be490f422d8aa6f866cd1c0c5c3 /generic/tkImgPNG.c
parent22f8312f1177e98133c31e059d6f1ae948178f37 (diff)
downloadtk-2f89fa96c29e874b87523d628df15c62984dd9b7.zip
tk-2f89fa96c29e874b87523d628df15c62984dd9b7.tar.gz
tk-2f89fa96c29e874b87523d628df15c62984dd9b7.tar.bz2
Much more WIP: Appears to be working on UNIX, and for a bit part on Windows too.
Diffstat (limited to 'generic/tkImgPNG.c')
-rw-r--r--generic/tkImgPNG.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index 3331d3d..0c62b58 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -2237,14 +2237,14 @@ ApplyAlpha(
PNGImage *pngPtr)
{
if (pngPtr->alpha != 1.0) {
- register unsigned char *p = pngPtr->block.pixelPtr;
+ unsigned char *p = pngPtr->block.pixelPtr;
unsigned char *endPtr = p + pngPtr->blockLen;
int offset = pngPtr->block.offset[3];
p += offset;
if (16 == pngPtr->bitDepth) {
- register unsigned int channel;
+ unsigned int channel;
while (p < endPtr) {
channel = (unsigned int)
@@ -2520,7 +2520,7 @@ DecodePNG(
pngPtr->thisLineObj = Tcl_NewObj();
Tcl_IncrRefCount(pngPtr->thisLineObj);
- pngPtr->block.pixelPtr = attemptckalloc(pngPtr->blockLen);
+ pngPtr->block.pixelPtr = (unsigned char *)attemptckalloc(pngPtr->blockLen);
if (!pngPtr->block.pixelPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"memory allocation failed", -1));
@@ -2676,6 +2676,8 @@ FileMatchPNG(
{
PNGImage png;
int match = 0;
+ (void)fileName;
+ (void)fmtObj;
InitPNGImage(NULL, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE);
@@ -2725,6 +2727,11 @@ FileReadPNG(
{
PNGImage png;
int result = TCL_ERROR;
+ (void)fileName;
+ (void)width;
+ (void)height;
+ (void)srcX;
+ (void)srcY;
result = InitPNGImage(interp, &png, chan, NULL, TCL_ZLIB_STREAM_INFLATE);
@@ -2764,6 +2771,7 @@ StringMatchPNG(
{
PNGImage png;
int match = 0;
+ (void)fmtObj;
InitPNGImage(NULL, &png, NULL, pObjData, TCL_ZLIB_STREAM_INFLATE);
@@ -2812,6 +2820,10 @@ StringReadPNG(
{
PNGImage png;
int result = TCL_ERROR;
+ (void)width;
+ (void)height;
+ (void)srcX;
+ (void)srcY;
result = InitPNGImage(interp, &png, NULL, pObjData,
TCL_ZLIB_STREAM_INFLATE);
@@ -3459,6 +3471,7 @@ FileWritePNG(
Tcl_Channel chan;
PNGImage png;
int result = TCL_ERROR;
+ (void)fmtObj;
/*
* Open a Tcl file channel where the image data will be stored. Tk ought
@@ -3529,6 +3542,7 @@ StringWritePNG(
Tcl_Obj *resultObj = Tcl_NewObj();
PNGImage png;
int result = TCL_ERROR;
+ (void)fmtObj;
/*
* Initalize PNGImage instance for encoding.