Add GitHub Action for super-lint (#618)

This commit is contained in:
Chuck Walbourn
2025-06-02 17:49:20 -07:00
committed by GitHub
parent c8959b2911
commit cb3be57e9c
78 changed files with 5040 additions and 4816 deletions

View File

@@ -153,12 +153,12 @@ namespace
SetLastError(0);
}
#if COMBINED_OPENEXR_VERSION >= 30300
#if COMBINED_OPENEXR_VERSION >= 30300
int64_t read(void *buf, uint64_t sz, uint64_t offset) override
{
return Imf::IStream::read(buf, sz, offset);
}
#endif
#endif
private:
HANDLE m_hFile;
@@ -169,7 +169,8 @@ namespace
{
public:
OutputStream(HANDLE hFile, const char fileName[]) :
OStream(fileName), m_hFile(hFile) {}
OStream(fileName), m_hFile(hFile)
{}
OutputStream(const OutputStream&) = delete;
OutputStream& operator = (const OutputStream&) = delete;
@@ -259,11 +260,11 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
try
{
#ifdef _WIN32
#ifdef _WIN32
Imf::RgbaInputFile file(stream);
#else
#else
Imf::RgbaInputFile file(fileName.c_str());
#endif
#endif
const auto dw = file.dataWindow();
@@ -293,9 +294,9 @@ HRESULT DirectX::GetMetadataFromEXRFile(const wchar_t* szFile, TexMetadata& meta
#ifdef _WIN32
catch (const com_exception& exc)
{
#ifdef _DEBUG
#ifdef _DEBUG
OutputDebugStringA(exc.what());
#endif
#endif
hr = exc.get_result();
}
#endif
@@ -368,11 +369,11 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
try
{
#ifdef _WIN32
#ifdef _WIN32
Imf::RgbaInputFile file(stream);
#else
#else
Imf::RgbaInputFile file(fileName.c_str());
#endif
#endif
const auto dw = file.dataWindow();
@@ -403,7 +404,7 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
}
hr = image.Initialize2D(DXGI_FORMAT_R16G16B16A16_FLOAT,
static_cast<size_t>(width), static_cast<size_t>(height), arraySize, 1u);
static_cast<size_t>(width), static_cast<size_t>(height), arraySize, 1u);
if (FAILED(hr))
return hr;
@@ -414,9 +415,9 @@ HRESULT DirectX::LoadFromEXRFile(const wchar_t* szFile, TexMetadata* metadata, S
#ifdef _WIN32
catch (const com_exception& exc)
{
#ifdef _DEBUG
#ifdef _DEBUG
OutputDebugStringA(exc.what());
#endif
#endif
hr = exc.get_result();
}
#endif
@@ -514,11 +515,11 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
const auto width = static_cast<int>(image.width);
const auto height = static_cast<int>(image.height);
#ifdef _WIN32
#ifdef _WIN32
Imf::RgbaOutputFile file(stream, Imf::Header(width, height), Imf::WRITE_RGBA);
#else
#else
Imf::RgbaOutputFile file(fileName.c_str(), Imf::Header(width, height), Imf::WRITE_RGBA);
#endif
#endif
if (image.format == DXGI_FORMAT_R16G16B16A16_FLOAT)
{
@@ -586,9 +587,9 @@ HRESULT DirectX::SaveToEXRFile(const Image& image, const wchar_t* szFile)
#ifdef _WIN32
catch (const com_exception& exc)
{
#ifdef _DEBUG
#ifdef _DEBUG
OutputDebugStringA(exc.what());
#endif
#endif
hr = exc.get_result();
}
#endif

View File

@@ -338,11 +338,11 @@ HRESULT DirectX::GetMetadataFromJPEGFile(
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
#endif
}
catch (const std::exception&)
{
@@ -378,11 +378,11 @@ HRESULT DirectX::LoadFromJPEGFile(
catch (const std::system_error& ec)
{
image.Release();
#ifdef _WIN32
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
#endif
}
catch (const std::exception&)
{
@@ -412,11 +412,11 @@ HRESULT DirectX::SaveToJPEGFile(
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
#endif
}
catch (const std::exception&)
{

View File

@@ -334,11 +334,11 @@ HRESULT DirectX::GetMetadataFromPNGFile(
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
#endif
}
catch (const std::invalid_argument&)
{
@@ -379,11 +379,11 @@ HRESULT DirectX::LoadFromPNGFile(
catch (const std::system_error& ec)
{
image.Release();
#ifdef _WIN32
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
#endif
}
catch (const std::invalid_argument&)
{
@@ -417,11 +417,11 @@ HRESULT DirectX::SaveToPNGFile(
}
catch (const std::system_error& ec)
{
#ifdef _WIN32
#ifdef _WIN32
return HRESULT_FROM_WIN32(static_cast<unsigned long>(ec.code().value()));
#else
#else
return (ec.code().value() == ENOENT) ? HRESULT_ERROR_FILE_NOT_FOUND : E_FAIL;
#endif
#endif
}
catch (const std::exception&)
{

View File

@@ -62,9 +62,13 @@ namespace Xbox
{
public:
XboxImage() noexcept
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr) {}
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr)
{}
XboxImage(XboxImage&& moveFrom) noexcept
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr) { *this = std::move(moveFrom); }
: dataSize(0), baseAlignment(0), tilemode(c_XboxTileModeInvalid), metadata{}, memory(nullptr)
{
*this = std::move(moveFrom);
}
~XboxImage() { Release(); }
XboxImage& __cdecl operator= (XboxImage&& moveFrom) noexcept;