diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-04-19 21:26:03 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-04-19 21:26:03 +0400 |
commit | fe08da3b4c4097c87c4ee1ee02e9218aaaffde4b (patch) | |
tree | 15fe85bd8f9af28d8b7305cc421f2ba07c7552eb /source/gameengine | |
parent | 7f154456293f49012643508c30f4b1fb40b3f2e5 (diff) |
BGE: fix Pyfrom_id to work on w64.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Expressions/ListValue.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 5bb1eb0aeb9..4e14ce35eb9 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -532,13 +532,7 @@ PyObject* CListValue::Pycount(PyObject* self, PyObject* value) PyObject* CListValue::Pyfrom_id(PyObject* self, PyObject* value) { -#if SIZEOF_VOID_P <= SIZEOF_LONG -#define BGE_ID_TYPE unsigned long - BGE_ID_TYPE id= PyLong_AsUnsignedLong(value); -#else -#define BGE_ID_TYPE unsigned long long - BGE_ID_TYPE id= PyLong_FromUnsignedLongLong(value); -#endif + uintptr_t id= (uintptr_t)PyLong_AsVoidPtr(value); if (PyErr_Occurred()) return NULL; @@ -546,17 +540,14 @@ PyObject* CListValue::Pyfrom_id(PyObject* self, PyObject* value) int numelem = GetCount(); for (int i=0;i<numelem;i++) { - if (reinterpret_cast<BGE_ID_TYPE>(m_pValueArray[i]->m_proxy) == id) + if (reinterpret_cast<uintptr_t>(m_pValueArray[i]->m_proxy) == id) return GetValue(i)->GetProxy(); - } PyErr_SetString(PyExc_IndexError, "from_id(#), id not found in CValueList"); return NULL; } -#undef BGE_ID_TYPE - /* --------------------------------------------------------------------- * Some stuff taken from the header |