Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1787fff

Browse files
authored
Merge pull request #6790 from matthew-brett/fix-c90-warning-error
MNT: fix C90 warning -> error in new tkagg code
2 parents 042ebc7 + 1d75cae commit 1787fff

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/_tkagg.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ int load_tkinter_funcs(void)
351351
// From module __file__ attribute to char *string for dlopen.
352352
char *fname2char(PyObject *fname)
353353
{
354-
PyObject *bytes = PyUnicode_EncodeFSDefault(fname);
354+
PyObject* bytes;
355+
bytes = PyUnicode_EncodeFSDefault(fname);
355356
if (bytes == NULL) {
356357
return NULL;
357358
}
@@ -372,9 +373,10 @@ void *_dfunc(void *lib_handle, const char *func_name)
372373
// Set Python exception if we can't find `func_name` in `lib_handle`.
373374
// Returns function pointer or NULL if not present.
374375

376+
void* func;
375377
// Reset errors.
376378
dlerror();
377-
void *func = dlsym(lib_handle, func_name);
379+
func = dlsym(lib_handle, func_name);
378380
if (func == NULL) {
379381
const char *error = dlerror();
380382
PyErr_SetString(PyExc_RuntimeError, error);

0 commit comments

Comments
 (0)