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

Re: A warning on 64bit environment.

Expand Messages
  • Bram Moolenaar
    ... The documentation says: Changed in version 2.5: This function used an int * type for length. This might require changes in your code for properly
    Message 1 of 6 , Jun 24, 2013
    • 0 Attachment
      Taro Muraoka wrote:

      > I have found and fix a warning when compile for 64bit environment.
      > It was happend for *dynamic* Python2 and 64bit environment,
      > because third parameter of PyString_AsStringAndSize is expected as
      > Py_ssize_t*, but it is defined as int* by stub macro of dynamic
      > Python.
      >
      > Please check attached patch.

      The documentation says:

      Changed in version 2.5: This function used an int * type for
      length. This might require changes in your code for properly
      supporting 64-bit systems.

      So we probably need to use an #ifdef.


      --
      The greatest lies of all time:
      (1) The check is in the mail.
      (2) We have a really challenging assignment for you.
      (3) I love you.
      (4) All bugs have been fixed.
      (5) This won't hurt a bit.
      (6) Honey, I just need to debug this program and be home in 5 minutes.
      (7) I have just sent you an e-mail about that.
      (8) Of course I'll respect you in the morning.
      (9) I'm from the government, and I'm here to help you.

      /// 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.
    • Taro MURAOKA
      ... Indeed. I have updated the patch. -- -- You received this message from the vim_dev maillist. Do not top-post! Type your reply below the text you are
      Message 2 of 6 , Jun 24, 2013
      • 0 Attachment
        > So we probably need to use an #ifdef.

        Indeed. I have updated the patch.

        --
        --
        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.
      • Jun T.
        ... There is already a macro PyInt for this purpose. I also added similar fix for PyList_insert(). diff -r 7a5c346861e1 src/if_python.c ... +++
        Message 3 of 6 , Jun 24, 2013
        • 0 Attachment
          On 2013/06/24, at 19:05, Bram Moolenaar <Bram@...> wrote:
          > So we probably need to use an #ifdef.

          There is already a macro 'PyInt' for this purpose.
          I also added similar fix for PyList_insert().


          diff -r 7a5c346861e1 src/if_python.c
          --- a/src/if_python.c Sun Jun 23 16:40:40 2013 +0200
          +++ b/src/if_python.c Mon Jun 24 20:40:44 2013 +0900
          @@ -329,7 +329,7 @@
          static PyTypeObject* dll_PyLong_Type;
          static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt);
          static int(*dll_PyList_Append)(PyObject *, PyObject *);
          -static int(*dll_PyList_Insert)(PyObject *, int, PyObject *);
          +static int(*dll_PyList_Insert)(PyObject *, PyInt, PyObject *);
          static PyObject*(*dll_PyList_New)(PyInt size);
          static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *);
          static PyInt(*dll_PyList_Size)(PyObject *);
          @@ -365,7 +365,7 @@
          static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *);
          static PyObject* (*dll_PyObject_Repr)(PyObject *);
          static char*(*dll_PyString_AsString)(PyObject *);
          -static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *);
          +static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, PyInt *);
          static PyObject*(*dll_PyString_FromString)(const char *);
          static PyObject*(*dll_PyString_FromFormat)(const char *, ...);
          static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt);




          --
          --
          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
          ... That s easier, thanks. -- If I tell you you have a beautiful body , would you hold it against me? /// Bram Moolenaar -- Bram@Moolenaar.net --
          Message 4 of 6 , Jun 24, 2013
          • 0 Attachment
            Jun Takimoto wrote:

            > On 2013/06/24, at 19:05, Bram Moolenaar <Bram@...> wrote:
            > > So we probably need to use an #ifdef.
            >
            > There is already a macro 'PyInt' for this purpose.
            > I also added similar fix for PyList_insert().

            That's easier, thanks.

            --
            If I tell you "you have a beautiful body", would you hold it against me?

            /// 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.
          • Bram Moolenaar
            ... Thanks! -- FIRST HEAD: All right! All right! We ll kill him first and then have tea and biscuits. Monty Python and the Holy Grail PYTHON (MONTY) PICTURES
            Message 5 of 6 , Jun 24, 2013
            • 0 Attachment
              Taro Muraoka wrote:

              > > So we probably need to use an #ifdef.
              >
              > Indeed. I have updated the patch.

              Thanks!

              --
              FIRST HEAD: All right! All right! We'll kill him first and then have tea and
              biscuits.
              "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

              /// 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.