mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Fix warnings on 64-bit platforms about casts from pointers to ints.
Two of these were real bugs.
This commit is contained in:
parent
770acd3f7f
commit
efc1188239
3 changed files with 5 additions and 3 deletions
|
@ -437,7 +437,7 @@ new_arena(void)
|
||||||
arenabase = bp;
|
arenabase = bp;
|
||||||
nfreepools = ARENA_SIZE / POOL_SIZE;
|
nfreepools = ARENA_SIZE / POOL_SIZE;
|
||||||
assert(POOL_SIZE * nfreepools == ARENA_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) {
|
if (excess != 0) {
|
||||||
--nfreepools;
|
--nfreepools;
|
||||||
arenabase += POOL_SIZE - excess;
|
arenabase += POOL_SIZE - excess;
|
||||||
|
|
|
@ -3883,7 +3883,8 @@ PyString_Format(PyObject *format, PyObject *args)
|
||||||
PyErr_Format(PyExc_ValueError,
|
PyErr_Format(PyExc_ValueError,
|
||||||
"unsupported format character '%c' (0x%x) "
|
"unsupported format character '%c' (0x%x) "
|
||||||
"at index %i",
|
"at index %i",
|
||||||
c, c, fmt - 1 - PyString_AsString(format));
|
c, c,
|
||||||
|
(int)(fmt - 1 - PyString_AsString(format)));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
if (sign) {
|
if (sign) {
|
||||||
|
|
|
@ -6465,7 +6465,8 @@ PyObject *PyUnicode_Format(PyObject *format,
|
||||||
"unsupported format character '%c' (0x%x) "
|
"unsupported format character '%c' (0x%x) "
|
||||||
"at index %i",
|
"at index %i",
|
||||||
(31<=c && c<=126) ? c : '?',
|
(31<=c && c<=126) ? c : '?',
|
||||||
c, fmt -1 - PyUnicode_AS_UNICODE(uformat));
|
c,
|
||||||
|
(int)(fmt -1 - PyUnicode_AS_UNICODE(uformat)));
|
||||||
goto onError;
|
goto onError;
|
||||||
}
|
}
|
||||||
if (sign) {
|
if (sign) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue