replace Py_(u)intptr_t with the c99 standard types

This commit is contained in:
Benjamin Peterson 2016-09-06 13:47:26 -07:00
parent 3c397e4c39
commit ca47063998
21 changed files with 86 additions and 86 deletions

View file

@ -178,7 +178,7 @@ static void drop_gil(PyThreadState *tstate)
/* Sub-interpreter support: threads might have been switched
under our feet using PyThreadState_Swap(). Fix the GIL last
holder variable so that our heuristics work. */
_Py_atomic_store_relaxed(&gil_last_holder, (Py_uintptr_t)tstate);
_Py_atomic_store_relaxed(&gil_last_holder, (uintptr_t)tstate);
}
MUTEX_LOCK(gil_mutex);
@ -240,7 +240,7 @@ _ready:
_Py_ANNOTATE_RWLOCK_ACQUIRED(&gil_locked, /*is_write=*/1);
if (tstate != (PyThreadState*)_Py_atomic_load_relaxed(&gil_last_holder)) {
_Py_atomic_store_relaxed(&gil_last_holder, (Py_uintptr_t)tstate);
_Py_atomic_store_relaxed(&gil_last_holder, (uintptr_t)tstate);
++gil_switch_number;
}

View file

@ -476,9 +476,9 @@ compiler_unit_check(struct compiler_unit *u)
{
basicblock *block;
for (block = u->u_blocks; block != NULL; block = block->b_list) {
assert((Py_uintptr_t)block != 0xcbcbcbcbU);
assert((Py_uintptr_t)block != 0xfbfbfbfbU);
assert((Py_uintptr_t)block != 0xdbdbdbdbU);
assert((uintptr_t)block != 0xcbcbcbcbU);
assert((uintptr_t)block != 0xfbfbfbfbU);
assert((uintptr_t)block != 0xdbdbdbdbU);
if (block->b_instr != NULL) {
assert(block->b_ialloc > 0);
assert(block->b_iused > 0);

View file

@ -6,7 +6,7 @@
#define GET_TSTATE() \
((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
#define SET_TSTATE(value) \
_Py_atomic_store_relaxed(&_PyThreadState_Current, (Py_uintptr_t)(value))
_Py_atomic_store_relaxed(&_PyThreadState_Current, (uintptr_t)(value))
#define GET_INTERP_STATE() \
(GET_TSTATE()->interp)