From 7b24ce08fe99345cac035215fca29c7e174a6456 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 29 Mar 2018 18:15:26 +0200 Subject: patch 8.0.1654: warnings for conversion of void to function pointer Problem: Warnings for conversion of void to function pointer. Solution: Use a temp variable that is a function pointer. --- src/if_python.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/if_python.c') diff --git a/src/if_python.c b/src/if_python.c index 8ba124150..02e2cd79e 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -672,7 +672,8 @@ end_dynamic_python(void) python_runtime_link_init(char *libname, int verbose) { int i; - void *ucs_as_encoded_string; + PYTHON_PROC *ucs_as_encoded_string = + (PYTHON_PROC*)&py_PyUnicode_AsEncodedString; #if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && defined(UNIX) && defined(FEAT_PYTHON3) /* Can't have Python and Python3 loaded at the same time. @@ -711,14 +712,12 @@ python_runtime_link_init(char *libname, int verbose) /* Load unicode functions separately as only the ucs2 or the ucs4 functions * will be present in the library. */ - ucs_as_encoded_string = symbol_from_dll(hinstPython, + *ucs_as_encoded_string = symbol_from_dll(hinstPython, "PyUnicodeUCS2_AsEncodedString"); - if (ucs_as_encoded_string == NULL) - ucs_as_encoded_string = symbol_from_dll(hinstPython, + if (*ucs_as_encoded_string == NULL) + *ucs_as_encoded_string = symbol_from_dll(hinstPython, "PyUnicodeUCS4_AsEncodedString"); - if (ucs_as_encoded_string != NULL) - py_PyUnicode_AsEncodedString = ucs_as_encoded_string; - else + if (*ucs_as_encoded_string == NULL) { close_dll(hinstPython); hinstPython = 0; -- cgit v1.2.1