Minor code review feedback
- Don't need to use ".get()[" pattern when using std::unique_ptr<T[]> specialization
This commit is contained in:
parent
57b7c894bc
commit
27020cce7b
@ -1173,7 +1173,7 @@ static HRESULT _Generate2DMipsTriangleFilter( _In_ size_t levels, _In_ DWORD fil
|
||||
{
|
||||
size_t v = yFrom->to[ j ].u;
|
||||
assert( v < nheight );
|
||||
TriangleRow* rowAcc = &rowActive.get()[ v ];
|
||||
TriangleRow* rowAcc = &rowActive[ v ];
|
||||
|
||||
++rowAcc->remaining;
|
||||
|
||||
@ -1194,7 +1194,7 @@ static HRESULT _Generate2DMipsTriangleFilter( _In_ size_t levels, _In_ DWORD fil
|
||||
{
|
||||
size_t v = yFrom->to[ j ].u;
|
||||
assert( v < nheight );
|
||||
TriangleRow* rowAcc = &rowActive.get()[ v ];
|
||||
TriangleRow* rowAcc = &rowActive[ v ];
|
||||
|
||||
if ( !rowAcc->scanline )
|
||||
{
|
||||
@ -1260,7 +1260,7 @@ static HRESULT _Generate2DMipsTriangleFilter( _In_ size_t levels, _In_ DWORD fil
|
||||
{
|
||||
size_t v = yFrom->to[ j ].u;
|
||||
assert( v < nheight );
|
||||
TriangleRow* rowAcc = &rowActive.get()[ v ];
|
||||
TriangleRow* rowAcc = &rowActive[ v ];
|
||||
|
||||
assert( rowAcc->remaining > 0 );
|
||||
--rowAcc->remaining;
|
||||
@ -2320,7 +2320,7 @@ static HRESULT _Generate3DMipsTriangleFilter( _In_ size_t depth, _In_ size_t lev
|
||||
{
|
||||
size_t w = zFrom->to[ j ].u;
|
||||
assert( w < ndepth );
|
||||
TriangleRow* sliceAcc = &sliceActive.get()[ w ];
|
||||
TriangleRow* sliceAcc = &sliceActive[ w ];
|
||||
|
||||
++sliceAcc->remaining;
|
||||
|
||||
@ -2342,7 +2342,7 @@ static HRESULT _Generate3DMipsTriangleFilter( _In_ size_t depth, _In_ size_t lev
|
||||
{
|
||||
size_t w = zFrom->to[ j ].u;
|
||||
assert( w < ndepth );
|
||||
TriangleRow* sliceAcc = &sliceActive.get()[ w ];
|
||||
TriangleRow* sliceAcc = &sliceActive[ w ];
|
||||
|
||||
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;
|
||||
assert( w < ndepth );
|
||||
TriangleRow* sliceAcc = &sliceActive.get()[ w ];
|
||||
TriangleRow* sliceAcc = &sliceActive[ w ];
|
||||
|
||||
assert( sliceAcc->remaining > 0 );
|
||||
--sliceAcc->remaining;
|
||||
|
@ -649,7 +649,7 @@ static HRESULT _ResizeTriangleFilter( _In_ const Image& srcImage, _In_ DWORD fil
|
||||
{
|
||||
size_t v = yFrom->to[ j ].u;
|
||||
assert( v < destImage.height );
|
||||
++rowActive.get()[ v ].remaining;
|
||||
++rowActive[ v ].remaining;
|
||||
}
|
||||
|
||||
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;
|
||||
assert( v < destImage.height );
|
||||
TriangleRow* rowAcc = &rowActive.get()[ v ];
|
||||
TriangleRow* rowAcc = &rowActive[ v ];
|
||||
|
||||
if ( !rowAcc->scanline )
|
||||
{
|
||||
@ -734,7 +734,7 @@ static HRESULT _ResizeTriangleFilter( _In_ const Image& srcImage, _In_ DWORD fil
|
||||
{
|
||||
size_t v = yFrom->to[ j ].u;
|
||||
assert( v < destImage.height );
|
||||
TriangleRow* rowAcc = &rowActive.get()[ v ];
|
||||
TriangleRow* rowAcc = &rowActive[ v ];
|
||||
|
||||
assert( rowAcc->remaining > 0 );
|
||||
--rowAcc->remaining;
|
||||
|
@ -20,9 +20,9 @@
|
||||
//---------------------------------------------------------------------------------
|
||||
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); } };
|
||||
|
Loading…
Reference in New Issue
Block a user