@@ -58,8 +58,7 @@ static Tk_PhotoSetSize_84_t TK_PHOTO_SET_SIZE_84;
5858static Tk_PhotoPutBlock_85_t TK_PHOTO_PUT_BLOCK_85 ;
5959
6060static Imaging
61- ImagingFind (const char * name )
62- {
61+ ImagingFind (const char * name ) {
6362 Py_ssize_t id ;
6463
6564 /* FIXME: use CObject instead? */
@@ -77,8 +76,7 @@ ImagingFind(const char *name)
7776
7877static int
7978PyImagingPhotoPut (ClientData clientdata , Tcl_Interp * interp , int argc ,
80- const char * * argv )
81- {
79+ const char * * argv ) {
8280 Imaging im ;
8381 Tk_PhotoHandle photo ;
8482 Tk_PhotoImageBlock block ;
@@ -112,20 +110,17 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp *interp, int argc,
112110 if (strcmp (im -> mode , "1" ) == 0 || strcmp (im -> mode , "L" ) == 0 ) {
113111 block .pixelSize = 1 ;
114112 block .offset [0 ] = block .offset [1 ] = block .offset [2 ] = 0 ;
115- }
116- else if (strncmp (im -> mode , "RGB" , 3 ) == 0 ) {
113+ } else if (strncmp (im -> mode , "RGB" , 3 ) == 0 ) {
117114 block .pixelSize = 4 ;
118115 block .offset [0 ] = 0 ;
119116 block .offset [1 ] = 1 ;
120117 block .offset [2 ] = 2 ;
121118 if (strcmp (im -> mode , "RGBA" ) == 0 ) {
122119 block .offset [3 ] = 3 ; /* alpha (or reserved, under 8.2) */
123- }
124- else {
120+ } else {
125121 block .offset [3 ] = 0 ; /* no alpha */
126122 }
127- }
128- else {
123+ } else {
129124 TCL_APPEND_RESULT (interp , "Bad mode" , (char * )NULL );
130125 return TCL_ERROR ;
131126 }
@@ -143,8 +138,7 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp *interp, int argc,
143138 /* (fixed in Tk 8.5a3) */
144139 TK_PHOTO_SET_SIZE_84 (photo , block .width , block .height );
145140 }
146- }
147- else {
141+ } else {
148142 /* Tk >=8.5 */
149143 TK_PHOTO_PUT_BLOCK_85 (interp , photo , & block , 0 , 0 , block .width , block .height ,
150144 TK_PHOTO_COMPOSITE_SET );
@@ -155,8 +149,7 @@ PyImagingPhotoPut(ClientData clientdata, Tcl_Interp *interp, int argc,
155149
156150static int
157151PyImagingPhotoGet (ClientData clientdata , Tcl_Interp * interp , int argc ,
158- const char * * argv )
159- {
152+ const char * * argv ) {
160153 Imaging im ;
161154 Tk_PhotoHandle photo ;
162155 Tk_PhotoImageBlock block ;
@@ -198,8 +191,7 @@ PyImagingPhotoGet(ClientData clientdata, Tcl_Interp *interp, int argc,
198191}
199192
200193void
201- TkImaging_Init (Tcl_Interp * interp )
202- {
194+ TkImaging_Init (Tcl_Interp * interp ) {
203195 TCL_CREATE_COMMAND (interp , "PyImagingPhoto" , PyImagingPhotoPut , (ClientData )0 ,
204196 (Tcl_CmdDeleteProc * )NULL );
205197 TCL_CREATE_COMMAND (interp , "PyImagingPhotoGet" , PyImagingPhotoGet , (ClientData )0 ,
@@ -229,8 +221,7 @@ TkImaging_Init(Tcl_Interp *interp)
229221#define TKINTER_PKG "tkinter"
230222
231223FARPROC
232- _dfunc (HMODULE lib_handle , const char * func_name )
233- {
224+ _dfunc (HMODULE lib_handle , const char * func_name ) {
234225 /*
235226 * Load function `func_name` from `lib_handle`.
236227 * Set Python exception if we can't find `func_name` in `lib_handle`.
@@ -248,8 +239,7 @@ _dfunc(HMODULE lib_handle, const char *func_name)
248239}
249240
250241int
251- get_tcl (HMODULE hMod )
252- {
242+ get_tcl (HMODULE hMod ) {
253243 /*
254244 * Try to fill Tcl global vars with function pointers. Return 0 for no
255245 * functions found, 1 for all functions found, -1 for some but not all
@@ -267,8 +257,7 @@ get_tcl(HMODULE hMod)
267257}
268258
269259int
270- get_tk (HMODULE hMod )
271- {
260+ get_tk (HMODULE hMod ) {
272261 /*
273262 * Try to fill Tk global vars with function pointers. Return 0 for no
274263 * functions found, 1 for all functions found, -1 for some but not all
@@ -300,8 +289,7 @@ get_tk(HMODULE hMod)
300289}
301290
302291int
303- load_tkinter_funcs (void )
304- {
292+ load_tkinter_funcs (void ) {
305293 /*
306294 * Load Tcl and Tk functions by searching all modules in current process.
307295 * Return 0 for success, non-zero for failure.
@@ -347,8 +335,7 @@ load_tkinter_funcs(void)
347335
348336 if (found_tcl == 0 ) {
349337 PyErr_SetString (PyExc_RuntimeError , "Could not find Tcl routines" );
350- }
351- else {
338+ } else {
352339 PyErr_SetString (PyExc_RuntimeError , "Could not find Tk routines" );
353340 }
354341 return 1 ;
@@ -364,8 +351,7 @@ load_tkinter_funcs(void)
364351
365352/* From module __file__ attribute to char *string for dlopen. */
366353char *
367- fname2char (PyObject * fname )
368- {
354+ fname2char (PyObject * fname ) {
369355 PyObject * bytes ;
370356 bytes = PyUnicode_EncodeFSDefault (fname );
371357 if (bytes == NULL ) {
@@ -377,8 +363,7 @@ fname2char(PyObject *fname)
377363#include <dlfcn.h>
378364
379365void *
380- _dfunc (void * lib_handle , const char * func_name )
381- {
366+ _dfunc (void * lib_handle , const char * func_name ) {
382367 /*
383368 * Load function `func_name` from `lib_handle`.
384369 * Set Python exception if we can't find `func_name` in `lib_handle`.
@@ -397,8 +382,7 @@ _dfunc(void *lib_handle, const char *func_name)
397382}
398383
399384int
400- _func_loader (void * lib )
401- {
385+ _func_loader (void * lib ) {
402386 /*
403387 * Fill global function pointers from dynamic lib.
404388 * Return 1 if any pointer is NULL, 0 otherwise.
@@ -432,8 +416,7 @@ _func_loader(void *lib)
432416}
433417
434418int
435- load_tkinter_funcs (void )
436- {
419+ load_tkinter_funcs (void ) {
437420 /*
438421 * Load tkinter global funcs from tkinter compiled module.
439422 * Return 0 for success, non-zero for failure.
0 commit comments