VS 2017 (15.7 preview) /analyze cleanup

This commit is contained in:
Chuck Walbourn
2018-03-29 10:17:31 -07:00
parent 327586970d
commit 4724707546
10 changed files with 28 additions and 25 deletions

View File

@@ -451,8 +451,8 @@ namespace
public:
INTColor() = default;
INTColor(int nr, int ng, int nb) { r = nr; g = ng; b = nb; }
INTColor(const INTColor& c) { r = c.r; g = c.g; b = c.b; }
INTColor(int nr, int ng, int nb) : pad(0) { r = nr; g = ng; b = nb; }
INTColor(const INTColor& c) : pad(0) { r = c.r; g = c.g; b = c.b; }
INTColor operator - (_In_ const INTColor& c) const
{

View File

@@ -79,10 +79,12 @@ namespace
}
};
GPUCompressBC::GPUCompressBC() :
GPUCompressBC::GPUCompressBC() DIRECTX_NOEXCEPT :
m_bcformat(DXGI_FORMAT_UNKNOWN),
m_srcformat(DXGI_FORMAT_UNKNOWN),
m_alphaWeight(1.f),
m_bc7_mode02(false),
m_bc7_mode137(false),
m_width(0),
m_height(0)
{

View File

@@ -15,7 +15,7 @@ namespace DirectX
class GPUCompressBC
{
public:
GPUCompressBC();
GPUCompressBC() DIRECTX_NOEXCEPT;
HRESULT Initialize(_In_ ID3D11Device* pDevice);

View File

@@ -35,6 +35,13 @@
struct IWICImagingFactory;
struct IWICMetadataQueryReader;
#ifndef DIRECTX_NOEXCEPT
#if defined(_MSC_VER) && (_MSC_VER < 1900)
#define DIRECTX_NOEXCEPT
#else
#define DIRECTX_NOEXCEPT noexcept
#endif
#endif
namespace DirectX
{
@@ -257,13 +264,13 @@ namespace DirectX
class ScratchImage
{
public:
ScratchImage()
ScratchImage() DIRECTX_NOEXCEPT
: m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) {}
ScratchImage(ScratchImage&& moveFrom)
ScratchImage(ScratchImage&& moveFrom) DIRECTX_NOEXCEPT
: m_nimages(0), m_size(0), m_metadata{}, m_image(nullptr), m_memory(nullptr) { *this = std::move(moveFrom); }
~ScratchImage() { Release(); }
ScratchImage& __cdecl operator= (ScratchImage&& moveFrom);
ScratchImage& __cdecl operator= (ScratchImage&& moveFrom) DIRECTX_NOEXCEPT;
ScratchImage(const ScratchImage&) = delete;
ScratchImage& operator=(const ScratchImage&) = delete;
@@ -308,11 +315,11 @@ namespace DirectX
class Blob
{
public:
Blob() : m_buffer(nullptr), m_size(0) {}
Blob(Blob&& moveFrom) : m_buffer(nullptr), m_size(0) { *this = std::move(moveFrom); }
Blob() DIRECTX_NOEXCEPT : m_buffer(nullptr), m_size(0) {}
Blob(Blob&& moveFrom) DIRECTX_NOEXCEPT : m_buffer(nullptr), m_size(0) { *this = std::move(moveFrom); }
~Blob() { Release(); }
Blob& __cdecl operator= (Blob&& moveFrom);
Blob& __cdecl operator= (Blob&& moveFrom) DIRECTX_NOEXCEPT;
Blob(const Blob&) = delete;
Blob& operator=(const Blob&) = delete;

View File

@@ -4429,7 +4429,7 @@ namespace
if (FAILED(hr))
return hr;
hr = FC->Initialize(source.Get(), targetGUID, _GetWICDither(filter), nullptr, threshold * 100.f, WICBitmapPaletteTypeMedianCut);
hr = FC->Initialize(source.Get(), targetGUID, _GetWICDither(filter), nullptr, threshold * 100.0, WICBitmapPaletteTypeMedianCut);
if (FAILED(hr))
return hr;

View File

@@ -234,7 +234,7 @@ bool DirectX::_SetupImageArray(
// ScratchImage - Bitmap image container
//=====================================================================================
ScratchImage& ScratchImage::operator= (ScratchImage&& moveFrom)
ScratchImage& ScratchImage::operator= (ScratchImage&& moveFrom) DIRECTX_NOEXCEPT
{
if (this != &moveFrom)
{

View File

@@ -116,12 +116,6 @@
#define XBOX_DXGI_FORMAT_R4G4_UNORM DXGI_FORMAT(190)
#if !defined(DIRECTX_NOEXCEPT) && defined(_MSC_VER) && (_MSC_VER < 1900)
#define DIRECTX_NOEXCEPT
#else
#define DIRECTX_NOEXCEPT noexcept
#endif
namespace DirectX
{
//---------------------------------------------------------------------------------

View File

@@ -1413,7 +1413,7 @@ size_t TexMetadata::ComputeIndex(size_t mip, size_t item, size_t slice) const
// Blob - Bitmap image container
//=====================================================================================
Blob& Blob::operator= (Blob&& moveFrom)
Blob& Blob::operator= (Blob&& moveFrom) DIRECTX_NOEXCEPT
{
if (this != &moveFrom)
{

View File

@@ -237,7 +237,7 @@ namespace TriangleFilter
TriangleRow* next;
ScopedAlignedArrayXMVECTOR scanline;
TriangleRow() : remaining(0), next(nullptr) {}
TriangleRow() DIRECTX_NOEXCEPT : remaining(0), next(nullptr) {}
};
static const size_t TF_FILTER_SIZE = sizeof(Filter) - sizeof(FilterFrom);