mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-09 19:50:13 +02:00
Fixed /analyze warnings
This commit is contained in:
parent
5a3659ff99
commit
77f1a6fc86
@ -1611,15 +1611,23 @@ bool DirectX::_StoreScanline(
|
|||||||
size_t count,
|
size_t count,
|
||||||
float threshold) noexcept
|
float threshold) noexcept
|
||||||
{
|
{
|
||||||
assert(pDestination && size > 0);
|
assert(pDestination != nullptr);
|
||||||
assert(pSource && count > 0 && ((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0));
|
|
||||||
assert(IsValid(format) && !IsTypeless(format) && !IsCompressed(format) && !IsPlanar(format) && !IsPalettized(format));
|
assert(IsValid(format) && !IsTypeless(format) && !IsCompressed(format) && !IsPlanar(format) && !IsPalettized(format));
|
||||||
|
|
||||||
|
if (!size || !count)
|
||||||
|
return false;
|
||||||
|
|
||||||
const XMVECTOR* __restrict sPtr = pSource;
|
const XMVECTOR* __restrict sPtr = pSource;
|
||||||
if (!sPtr)
|
if (!sPtr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const XMVECTOR* ePtr = pSource + count;
|
assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
|
||||||
|
|
||||||
|
const XMVECTOR* ePtr = sPtr + count;
|
||||||
|
|
||||||
|
#ifdef _PREFAST_
|
||||||
|
*reinterpret_cast<uint8_t*>(pDestination) = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (static_cast<int>(format))
|
switch (static_cast<int>(format))
|
||||||
{
|
{
|
||||||
@ -2735,9 +2743,10 @@ bool DirectX::_StoreScanlineLinear(
|
|||||||
TEX_FILTER_FLAGS flags,
|
TEX_FILTER_FLAGS flags,
|
||||||
float threshold) noexcept
|
float threshold) noexcept
|
||||||
{
|
{
|
||||||
assert(pDestination && size > 0);
|
if (!pSource || !count)
|
||||||
assert(pSource && count > 0 && ((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0));
|
return false;
|
||||||
assert(IsValid(format) && !IsTypeless(format) && !IsCompressed(format) && !IsPlanar(format) && !IsPalettized(format));
|
|
||||||
|
assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
|
||||||
|
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
@ -2810,10 +2819,6 @@ bool DirectX::_LoadScanlineLinear(
|
|||||||
DXGI_FORMAT format,
|
DXGI_FORMAT format,
|
||||||
TEX_FILTER_FLAGS flags) noexcept
|
TEX_FILTER_FLAGS flags) noexcept
|
||||||
{
|
{
|
||||||
assert(pDestination && count > 0 && ((reinterpret_cast<uintptr_t>(pDestination) & 0xF) == 0));
|
|
||||||
assert(pSource && size > 0);
|
|
||||||
assert(IsValid(format) && !IsTypeless(format, false) && !IsCompressed(format) && !IsPlanar(format) && !IsPalettized(format));
|
|
||||||
|
|
||||||
switch (format)
|
switch (format)
|
||||||
{
|
{
|
||||||
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
|
||||||
@ -3909,10 +3914,18 @@ bool DirectX::_StoreScanlineDither(
|
|||||||
size_t z,
|
size_t z,
|
||||||
XMVECTOR* pDiffusionErrors) noexcept
|
XMVECTOR* pDiffusionErrors) noexcept
|
||||||
{
|
{
|
||||||
assert(pDestination && size > 0);
|
assert(pDestination != nullptr);
|
||||||
assert(pSource && count > 0 && ((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0));
|
|
||||||
assert(IsValid(format) && !IsTypeless(format) && !IsCompressed(format) && !IsPlanar(format) && !IsPalettized(format));
|
assert(IsValid(format) && !IsTypeless(format) && !IsCompressed(format) && !IsPlanar(format) && !IsPalettized(format));
|
||||||
|
|
||||||
|
if (!size || !count)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
const XMVECTOR* __restrict sPtr = pSource;
|
||||||
|
if (!sPtr)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
assert((reinterpret_cast<uintptr_t>(pSource) & 0xF) == 0);
|
||||||
|
|
||||||
XMVECTOR ordered[4];
|
XMVECTOR ordered[4];
|
||||||
if (pDiffusionErrors)
|
if (pDiffusionErrors)
|
||||||
{
|
{
|
||||||
@ -3945,12 +3958,12 @@ bool DirectX::_StoreScanlineDither(
|
|||||||
ordered[3] = XMVectorSplatW(dither);
|
ordered[3] = XMVectorSplatW(dither);
|
||||||
}
|
}
|
||||||
|
|
||||||
const XMVECTOR* __restrict sPtr = pSource;
|
|
||||||
if (!sPtr)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
const void* ePtr = static_cast<const uint8_t*>(pDestination) + size;
|
const void* ePtr = static_cast<const uint8_t*>(pDestination) + size;
|
||||||
|
|
||||||
|
#ifdef _PREFAST_
|
||||||
|
*reinterpret_cast<uint8_t*>(pDestination) = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
XMVECTOR vError = XMVectorZero();
|
XMVECTOR vError = XMVectorZero();
|
||||||
|
|
||||||
switch (static_cast<int>(format))
|
switch (static_cast<int>(format))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user