Checkorder tool to keep functions in original binary order (#228)

* First commit of order tool

* More flexible match on module name. Bugfix on blank_or_comment

* Report inexact offset comments in verbose mode. Bugfix for exact regex

* Refactor checkorder into reusable isledecomp module

* Find bad comments in one pass, add awareness of TEMPLATE

* Refactor of state machine to prepare for reccmp integration

* Use isledecomp lib in reccmp

* Build isledecomp in GH actions, fix mypy complaint

* Ensure unit test cpp files will be ignored by reccmp

* Allow multiple offset markers, pep8 cleanup

* Remove unused variable

* Code style, remove unneeded module and TODO

* Final renaming and type hints

* Fix checkorder issues, add GH action and enforce (#2)

* Fix checkorder issues

* Add GH action

* Test error case

* Works

* Fixes

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
MS
2023-11-21 03:44:45 -05:00
committed by GitHub
parent 714d36b57d
commit 1ae3b07dc2
84 changed files with 4021 additions and 3209 deletions

View File

@@ -44,6 +44,47 @@ MxNotificationManager::~MxNotificationManager()
TickleManager()->UnregisterClient(this);
}
// OFFSET: LEGO1 0x100ac600
MxResult MxNotificationManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
{
MxResult result = SUCCESS;
m_queue = new MxNotificationPtrList();
if (m_queue == NULL) {
result = FAILURE;
}
else {
TickleManager()->RegisterClient(this, 10);
}
return result;
}
// OFFSET: LEGO1 0x100ac6c0
MxResult MxNotificationManager::Send(MxCore* p_listener, MxNotificationParam* p_param)
{
MxAutoLocker lock(&m_lock);
if (m_active == FALSE) {
return FAILURE;
}
else {
MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it == m_listenerIds.end()) {
return FAILURE;
}
else {
MxNotification* notif = new MxNotification(p_listener, p_param);
if (notif != NULL) {
m_queue->push_back(notif);
return SUCCESS;
}
}
}
return FAILURE;
}
// OFFSET: LEGO1 0x100ac800
MxResult MxNotificationManager::Tickle()
{
@@ -73,47 +114,6 @@ MxResult MxNotificationManager::Tickle()
}
}
// OFFSET: LEGO1 0x100ac600
MxResult MxNotificationManager::Create(MxU32 p_frequencyMS, MxBool p_createThread)
{
MxResult result = SUCCESS;
m_queue = new MxNotificationPtrList();
if (m_queue == NULL) {
result = FAILURE;
}
else {
TickleManager()->RegisterClient(this, 10);
}
return result;
}
// OFFSET: LEGO1 0x100acd20
void MxNotificationManager::Register(MxCore* p_listener)
{
MxAutoLocker lock(&m_lock);
MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it != m_listenerIds.end())
return;
m_listenerIds.push_back(p_listener->GetId());
}
// OFFSET: LEGO1 0x100acdf0
void MxNotificationManager::Unregister(MxCore* p_listener)
{
MxAutoLocker lock(&m_lock);
MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it != m_listenerIds.end()) {
m_listenerIds.erase(it);
FlushPending(p_listener);
}
}
// OFFSET: LEGO1 0x100ac990
void MxNotificationManager::FlushPending(MxCore* p_listener)
{
@@ -163,27 +163,27 @@ void MxNotificationManager::FlushPending(MxCore* p_listener)
}
}
// OFFSET: LEGO1 0x100ac6c0
MxResult MxNotificationManager::Send(MxCore* p_listener, MxNotificationParam* p_param)
// OFFSET: LEGO1 0x100acd20
void MxNotificationManager::Register(MxCore* p_listener)
{
MxAutoLocker lock(&m_lock);
if (m_active == FALSE) {
return FAILURE;
}
else {
MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it == m_listenerIds.end()) {
return FAILURE;
}
else {
MxNotification* notif = new MxNotification(p_listener, p_param);
if (notif != NULL) {
m_queue->push_back(notif);
return SUCCESS;
}
}
}
MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it != m_listenerIds.end())
return;
return FAILURE;
m_listenerIds.push_back(p_listener->GetId());
}
// OFFSET: LEGO1 0x100acdf0
void MxNotificationManager::Unregister(MxCore* p_listener)
{
MxAutoLocker lock(&m_lock);
MxIdList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it != m_listenerIds.end()) {
m_listenerIds.erase(it);
FlushPending(p_listener);
}
}