Patch 8.0.1654
Problem:    Warnings for conversion of void to function pointer.
Solution:   Use a temp variable that is a function pointer.
Files:      src/if_python.c, src/if_python3.c


*** ../vim-8.0.1653/src/if_python.c     2018-02-27 17:25:48.016151913 +0100
--- src/if_python.c     2018-03-29 18:08:42.134073927 +0200
***************
*** 672,678 ****
  python_runtime_link_init(char *libname, int verbose)
  {
      int i;
!     void *ucs_as_encoded_string;
  
  #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.
--- 675,682 ----
  python_runtime_link_init(char *libname, int verbose)
  {
      int i;
!     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,724 ****
  
      /* 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,
                                             "PyUnicodeUCS2_AsEncodedString");
!     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
      {
        close_dll(hinstPython);
        hinstPython = 0;
--- 715,726 ----
  
      /* 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,
                                             "PyUnicodeUCS2_AsEncodedString");
!     if (*ucs_as_encoded_string == NULL)
!       *ucs_as_encoded_string = symbol_from_dll(hinstPython,
                                             "PyUnicodeUCS4_AsEncodedString");
!     if (*ucs_as_encoded_string == NULL)
      {
        close_dll(hinstPython);
        hinstPython = 0;
*** ../vim-8.0.1653/src/if_python3.c    2018-03-24 14:06:10.470483816 +0100
--- src/if_python3.c    2018-03-29 18:12:16.243326948 +0200
***************
*** 600,606 ****
  py3_runtime_link_init(char *libname, int verbose)
  {
      int i;
!     void *ucs_from_string, *ucs_decode, *ucs_as_encoded_string;
  
  # if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && 
defined(UNIX) && defined(FEAT_PYTHON)
      /* Can't have Python and Python3 loaded at the same time.
--- 603,612 ----
  py3_runtime_link_init(char *libname, int verbose)
  {
      int i;
!     PYTHON_PROC *ucs_from_string = (PYTHON_PROC *)&py3_PyUnicode_FromString;
!     PYTHON_PROC *ucs_decode = (PYTHON_PROC *)&py3_PyUnicode_Decode;
!     PYTHON_PROC *ucs_as_encoded_string =
!                                (PYTHON_PROC *)&py3_PyUnicode_AsEncodedString;
  
  # if !(defined(PY_NO_RTLD_GLOBAL) && defined(PY3_NO_RTLD_GLOBAL)) && 
defined(UNIX) && defined(FEAT_PYTHON)
      /* Can't have Python and Python3 loaded at the same time.
***************
*** 641,673 ****
      /* Load unicode functions separately as only the ucs2 or the ucs4 
functions
       * will be present in the library. */
  # if PY_VERSION_HEX >= 0x030300f0
!     ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicode_FromString");
!     ucs_decode = symbol_from_dll(hinstPy3, "PyUnicode_Decode");
!     ucs_as_encoded_string = symbol_from_dll(hinstPy3,
            "PyUnicode_AsEncodedString");
  # else
!     ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicodeUCS2_FromString");
!     ucs_decode = symbol_from_dll(hinstPy3,
            "PyUnicodeUCS2_Decode");
!     ucs_as_encoded_string = symbol_from_dll(hinstPy3,
            "PyUnicodeUCS2_AsEncodedString");
!     if (!ucs_from_string || !ucs_decode || !ucs_as_encoded_string)
      {
!       ucs_from_string = symbol_from_dll(hinstPy3,
                "PyUnicodeUCS4_FromString");
!       ucs_decode = symbol_from_dll(hinstPy3,
                "PyUnicodeUCS4_Decode");
!       ucs_as_encoded_string = symbol_from_dll(hinstPy3,
                "PyUnicodeUCS4_AsEncodedString");
      }
  # endif
!     if (ucs_from_string && ucs_decode && ucs_as_encoded_string)
!     {
!       py3_PyUnicode_FromString = ucs_from_string;
!       py3_PyUnicode_Decode = ucs_decode;
!       py3_PyUnicode_AsEncodedString = ucs_as_encoded_string;
!     }
!     else
      {
        close_dll(hinstPy3);
        hinstPy3 = 0;
--- 647,675 ----
      /* Load unicode functions separately as only the ucs2 or the ucs4 
functions
       * will be present in the library. */
  # if PY_VERSION_HEX >= 0x030300f0
!     *ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicode_FromString");
!     *ucs_decode = symbol_from_dll(hinstPy3, "PyUnicode_Decode");
!     *ucs_as_encoded_string = symbol_from_dll(hinstPy3,
            "PyUnicode_AsEncodedString");
  # else
!     *ucs_from_string = symbol_from_dll(hinstPy3, "PyUnicodeUCS2_FromString");
!     *ucs_decode = symbol_from_dll(hinstPy3,
            "PyUnicodeUCS2_Decode");
!     *ucs_as_encoded_string = symbol_from_dll(hinstPy3,
            "PyUnicodeUCS2_AsEncodedString");
!     if (*ucs_from_string == NULL || *ucs_decode == NULL
!                                            || *ucs_as_encoded_string == NULL)
      {
!       *ucs_from_string = symbol_from_dll(hinstPy3,
                "PyUnicodeUCS4_FromString");
!       *ucs_decode = symbol_from_dll(hinstPy3,
                "PyUnicodeUCS4_Decode");
!       *ucs_as_encoded_string = symbol_from_dll(hinstPy3,
                "PyUnicodeUCS4_AsEncodedString");
      }
  # endif
!     if (*ucs_from_string == NULL || *ucs_decode == NULL
!                                            || *ucs_as_encoded_string == NULL)
      {
        close_dll(hinstPy3);
        hinstPy3 = 0;
*** ../vim-8.0.1653/src/version.c       2018-03-29 17:40:42.607415702 +0200
--- src/version.c       2018-03-29 18:13:25.837644271 +0200
***************
*** 764,765 ****
--- 764,767 ----
  {   /* Add new patch number below this line */
+ /**/
+     1654,
  /**/

-- 
>From "know your smileys":
 :-H    Is missing teeth

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui