diff options
Diffstat (limited to 'PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml')
| -rw-r--r-- | PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h | 15 | ||||
| -rw-r--r-- | PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h | 12 |
2 files changed, 23 insertions, 4 deletions
diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h index 19cb00e6..18e2a9e0 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlDeserializer.h @@ -57,6 +57,17 @@ namespace physx { namespace Sn { void deallocate( PxU8* inMem ) { mAllocator->deallocate( inMem ); } }; + inline bool isEmpty(const char *s) + { + while (*s != '\0') + { + if (!isspace(*s)) + return false; + s++; + } + return true; + } + inline void strtoLong( Triangle<PxU32>& ioDatatype,const char*& ioData ) { strto( ioDatatype.mIdx0, ioData ); @@ -144,9 +155,7 @@ namespace physx { namespace Sn { ++theCount; char* theStartData = const_cast< char*>( copyStr( &tempAllocator, theSrcData ) ); const char* theData = theStartData; - PxU32 theLen = strLenght( theData ); - const char* theEndData = theData + theLen; - while( theData < theEndData ) + while( !isEmpty(theData) ) { //These buffers are whitespace delimited. TDataType theType; diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h index 040c42a9..e7286bc5 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlVisitorWriter.h @@ -219,7 +219,12 @@ namespace physx { namespace Sn { , PxU32 inObjPerLine, PxStrideIterator<const TDataType>& inData, TAccessOperator inAccessOperator , PxU32 inBufSize, const char* inPropName, PxU32 /*inStride*/, TWriteOperator inOperator ) { +#if PX_NX + const auto *dat = &inData[0]; + if (inBufSize && dat != NULL) +#else if ( inBufSize && &inData[0]) +#endif { for ( PxU32 idx = 0; idx < inBufSize; ++idx ) { @@ -239,8 +244,13 @@ namespace physx { namespace Sn { inline void writeStrideFlags( XmlWriter& inWriter, MemoryBuffer& inTempBuffer , PxU32 inObjPerLine, PxStrideIterator<const TDataType>& inData, TAccessOperator /*inAccessOperator*/ , PxU32 inBufSize, const char* inPropName, const PxU32ToName* inTable) - { + { +#if PX_NX + const auto *dat = &inData[0]; + if (inBufSize && dat != NULL) +#else if ( inBufSize && &inData[0]) +#endif { for ( PxU32 idx = 0; idx < inBufSize; ++idx ) { |