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

Patch 7.4.153

Expand Messages
  • Bram Moolenaar
    Patch 7.4.153 Problem: Compiler warning for pointer type. Solution: Add type cast. Files: src/if_py_both.h, src/if_python.c, src/if_python3.c ...
    Message 1 of 6 , Jan 14, 2014
    • 0 Attachment
      Patch 7.4.153
      Problem: Compiler warning for pointer type.
      Solution: Add type cast.
      Files: src/if_py_both.h, src/if_python.c, src/if_python3.c


      *** ../vim-7.4.152/src/if_py_both.h 2014-01-14 16:54:53.000000000 +0100
      --- src/if_py_both.h 2014-01-14 18:54:47.000000000 +0100
      ***************
      *** 2326,2332 ****
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx(idx, ListLength(self),
      &start, &stop, &step, &slicelen) < 0)
      return NULL;
      return ListSlice(self, start, step, slicelen);
      --- 2326,2332 ----
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
      &start, &stop, &step, &slicelen) < 0)
      return NULL;
      return ListSlice(self, start, step, slicelen);
      ***************
      *** 2616,2622 ****
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx(idx, ListLength(self),
      &start, &stop, &step, &slicelen) < 0)
      return -1;
      return ListAssSlice(self, start, step, slicelen,
      --- 2616,2622 ----
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
      &start, &stop, &step, &slicelen) < 0)
      return -1;
      return ListAssSlice(self, start, step, slicelen,
      *** ../vim-7.4.152/src/if_python.c 2014-01-14 16:36:40.000000000 +0100
      --- src/if_python.c 2014-01-14 18:56:41.000000000 +0100
      ***************
      *** 343,349 ****
      static PyInt(*dll_PyTuple_Size)(PyObject *);
      static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt);
      static PyTypeObject* dll_PyTuple_Type;
      ! static int (*dll_PySlice_GetIndicesEx)(PyObject *r, PyInt length,
      PyInt *start, PyInt *stop, PyInt *step,
      PyInt *slicelen);
      static PyObject*(*dll_PyImport_ImportModule)(const char *);
      --- 343,349 ----
      static PyInt(*dll_PyTuple_Size)(PyObject *);
      static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt);
      static PyTypeObject* dll_PyTuple_Type;
      ! static int (*dll_PySlice_GetIndicesEx)(PySliceObject *r, PyInt length,
      PyInt *start, PyInt *stop, PyInt *step,
      PyInt *slicelen);
      static PyObject*(*dll_PyImport_ImportModule)(const char *);
      *** ../vim-7.4.152/src/if_python3.c 2014-01-14 16:36:40.000000000 +0100
      --- src/if_python3.c 2014-01-14 18:58:19.000000000 +0100
      ***************
      *** 294,300 ****
      static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
      static int (*py3_PyMapping_Check)(PyObject *);
      static PyObject* (*py3_PyMapping_Keys)(PyObject *);
      ! static int (*py3_PySlice_GetIndicesEx)(PyObject *r, Py_ssize_t length,
      Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
      Py_ssize_t *slicelen);
      static PyObject* (*py3_PyErr_NoMemory)(void);
      --- 294,300 ----
      static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t);
      static int (*py3_PyMapping_Check)(PyObject *);
      static PyObject* (*py3_PyMapping_Keys)(PyObject *);
      ! static int (*py3_PySlice_GetIndicesEx)(PySliceObject *r, Py_ssize_t length,
      Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step,
      Py_ssize_t *slicelen);
      static PyObject* (*py3_PyErr_NoMemory)(void);
      ***************
      *** 1190,1196 ****
      if (CheckBuffer((BufferObject *) self))
      return NULL;

      ! if (PySlice_GetIndicesEx((PyObject *)idx,
      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
      &start, &stop,
      &step, &slicelen) < 0)
      --- 1190,1196 ----
      if (CheckBuffer((BufferObject *) self))
      return NULL;

      ! if (PySlice_GetIndicesEx((PySliceObject *)idx,
      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
      &start, &stop,
      &step, &slicelen) < 0)
      ***************
      *** 1222,1228 ****
      if (CheckBuffer((BufferObject *) self))
      return -1;

      ! if (PySlice_GetIndicesEx((PyObject *)idx,
      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
      &start, &stop,
      &step, &slicelen) < 0)
      --- 1222,1228 ----
      if (CheckBuffer((BufferObject *) self))
      return -1;

      ! if (PySlice_GetIndicesEx((PySliceObject *)idx,
      (Py_ssize_t)((BufferObject *)(self))->buf->b_ml.ml_line_count,
      &start, &stop,
      &step, &slicelen) < 0)
      ***************
      *** 1306,1312 ****
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx((PyObject *)idx,
      ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
      &start, &stop,
      &step, &slicelen) < 0)
      --- 1306,1312 ----
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx((PySliceObject *)idx,
      ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
      &start, &stop,
      &step, &slicelen) < 0)
      ***************
      *** 1333,1339 ****
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx((PyObject *)idx,
      ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
      &start, &stop,
      &step, &slicelen) < 0)
      --- 1333,1339 ----
      {
      Py_ssize_t start, stop, step, slicelen;

      ! if (PySlice_GetIndicesEx((PySliceObject *)idx,
      ((RangeObject *)(self))->end-((RangeObject *)(self))->start+1,
      &start, &stop,
      &step, &slicelen) < 0)
      *** ../vim-7.4.152/src/version.c 2014-01-14 16:54:53.000000000 +0100
      --- src/version.c 2014-01-14 18:54:01.000000000 +0100
      ***************
      *** 740,741 ****
      --- 740,743 ----
      { /* Add new patch number below this line */
      + /**/
      + 153,
      /**/

      --
      hundred-and-one symptoms of being an internet addict:
      161. You get up before the sun rises to check your e-mail, and you
      find yourself in the very same chair long after the sun has set.

      /// 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.
    • Tony Mechelynck
      ... I get the following warnings when compiling Vim 7.4.155 (Huge, +python ... nclude/atk-1.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/cairo
      Message 2 of 6 , Jan 14, 2014
      • 0 Attachment
        On 14/01/14 19:36, Bram Moolenaar wrote:
        >
        > Patch 7.4.153
        > Problem: Compiler warning for pointer type.
        > Solution: Add type cast.
        > Files: src/if_py_both.h, src/if_python.c, src/if_python3.c
        >

        I get the following warnings when compiling Vim 7.4.155 (Huge, +python
        -python3) (7.4.153 to 155 were applied together):

        > gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/i
        nclude/atk-1.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng14 -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/usr/include -D_LARGEFILE64_SOURCE=1 -I/usr/include/python2.7 -DPYTHON_HOME='"/usr"' -pthread -fPIE -o objects/if_python.o if_python.c
        > In file included from if_python.c:809:0:
        > if_py_both.h: In function ‘_DictionaryItem’:
        > if_py_both.h:1625:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
        > if_py_both.h: In function ‘ListAssSlice’:
        > if_py_both.h:2510:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
        > if_py_both.h:2523:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
        > if_py_both.h:2523:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_ssize_t’ [-Wformat]
        > if_py_both.h: In function ‘ListAssItem’:
        > if_py_both.h:2542:21: warning: ‘lis’ may be used uninitialized in this function [-Wmaybe-uninitialized]
        > if_py_both.h:2376:18: note: ‘lis’ was declared here

        An executable is produced.


        Best regards,
        Tony.
        --
        Godwin's Law (prov. [Usenet]):
        As a Usenet discussion grows longer, the probability of a
        comparison involving Nazis or Hitler approaches one." There is a
        tradition in many groups that, once this occurs, that thread is
        over, and whoever mentioned the Nazis has automatically lost
        whatever argument was in progress. Godwin's Law thus guarantees
        the existence of an upper bound on thread length in those groups.

        --
        --
        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.
      • Bram Moolenaar
        ... Thanks, I ll put it in the todo list. -- hundred-and-one symptoms of being an internet addict: 165. You have a web page burned into your glasses /// Bram
        Message 3 of 6 , Jan 15, 2014
        • 0 Attachment
          Tony Mechelynck wrote:

          > On 14/01/14 19:36, Bram Moolenaar wrote:
          > >
          > > Patch 7.4.153
          > > Problem: Compiler warning for pointer type.
          > > Solution: Add type cast.
          > > Files: src/if_py_both.h, src/if_python.c, src/if_python3.c
          > >
          >
          > I get the following warnings when compiling Vim 7.4.155 (Huge, +python
          > -python3) (7.4.153 to 155 were applied together):
          >
          > > gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng14 -pthread -DORBIT2=1 -D_REENTRANT -I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/i
          > nclude/atk-1.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libpng14 -O2 -fno-strength-reduce -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -I/usr/include -D_LARGEFILE64_SOURCE=1 -I/usr/include/python2.7 -DPYTHON_HOME='"/usr"' -pthread -fPIE -o objects/if_python.o if_python.c
          > > In file included from if_python.c:809:0:
          > > if_py_both.h: In function ‘_DictionaryItem’:
          > > if_py_both.h:1625:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
          > > if_py_both.h: In function ‘ListAssSlice’:
          > > if_py_both.h:2510:6: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
          > > if_py_both.h:2523:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat]
          > > if_py_both.h:2523:2: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘Py_ssize_t’ [-Wformat]
          > > if_py_both.h: In function ‘ListAssItem’:
          > > if_py_both.h:2542:21: warning: ‘lis’ may be used uninitialized in this function [-Wmaybe-uninitialized]
          > > if_py_both.h:2376:18: note: ‘lis’ was declared here
          >
          > An executable is produced.

          Thanks, I'll put it in the todo list.

          --
          hundred-and-one symptoms of being an internet addict:
          165. You have a web page burned into your glasses

          /// 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.
        • Ken Takata
          Hi, I had a report from nakinor that compiler warnings occur after 7.4.153. E.g.: In file included from if_python3.c:773: ./if_py_both.h:2331:27: warning:
          Message 4 of 6 , Mar 29, 2014
          • 0 Attachment
            Hi,

            I had a report from nakinor that compiler warnings occur after 7.4.153.

            E.g.:

            In file included from if_python3.c:773:
            ./if_py_both.h:2331:27: warning: incompatible pointer types passing
            'PySliceObject *' to parameter of type 'PyObject *'
            (aka 'struct _object *') [-Wincompatible-pointer-types]
            if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
            ^~~~~~~~~~~~~~~~~~~~
            /usr/local/include/python3.4m/sliceobject.h:43:48: note: passing argument to
            parameter 'r' here
            PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
            ...

            They occur when Vim is statically linked with Python 3.2 or later.
            The type of the first argument of PySlice_GetIndicesEx was changed in
            Python 3.2 from PySliceObject to PyObject.

            He and I made a patch for this:
            https://gist.github.com/nakinor/9780409

            Regards,
            Ken Takata

            --
            --
            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/d/optout.
          • Bram Moolenaar
            ... This doesn t work, because PySliceObject_T is used in if_python3.c before including if_py_both.h. I ll move the #if to if_python3.c to make it work. --
            Message 5 of 6 , Mar 30, 2014
            • 0 Attachment
              Ken Takata wrote:

              > I had a report from nakinor that compiler warnings occur after 7.4.153.
              >
              > E.g.:
              >
              > In file included from if_python3.c:773:
              > ./if_py_both.h:2331:27: warning: incompatible pointer types passing
              > 'PySliceObject *' to parameter of type 'PyObject *'
              > (aka 'struct _object *') [-Wincompatible-pointer-types]
              > if (PySlice_GetIndicesEx((PySliceObject *)idx, ListLength(self),
              > ^~~~~~~~~~~~~~~~~~~~
              > /usr/local/include/python3.4m/sliceobject.h:43:48: note: passing argument to
              > parameter 'r' here
              > PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
              > ...
              >
              > They occur when Vim is statically linked with Python 3.2 or later.
              > The type of the first argument of PySlice_GetIndicesEx was changed in
              > Python 3.2 from PySliceObject to PyObject.
              >
              > He and I made a patch for this:
              > https://gist.github.com/nakinor/9780409

              This doesn't work, because PySliceObject_T is used in if_python3.c
              before including if_py_both.h. I'll move the #if to if_python3.c to
              make it work.

              --
              The process for understanding customers primarily involves sitting around with
              other marketing people and talking about what you would to if you were dumb
              enough to be a customer.
              (Scott Adams - The Dilbert principle)

              /// 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/d/optout.
            • Ken Takata
              Hi, ... Oops, sorry for that. Regards, Ken Takata -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text
              Message 6 of 6 , Mar 30, 2014
              • 0 Attachment
                Hi,

                2014/3/30 Sun 23:12:39 UTC+9 Bram Moolenaar:
                > This doesn't work, because PySliceObject_T is used in if_python3.c
                > before including if_py_both.h. I'll move the #if to if_python3.c to
                > make it work.

                Oops, sorry for that.

                Regards,
                Ken Takata

                --
                --
                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/d/optout.
              Your message has been successfully submitted and would be delivered to recipients shortly.