[Python-checkins] cpython: Fix compilater warnings on Windows 64-bit

victor.stinner python-checkins at python.org
Fri May 17 00:12:18 CEST 2013


http://hg.python.org/cpython/rev/ef5dd5bda323
changeset:   83802:ef5dd5bda323
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri May 17 00:12:04 2013 +0200
summary:
  Fix compilater warnings on Windows 64-bit

files:
  Python/getargs.c   |  6 +++---
  Python/traceback.c |  2 +-
  2 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Python/getargs.c b/Python/getargs.c
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -55,7 +55,7 @@
 
 /* Forward */
 static int vgetargs1(PyObject *, const char *, va_list *, int);
-static void seterror(int, const char *, int *, const char *, const char *);
+static void seterror(Py_ssize_t, const char *, int *, const char *, const char *);
 static char *convertitem(PyObject *, const char **, va_list *, int, int *,
                          char *, size_t, freelist_t *);
 static char *converttuple(PyObject *, const char **, va_list *, int,
@@ -357,7 +357,7 @@
 
 
 static void
-seterror(int iarg, const char *msg, int *levels, const char *fname,
+seterror(Py_ssize_t iarg, const char *msg, int *levels, const char *fname,
          const char *message)
 {
     char buf[512];
@@ -373,7 +373,7 @@
         }
         if (iarg != 0) {
             PyOS_snprintf(p, sizeof(buf) - (p - buf),
-                          "argument %d", iarg);
+                          "argument %zd", iarg);
             i = 0;
             p += strlen(p);
             while (levels[i] > 0 && i < 32 && (int)(p-buf) < 220) {
diff --git a/Python/traceback.c b/Python/traceback.c
--- a/Python/traceback.c
+++ b/Python/traceback.c
@@ -13,7 +13,7 @@
 
 #define OFF(x) offsetof(PyTracebackObject, x)
 
-#define PUTS(fd, str) write(fd, str, strlen(str))
+#define PUTS(fd, str) write(fd, str, (int)strlen(str))
 #define MAX_STRING_LENGTH 500
 #define MAX_FRAME_DEPTH 100
 #define MAX_NTHREADS 100

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list