]> granicus.if.org Git - python/commitdiff
Fix compilater warnings on Windows 64-bit
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 16 May 2013 22:12:04 +0000 (00:12 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 16 May 2013 22:12:04 +0000 (00:12 +0200)
Python/getargs.c
Python/traceback.c

index 08faeb464d64a04a45c0e2da87d469eb7eb52a48..87b6a6e3b202c287642c7ae6ffa2cdbf5758c8a3 100644 (file)
@@ -55,7 +55,7 @@ typedef struct {
 
 /* 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 @@ vgetargs1(PyObject *args, const char *format, va_list *p_va, int flags)
 
 
 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 @@ seterror(int iarg, const char *msg, int *levels, const char *fname,
         }
         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) {
index b928902ef02447ff62786d57de3661e042200b47..c56b23f6cca5b7b1695d3614c59eb1b9b378788e 100644 (file)
@@ -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