summaryrefslogtreecommitdiff
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-11-16 00:13:29 +0100
committerVictor Stinner <victor.stinner@gmail.com>2013-11-16 00:13:29 +0100
commitb4e0249581dad0dc2df1f7f8d811d38f245c34fe (patch)
treef7f5b225d9b67bfec5d477bdf9bf8051071f0484 /Python/marshal.c
parent6988dd8e0360108ccf61854ba7ff6cf45b3abff0 (diff)
downloadcpython-b4e0249581dad0dc2df1f7f8d811d38f245c34fe.tar.gz
Fix compiler warning (on Windows 64-bit): explicit cast Py_ssize_t to unsigned
char, n is in range [0; 255] (a tuple cannot have a negative length)
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index e211a0f018..dc5411c1ff 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -80,7 +80,7 @@ typedef struct {
#define w_byte(c, p) if (((p)->fp)) putc((c), (p)->fp); \
else if ((p)->ptr != (p)->end) *(p)->ptr++ = (c); \
- else w_more(c, p)
+ else w_more((c), p)
static void
w_more(char c, WFILE *p)
@@ -448,7 +448,7 @@ w_complex_object(PyObject *v, char flag, WFILE *p)
n = PyTuple_Size(v);
if (p->version >= 4 && n < 256) {
W_TYPE(TYPE_SMALL_TUPLE, p);
- w_byte(n, p);
+ w_byte((unsigned char)n, p);
}
else {
W_TYPE(TYPE_TUPLE, p);