Merge pull request #3075 from hugovk/rm-if-0

Remove unnecessary '#if 0' code
This commit is contained in:
Hugo 2018-07-01 07:48:12 +03:00 committed by GitHub
commit 52e3ecb5e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@
* following lines to your Tcl_AppInit function (in tkappinit.c)
* instead. Put them after the calls to Tcl_Init and Tk_Init:
*
* {
* {
* extern void TkImaging_Init(Tcl_Interp* interp);
* TkImaging_Init(interp);
* }
@ -69,7 +69,7 @@ ImagingFind(const char* name)
id = atol(name);
#endif
if (!id)
return NULL;
return NULL;
return (Imaging) id;
}
@ -109,46 +109,29 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp* interp,
return TCL_ERROR;
}
/* Active region */
#if 0
if (src_xoffset + xsize > im->xsize)
xsize = im->xsize - src_xoffset;
if (src_yoffset + ysize > im->ysize)
ysize = im->ysize - src_yoffset;
if (xsize < 0 || ysize < 0
|| src_xoffset >= im->xsize
|| src_yoffset >= im->ysize)
return TCL_OK;
#endif
/* Mode */
if (strcmp(im->mode, "1") == 0 || strcmp(im->mode, "L") == 0) {
block.pixelSize = 1;
block.offset[0] = block.offset[1] = block.offset[2] = 0;
block.pixelSize = 1;
block.offset[0] = block.offset[1] = block.offset[2] = 0;
} else if (strncmp(im->mode, "RGB", 3) == 0) {
block.pixelSize = 4;
block.offset[0] = 0;
block.offset[1] = 1;
block.offset[2] = 2;
block.pixelSize = 4;
block.offset[0] = 0;
block.offset[1] = 1;
block.offset[2] = 2;
if (strcmp(im->mode, "RGBA") == 0)
block.offset[3] = 3; /* alpha (or reserved, under 8.2) */
else
block.offset[3] = 0; /* no alpha */
} else {
TCL_APPEND_RESULT(interp, "Bad mode", (char*) NULL);
return TCL_ERROR;
return TCL_ERROR;
}
block.width = im->xsize;
block.height = im->ysize;
block.pitch = im->linesize;
block.pixelPtr = (unsigned char*) im->block;
#if 0
block.pixelPtr = (unsigned char*) im->block +
src_yoffset * im->linesize +
src_xoffset * im->pixelsize;
#endif
if (TK_LT_85) { /* Tk 8.4 */
TK_PHOTO_PUT_BLOCK_84(photo, &block, 0, 0, block.width, block.height,