diff --git a/src/EterImageLib/DXTCImage.cpp b/src/EterImageLib/DXTCImage.cpp index 479d116..f0fb112 100644 --- a/src/EterImageLib/DXTCImage.cpp +++ b/src/EterImageLib/DXTCImage.cpp @@ -662,14 +662,14 @@ void CDXTCImage::DecompressDXT1(int miplevel, DWORD * pdwDest) for (y = 0; y < yblocks; ++y) { // 8 bytes per block - pBlock = (DXTColBlock *) ((DWORD) pPos + y * xblocks * 8); + pBlock = (DXTColBlock *) ((uintptr_t) pPos + y * xblocks * 8); for (x = 0; x < xblocks; ++x, ++pBlock) { // inline func: GetColorBlockColors(pBlock, &col_0, &col_1, &col_2, &col_3, wrd); - pImPos = (DWORD *) ((DWORD) pBase + x*16 + (y*4) * nWidth * 4); + pImPos = (DWORD *) ((uintptr_t) pBase + x*16 + (y*4) * nWidth * 4); DecodeColorBlock(pImPos, pBlock, nWidth, (DWORD *)&col_0, (DWORD *)&col_1, (DWORD *)&col_2, (DWORD *)&col_3); // Set to RGB test pattern // pImPos = (DWORD*) ((DWORD) pBase + i * 4 + j * m_nWidth * 4); @@ -716,7 +716,7 @@ void CDXTCImage::DecompressDXT3(int miplevel, DWORD* pdwDest) { // 8 bytes per block // 1 block for alpha, 1 block for color - pBlock = (DXTColBlock *) ((DWORD) (pPos + y * xblocks * 16)); + pBlock = (DXTColBlock *) ((uintptr_t) (pPos + y * xblocks * 16)); for (x = 0; x < xblocks; ++x, ++pBlock) { @@ -731,7 +731,7 @@ void CDXTCImage::DecompressDXT3(int miplevel, DWORD* pdwDest) // Decode the color block into the bitmap bits // inline func: - pImPos = (DWORD *) ((DWORD) (pBase + x * 16 + (y * 4) * nWidth * 4)); + pImPos = (DWORD *) ((uintptr_t) (pBase + x * 16 + (y * 4) * nWidth * 4)); DecodeColorBlock(pImPos, pBlock, @@ -780,7 +780,7 @@ void CDXTCImage::DecompressDXT5(int level, DWORD * pdwDest) { // 8 bytes per block // 1 block for alpha, 1 block for color - pBlock = (DXTColBlock*) ((DWORD) (pPos + y * xblocks * 16)); + pBlock = (DXTColBlock*) ((uintptr_t) (pPos + y * xblocks * 16)); for (x = 0; x < xblocks; ++x, ++pBlock) { @@ -797,7 +797,7 @@ void CDXTCImage::DecompressDXT5(int level, DWORD * pdwDest) // Decode the color block into the bitmap bits // inline func: - pImPos = (DWORD *) ((DWORD) (pBase + x * 16 + (y * 4) * nWidth * 4)); + pImPos = (DWORD *) ((uintptr_t) (pBase + x * 16 + (y * 4) * nWidth * 4)); //DecodeColorBlock(pImPos, pBlock, nWidth, (DWORD *)&col_0, (DWORD *)&col_1, (DWORD *)&col_2, (DWORD *)&col_3); DecodeColorBlock(pImPos, pBlock, nWidth, (DWORD *)&col_0, (DWORD *)&col_1, (DWORD *)&col_2, (DWORD *)&col_3); diff --git a/src/EterPythonLib/PythonGraphicImageModule.cpp b/src/EterPythonLib/PythonGraphicImageModule.cpp index ea31360..9cff611 100644 --- a/src/EterPythonLib/PythonGraphicImageModule.cpp +++ b/src/EterPythonLib/PythonGraphicImageModule.cpp @@ -82,8 +82,8 @@ PyObject* grpImageGenerateExpanded(PyObject* poSelf, PyObject* poArgs) PyObject* grpImageGenerateFromHandle(PyObject * poSelf, PyObject* poArgs) { - int iHandle; - if (!PyTuple_GetInteger(poArgs, 0, &iHandle)) + unsigned long long iHandle; + if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle)) return Py_BadArgument(); CGraphicImageInstance * pImageInstance = CGraphicImageInstance::New(); diff --git a/src/EterPythonLib/PythonGraphicTextModule.cpp b/src/EterPythonLib/PythonGraphicTextModule.cpp index 2378bbb..d6fcd70 100644 --- a/src/EterPythonLib/PythonGraphicTextModule.cpp +++ b/src/EterPythonLib/PythonGraphicTextModule.cpp @@ -2,8 +2,8 @@ bool PyTuple_GetTextInstance(PyObject* poArgs, int pos, CGraphicTextInstance** ppTextInstance) { - int handle; - if (!PyTuple_GetInteger(poArgs, pos, &handle)) + unsigned long long handle; + if (!PyTuple_GetUnsignedLongLong(poArgs, pos, &handle)) return false; if (!handle) diff --git a/src/EterPythonLib/PythonGraphicThingModule.cpp b/src/EterPythonLib/PythonGraphicThingModule.cpp index 805aa93..bb2b9d5 100644 --- a/src/EterPythonLib/PythonGraphicThingModule.cpp +++ b/src/EterPythonLib/PythonGraphicThingModule.cpp @@ -2,8 +2,8 @@ bool PyTuple_GetThingInstance(PyObject* poArgs, int pos, CGraphicThingInstance** ppRetThingInstance) { - int handle; - if (!PyTuple_GetInteger(poArgs, pos, &handle)) + unsigned long long handle; + if (!PyTuple_GetUnsignedLongLong(poArgs, pos, &handle)) return false; if (!handle) diff --git a/src/UserInterface/PythonItemModule.cpp b/src/UserInterface/PythonItemModule.cpp index d6a9bf2..26a7aec 100644 --- a/src/UserInterface/PythonItemModule.cpp +++ b/src/UserInterface/PythonItemModule.cpp @@ -287,8 +287,8 @@ PyObject * itemGetIconInstance(PyObject * poSelf, PyObject * poArgs) PyObject * itemDeleteIconInstance(PyObject * poSelf, PyObject * poArgs) { - int iHandle; - if (!PyTuple_GetInteger(poArgs, 0, &iHandle)) + unsigned long long iHandle; + if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle)) return Py_BadArgument(); CGraphicImageInstance::Delete((CGraphicImageInstance *) iHandle); diff --git a/src/UserInterface/PythonSkill.cpp b/src/UserInterface/PythonSkill.cpp index f9ab550..7736127 100644 --- a/src/UserInterface/PythonSkill.cpp +++ b/src/UserInterface/PythonSkill.cpp @@ -2092,8 +2092,8 @@ PyObject * skillGetIconInstanceNew(PyObject * poSelf, PyObject * poArgs) PyObject * skillDeleteIconInstance(PyObject * poSelf, PyObject * poArgs) { - int iHandle; - if (!PyTuple_GetInteger(poArgs, 0, &iHandle)) + unsigned long long iHandle; + if (!PyTuple_GetUnsignedLongLong(poArgs, 0, &iHandle)) return Py_BadArgument(); CGraphicImageInstance::Delete((CGraphicImageInstance *) iHandle);