diff options
| author | sschirm <[email protected]> | 2016-12-23 14:20:36 +0100 |
|---|---|---|
| committer | sschirm <[email protected]> | 2016-12-23 14:56:17 +0100 |
| commit | ef6937e69e8ee3f409cf9d460d5ad300a65d5924 (patch) | |
| tree | 710426e8daa605551ce3f34b581897011101c30f /PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml | |
| parent | Initial commit: (diff) | |
| download | physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.tar.xz physx-3.4-ef6937e69e8ee3f409cf9d460d5ad300a65d5924.zip | |
PhysX 3.4 / APEX 1.4 release candidate @21506124
Diffstat (limited to 'PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml')
3 files changed, 9 insertions, 7 deletions
diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnRepXUpgrader.cpp b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnRepXUpgrader.cpp index 5eb2f40e..4aadb648 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnRepXUpgrader.cpp +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnRepXUpgrader.cpp @@ -27,6 +27,7 @@ // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved. // Copyright (c) 2001-2004 NovodeX AG. All rights reserved. +#include "foundation/PxMemory.h" #include "CmPhysXCommon.h" #include "SnXmlImpl.h" #include "SnXmlReader.h" @@ -102,7 +103,7 @@ namespace physx { namespace Sn { { const char *period = nextPeriod( str ); size_t len = size_t(PxMin( period - str, ptrdiff_t(1023) )); //can't be too careful these days. - memcpy( nameBuffer, str, len ); + PxMemCopy( nameBuffer, str, PxU32(len) ); nameBuffer[len] = 0; if ( theReader.gotoChild( nameBuffer ) == false ) { @@ -138,7 +139,7 @@ namespace physx { namespace Sn { if ( periodPtr == NULL || *periodPtr != '.' ) continue; nameLen = size_t(periodPtr - item.name); char* newMem = reinterpret_cast<char*>(alloc.allocate( PxU32(nameLen + 1) )); - memcpy( newMem, item.name, nameLen ); + PxMemCopy( newMem, item.name, PxU32(nameLen) ); newMem[nameLen] = 0; if ( nameOffsets.find( newMem ) ) diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlImpl.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlImpl.h index 1718cc86..f296633d 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlImpl.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlImpl.h @@ -31,6 +31,7 @@ #include "SnXmlMemoryPool.h" #include "PsString.h" +#include "foundation/PxMemory.h" namespace physx { namespace Sn { @@ -60,7 +61,7 @@ namespace snXmlImpl { //The memory will never be released by repx. If you want it released, you need to pass in a custom allocator //that tracks all allocations and releases unreleased allocations yourself. char* dest = reinterpret_cast<char* >( inAllocator.allocate( theLen + 1, "Repx::const char*", __FILE__, __LINE__ ) ); - memcpy( dest, inStr, theLen ); + PxMemCopy( dest, inStr, theLen ); dest[theLen] = 0; return dest; } @@ -74,7 +75,7 @@ namespace snXmlImpl { { PxU32 theLen = snXmlImpl::strLen( inStr ); char* dest = reinterpret_cast<char* >( inMgr->allocate( theLen + 1 ) ); - memcpy( dest, inStr, theLen ); + PxMemCopy( dest, inStr, theLen ); dest[theLen] = 0; return dest; } diff --git a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlMemoryPoolStreams.h b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlMemoryPoolStreams.h index 375d1e2d..4944e864 100644 --- a/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlMemoryPoolStreams.h +++ b/PhysX_3.4/Source/PhysXExtensions/src/serialization/Xml/SnXmlMemoryPoolStreams.h @@ -129,7 +129,7 @@ struct MemoryBufferBase : public PxOutputStream, public PxInputStream PX_ASSERT( fits ); if ( fits ) { - memcpy( dest, mBuffer + mReadOffset, count ); + PxMemCopy( dest, mBuffer + mReadOffset, count ); mReadOffset += count; return count; } @@ -146,7 +146,7 @@ struct MemoryBufferBase : public PxOutputStream, public PxInputStream PxU8* newData( mManager->allocate( newCapacity ) ); if ( mWriteOffset ) - memcpy( newData, mBuffer, mWriteOffset ); + PxMemCopy( newData, mBuffer, mWriteOffset ); mManager->deallocate( mBuffer ); mBuffer = newData; mCapacity = newCapacity; @@ -156,7 +156,7 @@ struct MemoryBufferBase : public PxOutputStream, public PxInputStream virtual PxU32 write(const void* src, PxU32 count) { checkCapacity( mWriteOffset + count ); - memcpy( mBuffer + mWriteOffset, src, count ); + PxMemCopy( mBuffer + mWriteOffset, src, count ); mWriteOffset += count; return count; } |