Revert "Add #ifdef declarations for NON_MATCHING code"

This reverts commit 42807160cf.

It makes searching for NON_MATCHING comment descriptions much less
convenient in most text editors or IDEs, and we want the function
CSV to be the single source of truth for function statuses. Having
a function marked as matching but not built because of a stray #ifdef
would be bad.
This commit is contained in:
Léo Lam
2022-02-27 12:48:28 +01:00
parent a564186002
commit df36d65665
52 changed files with 93 additions and 257 deletions
+7 -21
View File
@@ -1054,8 +1054,7 @@ void PauseMenuDataMgr::autoEquipLastAddedItem() {
}
}
// branching
#ifdef NON_MATCHING
// NON_MATCHING: branching
const sead::SafeString& PauseMenuDataMgr::autoEquip(PouchItem* item,
const sead::OffsetList<PouchItem>& list) {
const auto type = item->getType();
@@ -1086,10 +1085,8 @@ const sead::SafeString& PauseMenuDataMgr::autoEquip(PouchItem* item,
saveToGameData(list);
return sead::SafeString::cEmptyString;
}
#endif
// harmless reordering
#ifdef NON_MATCHING
// NON_MATCHING: harmless reordering
void PauseMenuDataMgr::unequipAll(PouchItemType type) {
const auto lock = sead::makeScopedLock(mCritSection);
@@ -1113,7 +1110,6 @@ void PauseMenuDataMgr::unequipAll(PouchItemType type) {
}
}
}
#endif
KSYS_ALWAYS_INLINE inline void
PauseMenuDataMgr::deleteItem_(const sead::OffsetList<PouchItem>& list, PouchItem* item,
@@ -1198,8 +1194,7 @@ void PauseMenuDataMgr::removeArrow(const sead::SafeString& arrow_name, int count
ksys::gdt::setFlag_PorchItem_Value1(num, idx);
}
// branch merging -- but this is pretty clearly equivalent
#ifdef NON_MATCHING
// NON_MATCHING: branch merging -- but this is pretty clearly equivalent
int PauseMenuDataMgr::getItemCount(const sead::SafeString& name, bool count_equipped) const {
const auto type = getType(name);
if (isPouchItemInvalid(type))
@@ -1266,7 +1261,6 @@ int PauseMenuDataMgr::getItemCount(const sead::SafeString& name, bool count_equi
}
return count;
}
#endif
void PauseMenuDataMgr::setEquippedWeaponItemValue(s32 value, PouchItemType type) {
if (isPouchItemNotWeapon(type))
@@ -1344,8 +1338,7 @@ void PauseMenuDataMgr::removeGrabbedItems() {
saveToGameData(items);
}
// mostly branching (which leads to other differences), but visibly equivalent
#ifdef NON_MATCHING
// NON_MATCHING: mostly branching (which leads to other differences), but visibly equivalent
bool PauseMenuDataMgr::addGrabbedItem(ksys::act::BaseProcLink* link) {
if (!link || !link->hasProc())
return false;
@@ -1385,7 +1378,6 @@ bool PauseMenuDataMgr::addGrabbedItem(ksys::act::BaseProcLink* link) {
mGrabbedItems[4] = {};
return found;
}
#endif
bool PauseMenuDataMgr::getEquippedArrowType(sead::BufferedSafeString* name, int* count) const {
const auto lock = sead::makeScopedLock(mCritSection);
@@ -1656,8 +1648,7 @@ PouchCategory PauseMenuDataMgr::getCategoryForType(PouchItemType type) const {
}
}
// two harmless reorderings
#ifdef NON_MATCHING
// NON_MATCHING: two harmless reorderings
void PauseMenuDataMgr::removeCookResult(const sead::SafeString& name, s32 effect_type,
bool check_effect) {
auto* info = ksys::act::InfoData::instance();
@@ -1716,7 +1707,6 @@ void PauseMenuDataMgr::removeCookResult(const sead::SafeString& name, s32 effect
updateInventoryInfo(items);
updateListHeads();
}
#endif
bool PauseMenuDataMgr::switchEquipment(const sead::SafeString& name, int* value,
act::WeaponModifierInfo* modifier) {
@@ -2203,8 +2193,7 @@ int pouchItemSortPredicateForArrow(const PouchItem* lhs, const PouchItem* rhs) {
return (*fn)(lhs, rhs, info_data);
}
// branching, but this is so trivial it isn't worth spending time on matching this
#ifdef NON_MATCHING
// NON_MATCHING: branching, but this is so trivial it isn't worth spending time on matching this
const sead::SafeString* PauseMenuDataMgr::getEquippedItemName(PouchItemType type) const {
const auto lock = sead::makeScopedLock(mCritSection);
const auto& items = getItems();
@@ -2219,7 +2208,6 @@ const sead::SafeString* PauseMenuDataMgr::getEquippedItemName(PouchItemType type
}
return nullptr;
}
#endif
const PouchItem* PauseMenuDataMgr::getEquippedItem(PouchItemType type) const {
const auto lock = sead::makeScopedLock(mCritSection);
@@ -2556,8 +2544,7 @@ bool PauseMenuDataMgr::isOverCategoryLimit(PouchItemType type) const {
return true;
}
// branching (really weird issue...)
#ifdef NON_MATCHING
// NON_MATCHING: branching (really weird issue...)
int PauseMenuDataMgr::countArmors(const sead::SafeString& lowest_rank_armor_name) const {
if (!isPouchItemArmor(getType(lowest_rank_armor_name)))
return 0;
@@ -2584,7 +2571,6 @@ int PauseMenuDataMgr::countArmors(const sead::SafeString& lowest_rank_armor_name
}
return count;
}
#endif
void PauseMenuDataMgr::addNonDefaultItem(const sead::SafeString& name, int value,
const act::WeaponModifierInfo* modifier) {