Loading ...
Sorry, an error occurred while loading the content.

Patch 7.3.910

Expand Messages
  • Bram Moolenaar
    Patch 7.3.910 Problem: Python code in #ifdef branches with only minor differences. Solution: Merge the #ifdef branches. (ZyX) Files: src/if_py_both.h,
    Message 1 of 1 , Apr 24, 2013
    • 0 Attachment
      Patch 7.3.910
      Problem: Python code in #ifdef branches with only minor differences.
      Solution: Merge the #ifdef branches. (ZyX)
      Files: src/if_py_both.h, src/if_python.c


      *** ../vim-7.3.909/src/if_py_both.h 2013-04-24 13:39:11.000000000 +0200
      --- src/if_py_both.h 2013-04-24 13:42:30.000000000 +0200
      ***************
      *** 2853,2859 ****
      tv->v_type = VAR_FUNC;
      func_ref(tv->vval.v_string);
      }
      - #if PY_MAJOR_VERSION >= 3
      else if (PyBytes_Check(obj))
      {
      char_u *result;
      --- 2853,2858 ----
      ***************
      *** 2873,2902 ****
      PyObject *bytes;
      char_u *result;

      - bytes = PyString_AsBytes(obj);
      - if (bytes == NULL)
      - return -1;
      -
      - if(PyString_AsStringAndSize(bytes, (char **) &result, NULL) == -1)
      - return -1;
      - if (result == NULL)
      - return -1;
      -
      - if (set_string_copy(result, tv) == -1)
      - {
      - Py_XDECREF(bytes);
      - return -1;
      - }
      - Py_XDECREF(bytes);
      -
      - tv->v_type = VAR_STRING;
      - }
      - #else
      - else if (PyUnicode_Check(obj))
      - {
      - PyObject *bytes;
      - char_u *result;
      -
      bytes = PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL);
      if (bytes == NULL)
      return -1;
      --- 2872,2877 ----
      ***************
      *** 2915,2934 ****

      tv->v_type = VAR_STRING;
      }
      ! else if (PyString_Check(obj))
      ! {
      ! char_u *result;
      !
      ! if(PyString_AsStringAndSize(obj, (char **) &result, NULL) == -1)
      ! return -1;
      ! if (result == NULL)
      ! return -1;
      !
      ! if (set_string_copy(result, tv) == -1)
      ! return -1;
      !
      ! tv->v_type = VAR_STRING;
      ! }
      else if (PyInt_Check(obj))
      {
      tv->v_type = VAR_NUMBER;
      --- 2890,2896 ----

      tv->v_type = VAR_STRING;
      }
      ! #if PY_MAJOR_VERSION < 3
      else if (PyInt_Check(obj))
      {
      tv->v_type = VAR_NUMBER;
      *** ../vim-7.3.909/src/if_python.c 2013-04-24 13:39:11.000000000 +0200
      --- src/if_python.c 2013-04-24 13:42:30.000000000 +0200
      ***************
      *** 59,64 ****
      --- 59,65 ----
      static void init_structs(void);

      #define PyBytes_FromString PyString_FromString
      + #define PyBytes_Check PyString_Check

      /* No-op conversion functions, use with care! */
      #define PyString_AsBytes(obj) (obj)
      *** ../vim-7.3.909/src/version.c 2013-04-24 13:39:11.000000000 +0200
      --- src/version.c 2013-04-24 13:43:51.000000000 +0200
      ***************
      *** 730,731 ****
      --- 730,733 ----
      { /* Add new patch number below this line */
      + /**/
      + 910,
      /**/

      --
      Your fault: core dumped

      /// Bram Moolenaar -- Bram@... -- 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 vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    Your message has been successfully submitted and would be delivered to recipients shortly.