Fix compilation for MSVC 6.0 for Bullet and COLLADA DOM.
Fix issues with btDbvt: use ATTRIBUTE_ALIGNED16 Removed several places where variable was declared within for statement: for (int i=0; should be int i; for (i=0
This commit is contained in:
@@ -181,13 +181,15 @@ ColladaConverter::~ColladaConverter ()
|
||||
m_collada = NULL;
|
||||
m_dom = NULL;
|
||||
|
||||
for(int i=0;i<m_rbUserInfoHashMap.size();i++)
|
||||
int i;
|
||||
|
||||
for(i=0;i<m_rbUserInfoHashMap.size();i++)
|
||||
{
|
||||
btRigidBodyColladaInfo* rbci = *(m_rbUserInfoHashMap.getAtIndex(i));
|
||||
delete rbci;
|
||||
}
|
||||
|
||||
for(int i=0;i<m_constraintUserInfoHashMap.size();i++)
|
||||
for(i=0;i<m_constraintUserInfoHashMap.size();i++)
|
||||
{
|
||||
btRigidConstraintColladaInfo* rcci = *(m_constraintUserInfoHashMap.getAtIndex(i));
|
||||
delete rcci;
|
||||
@@ -243,13 +245,14 @@ bool ColladaConverter::load(const char* orgfilename)
|
||||
// resets the collada converter state
|
||||
void ColladaConverter::reset ()
|
||||
{
|
||||
for(int i=0;i<m_rbUserInfoHashMap.size();i++)
|
||||
int i;
|
||||
for(i=0;i<m_rbUserInfoHashMap.size();i++)
|
||||
{
|
||||
btRigidBodyColladaInfo* rbci = *(m_rbUserInfoHashMap.getAtIndex(i));
|
||||
delete rbci;
|
||||
}
|
||||
|
||||
for(int i=0;i<m_constraintUserInfoHashMap.size();i++)
|
||||
for(i=0;i<m_constraintUserInfoHashMap.size();i++)
|
||||
{
|
||||
btRigidConstraintColladaInfo* rcci = *(m_constraintUserInfoHashMap.getAtIndex(i));
|
||||
delete rcci;
|
||||
@@ -2436,14 +2439,16 @@ bool ColladaConverter::save(const char* filename)
|
||||
return false;
|
||||
}
|
||||
|
||||
int i;
|
||||
|
||||
/* Dump the scene */
|
||||
for (int i = 0; i < getNumRigidBodies (); i++)
|
||||
for (i = 0; i < getNumRigidBodies (); i++)
|
||||
{
|
||||
syncOrAddRigidBody (getRigidBody(i));
|
||||
}
|
||||
|
||||
/* Dump the constraints */
|
||||
for (int i = 0; i < getNumConstraints (); i++)
|
||||
for (i = 0; i < getNumConstraints (); i++)
|
||||
{
|
||||
syncOrAddConstraint (getConstraint(i));
|
||||
}
|
||||
@@ -2583,7 +2588,8 @@ char* ColladaConverter::getLastFileName()
|
||||
char* ColladaConverter::fixFileName(const char* lpCmdLine)
|
||||
{
|
||||
|
||||
for (int i=0;i<513;i++)
|
||||
int i;
|
||||
for (i=0;i<513;i++)
|
||||
{
|
||||
m_cleaned_filename[i]=0;
|
||||
}
|
||||
@@ -2605,7 +2611,7 @@ char* ColladaConverter::fixFileName(const char* lpCmdLine)
|
||||
// Second character is a :, assume we have a path with a drive letter and add a slash at the beginning
|
||||
*(out++) = '/';
|
||||
}
|
||||
int i;
|
||||
|
||||
for(i =0; i<512; i++)
|
||||
{
|
||||
// If we hit a null or a quote, stop copying. This will get just the first filename.
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
|
||||
#if _MSC_VER <= 1200
|
||||
typedef int intptr_t;
|
||||
#undef PLATFORM_INT8
|
||||
#define PLATFORM_INT8 char
|
||||
#undef PLATFORM_UINT8
|
||||
#define PLATFORM_UINT8 unsigned char
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -451,6 +451,8 @@ daeBool
|
||||
{
|
||||
strcpy( dst, "NaN" );
|
||||
}
|
||||
#if !(defined (_MSC_VER) && _MSC_VER < 1300)
|
||||
//this breaks visual studio 2006, so ignore NaN/INF rather then break the build
|
||||
else if ( *(daeULong*)src == 0x7ff0000000000000LL ) //+INF
|
||||
{
|
||||
strcpy( dst, "INF" );
|
||||
@@ -459,6 +461,7 @@ daeBool
|
||||
{
|
||||
strcpy( dst, "-INF" );
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
sprintf(dst,_printFormat,*((daeDouble*)src));
|
||||
@@ -469,6 +472,8 @@ daeBool
|
||||
daeBool
|
||||
daeDoubleType::stringToMemory(daeChar *src, daeChar* dstMemory)
|
||||
{
|
||||
#if !(defined (_MSC_VER) && _MSC_VER < 1300)
|
||||
//this breaks visual studio 2006, so ignore NaN/INF rather then break the build
|
||||
if ( strcmp(src, "NaN") == 0 ) {
|
||||
daeErrorHandler::get()->handleWarning( "NaN encountered while setting an attribute or value\n" );
|
||||
*(daeLong*)(dstMemory) = 0x7ff0000000000002LL;
|
||||
@@ -482,6 +487,7 @@ daeDoubleType::stringToMemory(daeChar *src, daeChar* dstMemory)
|
||||
*(daeLong*)(dstMemory) = 0xfff0000000000000LL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
sscanf(src, _scanFormat, dstMemory);
|
||||
}
|
||||
|
||||
@@ -462,7 +462,7 @@ daeElement::~daeElement()
|
||||
_intObject->release();
|
||||
|
||||
if (_elementName) {
|
||||
delete[] _elementName;
|
||||
delete[] (void*) _elementName;
|
||||
_elementName = NULL;
|
||||
}
|
||||
}
|
||||
@@ -478,7 +478,7 @@ daeString daeElement::getElementName() const
|
||||
}
|
||||
void daeElement::setElementName( daeString nm ) {
|
||||
if ( nm == NULL ) {
|
||||
if ( _elementName ) delete[] _elementName;
|
||||
if ( _elementName ) delete[] (void*)_elementName;
|
||||
_elementName = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,11 +46,11 @@ daeSIDResolver::daeSIDResolver( daeElement *container, daeString target, daeStri
|
||||
daeSIDResolver::~daeSIDResolver()
|
||||
{
|
||||
if ( target != NULL ) {
|
||||
delete[] target;
|
||||
delete[] (void*)target;
|
||||
target = NULL;
|
||||
}
|
||||
if ( profile != NULL ) {
|
||||
delete[] profile;
|
||||
delete[] (void*)profile;
|
||||
profile = NULL;
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ daeSIDResolver::~daeSIDResolver()
|
||||
void daeSIDResolver::setTarget( daeString t )
|
||||
{
|
||||
if ( target != NULL ) {
|
||||
delete[] target;
|
||||
delete[] (void*)target;
|
||||
}
|
||||
if ( t != NULL ) {
|
||||
target = new char[ strlen( t ) +1 ];
|
||||
@@ -78,7 +78,7 @@ void daeSIDResolver::setTarget( daeString t )
|
||||
void daeSIDResolver::setProfile( daeString p )
|
||||
{
|
||||
if ( profile != NULL ) {
|
||||
delete[] target;
|
||||
delete[] (void*)target;
|
||||
}
|
||||
if ( p != NULL ) {
|
||||
profile = new char[ strlen( p ) +1 ];
|
||||
@@ -335,8 +335,10 @@ daeElement *daeSIDResolver::findSID( daeElement *el, daeString sid ) {
|
||||
|
||||
daeElementRefArray children;
|
||||
el->getChildren( children );
|
||||
size_t cnt = children.getCount();
|
||||
for ( size_t x = 0; x < cnt; x++ ) {
|
||||
size_t cnt = children.getCount();
|
||||
size_t x;
|
||||
|
||||
for ( x = 0; x < cnt; x++ ) {
|
||||
//examine the children
|
||||
//char s[56];
|
||||
//daeAtomicType::get( "token" )->memoryToString( children[x]->getAttributeValue( "sid" ), s, 56 );
|
||||
@@ -346,7 +348,7 @@ daeElement *daeSIDResolver::findSID( daeElement *el, daeString sid ) {
|
||||
return children[x];
|
||||
}
|
||||
}
|
||||
for ( size_t x = 0; x < cnt; x++ ) {
|
||||
for ( x = 0; x < cnt; x++ ) {
|
||||
//if not found look for it in each child
|
||||
if ( profile != NULL && strcmp( children[x]->getTypeName(), "technique_COMMON" ) == 0 ) {
|
||||
//not looking for common profile
|
||||
|
||||
@@ -602,12 +602,13 @@ void daeSTLDatabase::validate()
|
||||
if (documents[i]->getModified() ) {
|
||||
daeDocument *tmp = documents[i];
|
||||
const daeElementRefArray &rea = tmp->getRemovedArray();
|
||||
for ( unsigned int x = 0; x < rea.getCount(); x++ ) {
|
||||
unsigned int x;
|
||||
for ( x = 0; x < rea.getCount(); x++ ) {
|
||||
removeElement( tmp, rea[x] );
|
||||
}
|
||||
|
||||
const daeElementRefArray &iea = tmp->getInsertedArray();
|
||||
for ( unsigned int x = 0; x < iea.getCount(); x++ ) {
|
||||
for ( x = 0; x < iea.getCount(); x++ ) {
|
||||
insertElement( tmp, iea[x] );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user