summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-09-12 14:43:41 (GMT)
committerGuido van Rossum <guido@python.org>2002-09-12 14:43:41 (GMT)
commitefc1188239bf4381b7749d2f43836bbb216cfc44 (patch)
tree9a0a95f19b6f13a515a51875a9bfa665acf273f7 /Objects
parent770acd3f7fff52eef0d0ad02beaa4c569d70811f (diff)
downloadcpython-efc1188239bf4381b7749d2f43836bbb216cfc44.zip
cpython-efc1188239bf4381b7749d2f43836bbb216cfc44.tar.gz
cpython-efc1188239bf4381b7749d2f43836bbb216cfc44.tar.bz2
Fix warnings on 64-bit platforms about casts from pointers to ints.
Two of these were real bugs.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/obmalloc.c2
-rw-r--r--Objects/stringobject.c3
-rw-r--r--Objects/unicodeobject.c3
3 files changed, 5 insertions, 3 deletions
diff --git a/Objects/obmalloc.c b/Objects/obmalloc.c
index 95c0e87..753b2cc 100644
--- a/Objects/obmalloc.c
+++ b/Objects/obmalloc.c
@@ -437,7 +437,7 @@ new_arena(void)
arenabase = bp;
nfreepools = ARENA_SIZE / POOL_SIZE;
assert(POOL_SIZE * nfreepools == ARENA_SIZE);
- excess = (uint)bp & POOL_SIZE_MASK;
+ excess = (uint) ((Py_uintptr_t)bp & POOL_SIZE_MASK);
if (excess != 0) {
--nfreepools;
arenabase += POOL_SIZE - excess;
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index c090e9b..92adb49 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -3883,7 +3883,8 @@ PyString_Format(PyObject *format, PyObject *args)
PyErr_Format(PyExc_ValueError,
"unsupported format character '%c' (0x%x) "
"at index %i",
- c, c, fmt - 1 - PyString_AsString(format));
+ c, c,
+ (int)(fmt - 1 - PyString_AsString(format)));
goto error;
}
if (sign) {
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index dab3a75..dde6b47 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -6465,7 +6465,8 @@ PyObject *PyUnicode_Format(PyObject *format,
"unsupported format character '%c' (0x%x) "
"at index %i",
(31<=c && c<=126) ? c : '?',
- c, fmt -1 - PyUnicode_AS_UNICODE(uformat));
+ c,
+ (int)(fmt -1 - PyUnicode_AS_UNICODE(uformat)));
goto onError;
}
if (sign) {