Skip to content

Commit

Permalink
Code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Oct 26, 2016
1 parent 644d86a commit 3fa7226
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
10 changes: 9 additions & 1 deletion DirectXMesh/DirectXMeshOptimize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

using namespace DirectX;

#pragma warning(disable : 4351)

namespace
{

Expand All @@ -26,6 +28,7 @@ class mesh_status
{
public:
mesh_status() :
mUnprocessed{},
mFaceOffset(0),
mFaceCount(0),
mMaxSubset(0),
Expand Down Expand Up @@ -327,6 +330,8 @@ class mesh_status
{
assert( face < mTotalFaces );
assert( n < 3 );
_Analysis_assume_( face < mTotalFaces );
_Analysis_assume_( n < 3 );
return mPhysicalNeighbors[ face ].neighbors[ n ];
}

Expand Down Expand Up @@ -760,7 +765,7 @@ HRESULT _VertexCacheStripReorder( _In_reads_(nFaces*3) const index_t* indices, _

//-------------------------------------------------------------------------------------
template<class index_t>
HRESULT _OptimizeVertices( const index_t* indices, size_t nFaces, size_t nVerts, uint32_t* vertexRemap )
HRESULT _OptimizeVertices( _In_reads_(nFaces*3) const index_t* indices, size_t nFaces, size_t nVerts, _Out_writes_(nVerts) uint32_t* vertexRemap )
{
if ( !indices || !nFaces || !nVerts || !vertexRemap )
return E_INVALIDARG;
Expand Down Expand Up @@ -802,6 +807,9 @@ HRESULT _OptimizeVertices( const index_t* indices, size_t nFaces, size_t nVerts,
uint32_t vertindex = tempRemap[ j ];
if ( vertindex != UNUSED32 )
{
if ( vertindex >= nVerts )
return E_UNEXPECTED;

vertexRemap[ vertindex ] = j;
}
}
Expand Down
7 changes: 6 additions & 1 deletion DirectXMesh/DirectXMeshVBReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ namespace DirectX
class VBReader::Impl
{
public:
Impl() : mTempSize(0) {}
Impl() :
mStrides{},
mBuffers{},
mVerts{},
mDefaultStrides{},
mTempSize(0) {}

HRESULT Initialize( _In_reads_(nDecl) const D3D11_INPUT_ELEMENT_DESC* vbDecl, size_t nDecl );
HRESULT AddStream( _In_reads_bytes_(stride*nVerts) const void* vb, size_t nVerts, size_t inputSlot, size_t stride );
Expand Down
7 changes: 6 additions & 1 deletion DirectXMesh/DirectXMeshVBWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ namespace DirectX
class VBWriter::Impl
{
public:
Impl() : mTempSize(0) {}
Impl() :
mStrides{},
mBuffers{},
mVerts{},
mDefaultStrides{},
mTempSize(0) {}

HRESULT Initialize( _In_reads_(nDecl) const D3D11_INPUT_ELEMENT_DESC* vbDecl, size_t nDecl );
HRESULT AddStream( _Out_writes_bytes_(stride*nVerts) void* vb, size_t nVerts, size_t inputSlot, size_t stride );
Expand Down

0 comments on commit 3fa7226

Please sign in to comment.