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

@@ -164,19 +164,22 @@ MxResult MxDSBuffer::FUN_100c67b0(
MxResult result = FAILURE;
m_unk0x30 = (MxDSStreamingAction*) p_controller->GetUnk0x3c().Find(p_action, FALSE);
if (m_unk0x30 == NULL)
if (m_unk0x30 == NULL) {
return FAILURE;
}
MxU8* data;
while (data = (MxU8*) SkipToData()) {
while ((data = (MxU8*) SkipToData())) {
if (*p_streamingAction == NULL) {
result = CreateObject(p_controller, (MxU32*) data, p_action, p_streamingAction);
if (result == FAILURE)
if (result == FAILURE) {
return result;
}
// TODO: Not a MxResult value?
if (result == 1)
if (result == 1) {
break;
}
}
else {
MxDSBuffer* buffer = (*p_streamingAction)->GetUnknowna0();
@@ -226,8 +229,9 @@ MxResult MxDSBuffer::CreateObject(
return FAILURE;
}
if (*p_data == FOURCC('M', 'x', 'O', 'b'))
if (*p_data == FOURCC('M', 'x', 'O', 'b')) {
return StartPresenterFromAction(p_controller, p_action, (MxDSAction*) header);
}
else if (*p_data == FOURCC('M', 'x', 'C', 'h')) {
MxStreamChunk* chunk = (MxStreamChunk*) header;
if (!m_unk0x30->HasId((chunk)->GetObjectId())) {
@@ -316,8 +320,9 @@ MxResult MxDSBuffer::ParseChunk(
}
}
if (buffer)
if (buffer) {
delete buffer;
}
delete p_header;
return FAILURE;
@@ -337,8 +342,9 @@ MxResult MxDSBuffer::ParseChunk(
MxNextActionDataStart* data =
p_controller->FindNextActionDataStartFromStreamingAction(m_unk0x30);
if (data)
if (data) {
data->SetData(m_unk0x30->GetBufferOffset());
}
m_unk0x30->FUN_100cd2d0();
}
@@ -472,8 +478,9 @@ MxResult MxDSBuffer::CalcBytesRemaining(MxU8* p_data)
if (bytesRead <= m_bytesRemaining) {
memcpy(m_pBuffer + m_writeOffset - m_bytesRemaining, ptr, bytesRead);
if (m_writeOffset == m_bytesRemaining)
if (m_writeOffset == m_bytesRemaining) {
*(MxU32*) (m_pBuffer + 4) = *MxStreamChunk::IntoLength(m_pBuffer) + MxStreamChunk::GetHeaderSize();
}
m_bytesRemaining -= bytesRead;
result = SUCCESS;
@@ -510,8 +517,9 @@ MxU8* MxDSBuffer::FUN_100c6fa0(MxU8* p_data)
break;
case FOURCC('M', 'x', 'O', 'b'):
case FOURCC('M', 'x', 'C', 'h'):
if (current != p_data)
if (current != p_data) {
return current;
}
current = ((MxU32) current & 1) + current;
current += 8;
break;