On Tuesday, February 11, 2014 11:54:46 PM UTC+4, ZyX wrote:
> PyErr_Format("%ld") is supported since python 2.5. Officially we support 
> python 2.4 and older. Thus you should either drop support for python 2.4 or 
> cast to (int). I was using the latter, though I cannot recall whether I just 
> forgot to add type casts when transforming %ld I wanted to use initially to 
> %d or there is some reason to do so.

Some search reveals that I do have casts to (int) in a number of places, just 
these two are missing them. This would correct:

diff -r bae71e70150b src/if_py_both.h
--- a/src/if_py_both.h  Tue Feb 11 19:33:07 2014 +0100
+++ b/src/if_py_both.h  Wed Feb 12 00:02:33 2014 +0400
@@ -2509,8 +2509,8 @@
        {
            Py_DECREF(iterator);
            PyErr_FORMAT(PyExc_ValueError,
-                   N_("attempt to assign sequence of size greater then %ld "
-                       "to extended slice"), (long)slicelen);
+                   N_("attempt to assign sequence of size greater then %d "
+                       "to extended slice"), (int) slicelen);
            list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
            PyMem_Free(lis);
            return -1;
@@ -2522,8 +2522,8 @@
     if (step != 1 && i != slicelen)
     {
        PyErr_FORMAT2(PyExc_ValueError,
-               N_("attempt to assign sequence of size %ld to extended slice "
-                   "of size %ld"), (long)i, (long)slicelen);
+               N_("attempt to assign sequence of size %d to extended slice "
+                   "of size %d"), (int) i, (int) slicelen);
        list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
        PyMem_Free(lis);
        return -1;

-- 
-- 
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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
*** /tmp/extdiff.hOAHJ5/vim-small-patches.bae71e70150b/src/if_py_both.h	2014-02-12 00:02:51.667169240 +0400
--- /home/zyx/a.a/Proj/c/vim-small-patches/src/if_py_both.h	2014-02-12 00:02:03.326167660 +0400
***************
*** 2509,2516 ****
  	{
  	    Py_DECREF(iterator);
  	    PyErr_FORMAT(PyExc_ValueError,
! 		    N_("attempt to assign sequence of size greater then %ld "
! 			"to extended slice"), (long)slicelen);
  	    list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
  	    PyMem_Free(lis);
  	    return -1;
--- 2509,2516 ----
  	{
  	    Py_DECREF(iterator);
  	    PyErr_FORMAT(PyExc_ValueError,
! 		    N_("attempt to assign sequence of size greater then %d "
! 			"to extended slice"), (int) slicelen);
  	    list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
  	    PyMem_Free(lis);
  	    return -1;
***************
*** 2522,2529 ****
      if (step != 1 && i != slicelen)
      {
  	PyErr_FORMAT2(PyExc_ValueError,
! 		N_("attempt to assign sequence of size %ld to extended slice "
! 		    "of size %ld"), (long)i, (long)slicelen);
  	list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
  	PyMem_Free(lis);
  	return -1;
--- 2522,2529 ----
      if (step != 1 && i != slicelen)
      {
  	PyErr_FORMAT2(PyExc_ValueError,
! 		N_("attempt to assign sequence of size %d to extended slice "
! 		    "of size %d"), (int) i, (int) slicelen);
  	list_restore(numadded, numreplaced, slicelen, l, lis, lastaddedli);
  	PyMem_Free(lis);
  	return -1;

Reply via email to