Skip to content

Commit

Permalink
Merge pull request #4618 from radarhere/braces
Browse files Browse the repository at this point in the history
Added braces to C
  • Loading branch information
radarhere committed May 13, 2020
2 parents 79d6569 + 3a75e84 commit 4634eaf
Show file tree
Hide file tree
Showing 76 changed files with 2,585 additions and 1,365 deletions.
11 changes: 7 additions & 4 deletions src/Tk/tkImaging.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ ImagingFind(const char* name)
#else
id = atol(name);
#endif
if (!id)
if (!id) {
return NULL;
}

return (Imaging) id;
}
Expand Down Expand Up @@ -119,10 +120,11 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp* interp,
block.offset[0] = 0;
block.offset[1] = 1;
block.offset[2] = 2;
if (strcmp(im->mode, "RGBA") == 0)
if (strcmp(im->mode, "RGBA") == 0) {
block.offset[3] = 3; /* alpha (or reserved, under 8.2) */
else
} else {
block.offset[3] = 0; /* no alpha */
}
} else {
TCL_APPEND_RESULT(interp, "Bad mode", (char*) NULL);
return TCL_ERROR;
Expand All @@ -136,10 +138,11 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp* interp,
if (TK_LT_85) { /* Tk 8.4 */
TK_PHOTO_PUT_BLOCK_84(photo, &block, 0, 0, block.width, block.height,
TK_PHOTO_COMPOSITE_SET);
if (strcmp(im->mode, "RGBA") == 0)
if (strcmp(im->mode, "RGBA") == 0) {
/* Tk workaround: we need apply ToggleComplexAlphaIfNeeded */
/* (fixed in Tk 8.5a3) */
TK_PHOTO_SET_SIZE_84(photo, block.width, block.height);
}
} else {
/* Tk >=8.5 */
TK_PHOTO_PUT_BLOCK_85(interp, photo, &block, 0, 0, block.width,
Expand Down
Loading

0 comments on commit 4634eaf

Please sign in to comment.