@@ -68,8 +68,9 @@ ImagingFind(const char* name)
6868#else
6969 id = atol (name );
7070#endif
71- if (!id )
71+ if (!id ) {
7272 return NULL ;
73+ }
7374
7475 return (Imaging ) id ;
7576}
@@ -119,10 +120,11 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp* interp,
119120 block .offset [0 ] = 0 ;
120121 block .offset [1 ] = 1 ;
121122 block .offset [2 ] = 2 ;
122- if (strcmp (im -> mode , "RGBA" ) == 0 )
123+ if (strcmp (im -> mode , "RGBA" ) == 0 ) {
123124 block .offset [3 ] = 3 ; /* alpha (or reserved, under 8.2) */
124- else
125+ } else {
125126 block .offset [3 ] = 0 ; /* no alpha */
127+ }
126128 } else {
127129 TCL_APPEND_RESULT (interp , "Bad mode" , (char * ) NULL );
128130 return TCL_ERROR ;
@@ -136,10 +138,11 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp* interp,
136138 if (TK_LT_85 ) { /* Tk 8.4 */
137139 TK_PHOTO_PUT_BLOCK_84 (photo , & block , 0 , 0 , block .width , block .height ,
138140 TK_PHOTO_COMPOSITE_SET );
139- if (strcmp (im -> mode , "RGBA" ) == 0 )
141+ if (strcmp (im -> mode , "RGBA" ) == 0 ) {
140142 /* Tk workaround: we need apply ToggleComplexAlphaIfNeeded */
141143 /* (fixed in Tk 8.5a3) */
142144 TK_PHOTO_SET_SIZE_84 (photo , block .width , block .height );
145+ }
143146 } else {
144147 /* Tk >=8.5 */
145148 TK_PHOTO_PUT_BLOCK_85 (interp , photo , & block , 0 , 0 , block .width ,
0 commit comments