mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-26 09:54:18 +00:00
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:
committed by
GitHub
parent
97d1ba7c71
commit
9e686e2a87
@@ -16,17 +16,20 @@ MxDSSubscriber::MxDSSubscriber()
|
||||
// FUNCTION: LEGO1 0x100b7e00
|
||||
MxDSSubscriber::~MxDSSubscriber()
|
||||
{
|
||||
if (m_controller)
|
||||
if (m_controller) {
|
||||
m_controller->RemoveSubscriber(this);
|
||||
}
|
||||
|
||||
DeleteChunks();
|
||||
|
||||
if (m_pendingChunkCursor)
|
||||
if (m_pendingChunkCursor) {
|
||||
delete m_pendingChunkCursor;
|
||||
}
|
||||
m_pendingChunkCursor = NULL;
|
||||
|
||||
if (m_consumedChunkCursor)
|
||||
if (m_consumedChunkCursor) {
|
||||
delete m_consumedChunkCursor;
|
||||
}
|
||||
m_consumedChunkCursor = NULL;
|
||||
}
|
||||
|
||||
@@ -36,17 +39,20 @@ MxResult MxDSSubscriber::Create(MxStreamController* p_controller, MxU32 p_object
|
||||
m_objectId = p_objectId;
|
||||
m_unk0x48 = p_unk0x48;
|
||||
|
||||
if (!p_controller)
|
||||
if (!p_controller) {
|
||||
return FAILURE;
|
||||
}
|
||||
m_controller = p_controller;
|
||||
|
||||
m_pendingChunkCursor = new MxStreamChunkListCursor(&m_pendingChunks);
|
||||
if (!m_pendingChunkCursor)
|
||||
if (!m_pendingChunkCursor) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
m_consumedChunkCursor = new MxStreamChunkListCursor(&m_consumedChunks);
|
||||
if (!m_consumedChunkCursor)
|
||||
if (!m_consumedChunkCursor) {
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
m_controller->AddSubscriber(this);
|
||||
return SUCCESS;
|
||||
@@ -74,10 +80,12 @@ void MxDSSubscriber::DeleteChunks()
|
||||
MxResult MxDSSubscriber::AddChunk(MxStreamChunk* p_chunk, MxBool p_append)
|
||||
{
|
||||
if (m_pendingChunkCursor) {
|
||||
if (p_append)
|
||||
if (p_append) {
|
||||
m_pendingChunks.Append(p_chunk);
|
||||
else
|
||||
}
|
||||
else {
|
||||
m_pendingChunks.Prepend(p_chunk);
|
||||
}
|
||||
}
|
||||
|
||||
return SUCCESS;
|
||||
@@ -88,8 +96,9 @@ MxStreamChunk* MxDSSubscriber::NextChunk()
|
||||
{
|
||||
MxStreamChunk* chunk = NULL;
|
||||
|
||||
if (m_pendingChunkCursor)
|
||||
if (m_pendingChunkCursor) {
|
||||
m_pendingChunkCursor->First(chunk);
|
||||
}
|
||||
|
||||
if (chunk) {
|
||||
m_pendingChunkCursor->Detach();
|
||||
@@ -104,8 +113,9 @@ MxStreamChunk* MxDSSubscriber::CurrentChunk()
|
||||
{
|
||||
MxStreamChunk* chunk = NULL;
|
||||
|
||||
if (m_pendingChunkCursor)
|
||||
if (m_pendingChunkCursor) {
|
||||
m_pendingChunkCursor->First(chunk);
|
||||
}
|
||||
|
||||
return chunk;
|
||||
}
|
||||
@@ -116,10 +126,12 @@ void MxDSSubscriber::DestroyChunk(MxStreamChunk* p_chunk)
|
||||
if (p_chunk) {
|
||||
if (m_consumedChunkCursor->Find(p_chunk)) {
|
||||
m_consumedChunkCursor->Detach();
|
||||
if (p_chunk)
|
||||
if (p_chunk) {
|
||||
delete p_chunk;
|
||||
}
|
||||
}
|
||||
else if (p_chunk->GetFlags() & MxDSChunk::c_bit1 && p_chunk)
|
||||
else if (p_chunk->GetFlags() & MxDSChunk::c_bit1 && p_chunk) {
|
||||
delete p_chunk;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user