cmake+ci: run clang-tidy (#512)

* cmake+ci: run clang-tidy

* Remove DESCRIPTION from LEGO1/LegoOmni.mingw.def

* Add initial .clang-tidy and fixes

* fix file perms

* Comment out DESCRIPTION

* Remove LegoEntity::~LegoEntity and MxPresenter::~MxPresenter from mingw's LEGO1.def

* Looks like clang is allergic to the libs in the directx5 SDK

* Update .clang-tidy

* Fix typo in .clang-tidy

* Attempt to generate an action error

* Revert "Attempt to generate an action error"

This reverts commit 96c4c65fed.

* cmake: test with -Wparentheses + optionally with -Werror

* ci: -k0 is a Ninja argument

* Use -Werror only for msys2 builds

* cmake: only emit warnings for specific warnings

* cmake: and don't do -Werror/-WX anymore

* Fix warnings

* Fix mingw warnings

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Anonymous Maarten
2024-02-01 21:42:10 +01:00
committed by GitHub
parent 97d1ba7c71
commit 9e686e2a87
308 changed files with 2863 additions and 1995 deletions

View File

@@ -72,8 +72,9 @@ MxU16 MXIOINFO::Close(MxLong p_unused)
_lclose((HFILE) m_info.hmmio);
m_info.hmmio = 0;
if (m_info.dwFlags & MMIO_ALLOCBUF)
if (m_info.dwFlags & MMIO_ALLOCBUF) {
delete[] m_info.pchBuffer;
}
m_info.pchEndWrite = 0;
m_info.pchEndRead = 0;
@@ -95,8 +96,9 @@ MxLong MXIOINFO::Read(void* p_buf, MxLong p_len)
while (p_len > 0) {
if (bytesLeft > 0) {
if (p_len < bytesLeft)
if (p_len < bytesLeft) {
bytesLeft = p_len;
}
memcpy(p_buf, m_info.pchNext, bytesLeft);
p_len -= bytesLeft;
@@ -105,12 +107,14 @@ MxLong MXIOINFO::Read(void* p_buf, MxLong p_len)
bytesRead += bytesLeft;
}
if (p_len <= 0 || Advance(0))
if (p_len <= 0 || Advance(0)) {
break;
}
bytesLeft = m_info.pchEndRead - m_info.pchNext;
if (bytesLeft <= 0)
if (bytesLeft <= 0) {
break;
}
}
}
else if (m_info.hmmio && p_len > 0) {
@@ -381,8 +385,9 @@ MxU16 MXIOINFO::Descend(MMCKINFO* p_chunkInfo, const MMCKINFO* p_parentInfo, MxU
{
MxU16 result = 0;
if (!p_chunkInfo)
if (!p_chunkInfo) {
return MMIOERR_BASE; // ?
}
if (!p_descend) {
p_chunkInfo->dwFlags = 0;
@@ -406,8 +411,9 @@ MxU16 MXIOINFO::Descend(MMCKINFO* p_chunkInfo, const MMCKINFO* p_parentInfo, MxU
else {
MxULong ofs = MAXLONG;
if (p_parentInfo)
if (p_parentInfo) {
ofs = p_parentInfo->cksize + p_parentInfo->dwDataOffset;
}
BOOL running = TRUE;
BOOL readOk = FALSE;
@@ -452,8 +458,9 @@ MxU16 MXIOINFO::Descend(MMCKINFO* p_chunkInfo, const MMCKINFO* p_parentInfo, MxU
}
}
if (!result)
if (!result) {
memcpy(p_chunkInfo, &tmp, sizeof(MMCKINFO));
}
}
return result;