Remove mingw-w64 errors from loss of precision by converting 64bit pointers to ints. All cases found were harmless and the error behaviour could be turned off by the -fpermissive flag but I'd rather keep that off to detect any real problems should they arise.

This commit is contained in:
Antony Riakiotakis
2012-04-24 14:33:44 +00:00
parent 4782522379
commit 0db3c5f743
11 changed files with 136 additions and 13 deletions

View File

@@ -21,7 +21,14 @@
#endif
#endif // WIN32
#if defined(_WIN64)
# ifdef __MINGW64__
# include <basetsd.h>
# endif
typedef __int64 int_ptr;
#else
typedef long int_ptr;
#endif
/******************************************************************************
* Default Constructor
*****************************************************************************/
@@ -164,7 +171,7 @@ int ntlGeometryObjModel::initModel(int numVertices, float *vertices, int numTria
}
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(long)(channelVertices) ,10);
debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(int_ptr)(channelVertices) ,10);
if(channelVertices && (channelSize>0)) {
vector<ntlSetVec3f> aniverts;
vector<ntlSetVec3f> aninorms;

View File

@@ -0,0 +1,29 @@
Index: intern/ntl_geometrymodel.cpp
===================================================================
--- intern/ntl_geometrymodel.cpp (revision 45919)
+++ intern/ntl_geometrymodel.cpp (working copy)
@@ -21,7 +21,14 @@
#endif
#endif // WIN32
-
+#if defined(_WIN64)
+# ifdef __MINGW64__
+# include <basetsd.h>
+# endif
+typedef __int64 int_ptr;
+#else
+typedef long int_ptr;
+#endif
/******************************************************************************
* Default Constructor
*****************************************************************************/
@@ -164,7 +171,7 @@
}
//fprintf(stderr,"initModel DEBUG %d \n",channelSize);
- debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(long)(channelVertices) ,10);
+ debMsgStd("ntlGeometryObjModel::initModel",DM_MSG, "Csize:"<<channelSize<<", Cvert:"<<(int_ptr)(channelVertices) ,10);
if(channelVertices && (channelSize>0)) {
vector<ntlSetVec3f> aniverts;
vector<ntlSetVec3f> aninorms;