(Proposal) Introduction of naming convention checker (ncc) (#322)

* Add ncc tool

* Add symlink

* Fixes

* Try this

* Try this

* Try this

* Try this

* Add include path

* Update style

* Update style

* Add more rules

* Fix style

* Update styles

* Fix name parameter

* Fix MxParam p

* Fix m_unk0x pattern

* Allow 4 digits for relative hex

* Add missing offset

* Fix some parameters

* Fix some vtables

* Fix more vtables

* Update rules, fixes

* More fixes

* More fixes

* More fixes

* More fixes

* More fixes

* More fixes

* More fixes

* Fix last issue

* Update readme

* Update readme

* Update CONTRIBUTING.md

* Fix annotations

* Rename

* Update CONTRIBUTING.md

* Update README.md
This commit is contained in:
Christian Semmler
2023-12-13 05:48:14 -05:00
committed by GitHub
parent 3b155bfe38
commit bc5ca621a4
303 changed files with 2592 additions and 1844 deletions

View File

@@ -17,20 +17,20 @@ MxString::MxString()
}
// FUNCTION: LEGO1 0x100ae2a0
MxString::MxString(const MxString& str)
MxString::MxString(const MxString& p_str)
{
this->m_length = str.m_length;
this->m_length = p_str.m_length;
this->m_data = new char[this->m_length + 1];
strcpy(this->m_data, str.m_data);
strcpy(this->m_data, p_str.m_data);
}
// FUNCTION: LEGO1 0x100ae350
MxString::MxString(const char* str)
MxString::MxString(const char* p_str)
{
if (str) {
this->m_length = strlen(str);
if (p_str) {
this->m_length = strlen(p_str);
this->m_data = new char[this->m_length + 1];
strcpy(this->m_data, str);
strcpy(this->m_data, p_str);
}
else {
this->m_data = new char[1];
@@ -58,26 +58,26 @@ void MxString::ToLowerCase()
}
// FUNCTION: LEGO1 0x100ae4b0
MxString& MxString::operator=(const MxString& param)
MxString& MxString::operator=(const MxString& p_str)
{
if (this->m_data != param.m_data) {
if (this->m_data != p_str.m_data) {
delete[] this->m_data;
this->m_length = param.m_length;
this->m_length = p_str.m_length;
this->m_data = new char[this->m_length + 1];
strcpy(this->m_data, param.m_data);
strcpy(this->m_data, p_str.m_data);
}
return *this;
}
// FUNCTION: LEGO1 0x100ae510
const MxString& MxString::operator=(const char* param)
const MxString& MxString::operator=(const char* p_data)
{
if (this->m_data != param) {
if (this->m_data != p_data) {
delete[] this->m_data;
this->m_length = strlen(param);
this->m_length = strlen(p_data);
this->m_data = new char[this->m_length + 1];
strcpy(this->m_data, param);
strcpy(this->m_data, p_data);
}
return *this;
@@ -86,29 +86,29 @@ const MxString& MxString::operator=(const char* param)
// Return type is intentionally just MxString, not MxString&.
// This forces MSVC to add $ReturnUdt$ to the stack for 100% match.
// FUNCTION: LEGO1 0x100ae580
MxString MxString::operator+(const char* str)
MxString MxString::operator+(const char* p_str)
{
// MxString constructor allocates 1 byte for m_data, so free that first
MxString tmp;
delete[] tmp.m_data;
tmp.m_length = strlen(str) + this->m_length;
tmp.m_length = strlen(p_str) + this->m_length;
tmp.m_data = new char[tmp.m_length + 1];
strcpy(tmp.m_data, this->m_data);
strcpy(tmp.m_data + this->m_length, str);
strcpy(tmp.m_data + this->m_length, p_str);
return MxString(tmp);
}
// FUNCTION: LEGO1 0x100ae690
MxString& MxString::operator+=(const char* str)
MxString& MxString::operator+=(const char* p_str)
{
int newlen = this->m_length + strlen(str);
int newlen = this->m_length + strlen(p_str);
char* tmp = new char[newlen + 1];
strcpy(tmp, this->m_data);
strcpy(tmp + this->m_length, str);
strcpy(tmp + this->m_length, p_str);
delete[] this->m_data;
this->m_length = newlen;