1
0
mirror of https://github.com/microsoft/DirectXTex synced 2025-01-12 10:40:15 +00:00

Minor code review feedback

- Don't need to use ".get()[" pattern when using std::unique_ptr<T[]> specialization
This commit is contained in:
walbourn_cp 2014-11-20 13:44:59 -08:00
parent 57b7c894bc
commit 27020cce7b
3 changed files with 11 additions and 11 deletions

View File

@ -1173,7 +1173,7 @@ static HRESULT _Generate2DMipsTriangleFilter( _In_ size_t levels, _In_ DWORD fil
{ {
size_t v = yFrom->to[ j ].u; size_t v = yFrom->to[ j ].u;
assert( v < nheight ); assert( v < nheight );
TriangleRow* rowAcc = &rowActive.get()[ v ]; TriangleRow* rowAcc = &rowActive[ v ];
++rowAcc->remaining; ++rowAcc->remaining;
@ -1194,7 +1194,7 @@ static HRESULT _Generate2DMipsTriangleFilter( _In_ size_t levels, _In_ DWORD fil
{ {
size_t v = yFrom->to[ j ].u; size_t v = yFrom->to[ j ].u;
assert( v < nheight ); assert( v < nheight );
TriangleRow* rowAcc = &rowActive.get()[ v ]; TriangleRow* rowAcc = &rowActive[ v ];
if ( !rowAcc->scanline ) if ( !rowAcc->scanline )
{ {
@ -1260,7 +1260,7 @@ static HRESULT _Generate2DMipsTriangleFilter( _In_ size_t levels, _In_ DWORD fil
{ {
size_t v = yFrom->to[ j ].u; size_t v = yFrom->to[ j ].u;
assert( v < nheight ); assert( v < nheight );
TriangleRow* rowAcc = &rowActive.get()[ v ]; TriangleRow* rowAcc = &rowActive[ v ];
assert( rowAcc->remaining > 0 ); assert( rowAcc->remaining > 0 );
--rowAcc->remaining; --rowAcc->remaining;
@ -2320,7 +2320,7 @@ static HRESULT _Generate3DMipsTriangleFilter( _In_ size_t depth, _In_ size_t lev
{ {
size_t w = zFrom->to[ j ].u; size_t w = zFrom->to[ j ].u;
assert( w < ndepth ); assert( w < ndepth );
TriangleRow* sliceAcc = &sliceActive.get()[ w ]; TriangleRow* sliceAcc = &sliceActive[ w ];
++sliceAcc->remaining; ++sliceAcc->remaining;
@ -2342,7 +2342,7 @@ static HRESULT _Generate3DMipsTriangleFilter( _In_ size_t depth, _In_ size_t lev
{ {
size_t w = zFrom->to[ j ].u; size_t w = zFrom->to[ j ].u;
assert( w < ndepth ); assert( w < ndepth );
TriangleRow* sliceAcc = &sliceActive.get()[ w ]; TriangleRow* sliceAcc = &sliceActive[ w ];
if ( !sliceAcc->scanline ) if ( !sliceAcc->scanline )
{ {
@ -2432,7 +2432,7 @@ static HRESULT _Generate3DMipsTriangleFilter( _In_ size_t depth, _In_ size_t lev
{ {
size_t w = zFrom->to[ j ].u; size_t w = zFrom->to[ j ].u;
assert( w < ndepth ); assert( w < ndepth );
TriangleRow* sliceAcc = &sliceActive.get()[ w ]; TriangleRow* sliceAcc = &sliceActive[ w ];
assert( sliceAcc->remaining > 0 ); assert( sliceAcc->remaining > 0 );
--sliceAcc->remaining; --sliceAcc->remaining;

View File

@ -649,7 +649,7 @@ static HRESULT _ResizeTriangleFilter( _In_ const Image& srcImage, _In_ DWORD fil
{ {
size_t v = yFrom->to[ j ].u; size_t v = yFrom->to[ j ].u;
assert( v < destImage.height ); assert( v < destImage.height );
++rowActive.get()[ v ].remaining; ++rowActive[ v ].remaining;
} }
yFrom = reinterpret_cast<FilterFrom*>( reinterpret_cast<uint8_t*>( yFrom ) + yFrom->sizeInBytes ); yFrom = reinterpret_cast<FilterFrom*>( reinterpret_cast<uint8_t*>( yFrom ) + yFrom->sizeInBytes );
@ -669,7 +669,7 @@ static HRESULT _ResizeTriangleFilter( _In_ const Image& srcImage, _In_ DWORD fil
{ {
size_t v = yFrom->to[ j ].u; size_t v = yFrom->to[ j ].u;
assert( v < destImage.height ); assert( v < destImage.height );
TriangleRow* rowAcc = &rowActive.get()[ v ]; TriangleRow* rowAcc = &rowActive[ v ];
if ( !rowAcc->scanline ) if ( !rowAcc->scanline )
{ {
@ -734,7 +734,7 @@ static HRESULT _ResizeTriangleFilter( _In_ const Image& srcImage, _In_ DWORD fil
{ {
size_t v = yFrom->to[ j ].u; size_t v = yFrom->to[ j ].u;
assert( v < destImage.height ); assert( v < destImage.height );
TriangleRow* rowAcc = &rowActive.get()[ v ]; TriangleRow* rowAcc = &rowActive[ v ];
assert( rowAcc->remaining > 0 ); assert( rowAcc->remaining > 0 );
--rowAcc->remaining; --rowAcc->remaining;

View File

@ -20,9 +20,9 @@
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
struct aligned_deleter { void operator()(void* p) { _aligned_free(p); } }; struct aligned_deleter { void operator()(void* p) { _aligned_free(p); } };
typedef std::unique_ptr<float, aligned_deleter> ScopedAlignedArrayFloat; typedef std::unique_ptr<float[], aligned_deleter> ScopedAlignedArrayFloat;
typedef std::unique_ptr<DirectX::XMVECTOR, aligned_deleter> ScopedAlignedArrayXMVECTOR; typedef std::unique_ptr<DirectX::XMVECTOR[], aligned_deleter> ScopedAlignedArrayXMVECTOR;
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } }; struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } };