lint: Enforce empty parameters instead of (void) (#78)

This commit is contained in:
MonsterDruide1 2024-06-09 02:18:27 +02:00 committed by GitHub
parent cb02cdaed8
commit ab7ef8a94d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
13 changed files with 53 additions and 45 deletions

View File

@ -21,31 +21,31 @@ void LayoutActor::initLayoutPartsActorKeeper(s32 capacity) {
void LayoutActor::initLayoutKeeper(LayoutKeeper* layoutKeeper) {
mLayoutKeeper = layoutKeeper;
}
NerveKeeper* LayoutActor::getNerveKeeper(void) const {
NerveKeeper* LayoutActor::getNerveKeeper() const {
return mNerveKeeper;
}
const char* LayoutActor::getName(void) const {
const char* LayoutActor::getName() const {
return mName.cstr();
}
EffectKeeper* LayoutActor::getEffectKeeper(void) const {
EffectKeeper* LayoutActor::getEffectKeeper() const {
return mEffectKeeper;
}
AudioKeeper* LayoutActor::getAudioKeeper(void) const {
AudioKeeper* LayoutActor::getAudioKeeper() const {
return mAudioKeeper;
}
LayoutActionKeeper* LayoutActor::getLayoutActionKeeper(void) const {
LayoutActionKeeper* LayoutActor::getLayoutActionKeeper() const {
return mLayoutActionKeeper;
}
LayoutKeeper* LayoutActor::getLayoutKeeper(void) const {
LayoutKeeper* LayoutActor::getLayoutKeeper() const {
return mLayoutKeeper;
}
CameraDirector* LayoutActor::getCameraDirector(void) const {
CameraDirector* LayoutActor::getCameraDirector() const {
return mLayoutSceneInfo->getCameraDirector();
}
SceneObjHolder* LayoutActor::getSceneObjHolder(void) const {
SceneObjHolder* LayoutActor::getSceneObjHolder() const {
return mLayoutSceneInfo->getSceneObjHolder();
}
const MessageSystem* LayoutActor::getMessageSystem(void) const {
const MessageSystem* LayoutActor::getMessageSystem() const {
return mLayoutSceneInfo->getMessageSystem();
}
} // namespace al

View File

@ -46,7 +46,7 @@ void BreakModel::init(const ActorInitInfo& initInfo) {
makeActorDead();
}
void BreakModel::appear(void) {
void BreakModel::appear() {
if (mRootMtx)
updatePoseMtx(this, mRootMtx);
else

View File

@ -7,11 +7,11 @@ public:
void calcReturnTargetPos(sead::Vector3f*);
void hide(bool);
void forcePutOn(void);
void forcePutOn();
bool isFlying(void) const;
bool isFlying() const;
bool isThrowTypeSpiral(void) const;
bool isThrowTypeSpiral() const;
unsigned char padding_to_118[0x10];
al::LiveActor* mActorA;

View File

@ -2,5 +2,5 @@
class PlayerAnimFrameCtrl {
public:
const char* getActionName(void) const;
const char* getActionName() const;
};

View File

@ -10,9 +10,9 @@ public:
bool isAnim(const sead::SafeStringBase<char>& animName) const;
f32 getAnimFrame(void) const;
f32 getAnimFrameMax(void) const;
f32 getAnimFrameRate(void) const;
f32 getAnimFrame() const;
f32 getAnimFrameMax() const;
f32 getAnimFrameRate() const;
unsigned char padding_18[0x18];
PlayerAnimFrameCtrl* mAnimFrameCtrl;

View File

@ -4,7 +4,7 @@
class PlayerRecoverySafetyPoint {
public:
sead::Vector3f* getSafetyPoint(void) const;
sead::Vector3f* getSafetyPointGravity(void) const;
sead::Vector3f* getSafetyPointArea(void) const;
sead::Vector3f* getSafetyPoint() const;
sead::Vector3f* getSafetyPointGravity() const;
sead::Vector3f* getSafetyPointArea() const;
};

View File

@ -18,7 +18,7 @@ public:
virtual void control();
virtual void drawMain();
bool isEnableSave(void) const;
bool isEnableSave() const;
// somewhere here at 0xE0: stageName

View File

@ -18,15 +18,15 @@ class AudioDirector;
class HakoniwaSequence {
public:
HakoniwaSequence(const char*);
bool isDisposable(void);
void updatePadSystem(void);
bool isDisposable();
void updatePadSystem();
void destroySceneHeap(bool);
void init(const al::SequenceInitInfo&);
void initSystem(void);
void update(void);
bool isEnableSave(void);
void drawMain(void);
al::Scene* getCurrentScene(void); // {return this->curScene}
void initSystem();
void update();
bool isEnableSave();
void drawMain();
al::Scene* getCurrentScene(); // {return this->curScene}
u8** field_0x0;
u8 padding_120[120];

View File

@ -32,14 +32,14 @@ WorldResourceLoader::~WorldResourceLoader() {
tryDestroyWorldResource();
}
void WorldResourceLoader::loadResource(void) {}
void WorldResourceLoader::loadResource() {}
void WorldResourceLoader::cancelLoadWorldResource(void) {
void WorldResourceLoader::cancelLoadWorldResource() {
mIsCancelled = true;
mCurLoadCount = 0;
}
void WorldResourceLoader::tryDestroyWorldResource(void) {
void WorldResourceLoader::tryDestroyWorldResource() {
if (mWorldResourceHeap) {
bool isUseSpecialHeap;
@ -116,7 +116,7 @@ bool WorldResourceLoader::requestLoadWorldHomeStageResource(s32 loadWorldId, s32
return true;
}
bool WorldResourceLoader::isEndLoadWorldResource(void) const {
bool WorldResourceLoader::isEndLoadWorldResource() const {
return mWorldResourceLoader->isDone();
}
@ -135,9 +135,9 @@ bool WorldResourceLoader::requestLoadWorldResource(s32 loadWorldId) {
return true;
}
// unused func
void WorldResourceLoader::createResourcePlayer(void) {}
void WorldResourceLoader::createResourcePlayer() {}
void WorldResourceLoader::tryDestroyWorldResourceOnlyCap(void) {
void WorldResourceLoader::tryDestroyWorldResourceOnlyCap() {
if (mWorldResourceHeap) {
if (mCapWorldHeap) {
al::removeResourceCategory("ワールド常駐");
@ -152,14 +152,14 @@ void WorldResourceLoader::tryDestroyWorldResourceOnlyCap(void) {
al::resetCurrentCategoryName();
}
f32 WorldResourceLoader::calcLoadPercent(void) const {
f32 WorldResourceLoader::calcLoadPercent() const {
if (mCurLoadCount >= mMaxLoadCount)
return 101.0f;
else
return (mCurLoadCount * 100.0f) / mMaxLoadCount;
}
s32 WorldResourceLoader::getLoadWorldId(void) const {
s32 WorldResourceLoader::getLoadWorldId() const {
return mLoadWorldId;
}
@ -243,7 +243,7 @@ void WorldResourceLoader::loadWorldResource(s32 loadWorldId, s32 scenario, bool
mCurLoadCount = mMaxLoadCount;
}
f32 WorldResourceLoader::calcWorldResourceHeapSize(void) const {
f32 WorldResourceLoader::calcWorldResourceHeapSize() const {
return ((mWorldResourceHeap->getSize() - mWorldResourceHeap->getFreeSize()) * 0.00097656f) *
0.00097656f;
}

View File

@ -66,11 +66,11 @@ bool GameDataFile::HintInfo::isHintStatusUnlock(s32 curWorldId, s32 scenarioNo,
return !GameDataFunction::isCityWorldCeremonyAll(curWorldId, scenarioNo) || unkBool3;
}
bool GameDataFile::HintInfo::isHintStatusUnlockByNpc(void) const {
bool GameDataFile::HintInfo::isHintStatusUnlockByNpc() const {
return mHintStatus == HintStatus::NPC && !mIsMoonRock;
}
bool GameDataFile::HintInfo::isHintStatusUnlockByAmiibo(void) const {
bool GameDataFile::HintInfo::isHintStatusUnlockByAmiibo() const {
return mHintStatus == HintStatus::AMIIBO;
}

View File

@ -14,13 +14,13 @@ public:
public:
enum class HintStatus { NONE, NPC, AMIIBO };
void clear(void);
void clear();
bool isDisableByWorldWarpHole(bool) const;
bool isEnableUnlock(s32, bool, s32, bool) const;
bool isHintStatusUnlock(s32, s32, bool) const;
bool isHintStatusUnlockByNpc(void) const;
bool isHintStatusUnlockByAmiibo(void) const;
bool isHintStatusUnlockByNpc() const;
bool isHintStatusUnlockByAmiibo() const;
bool isEnableNameUnlockByScenario(s32, s32, bool) const;
bool testFunc(s32, bool, s32, bool) const;

View File

@ -2,7 +2,7 @@
class GameProgressData {
public:
s32 getHomeLevel(void) const;
void upHomeLevel(void);
void talkCapNearHomeInWaterfall(void);
s32 getHomeLevel() const;
void upHomeLevel();
void talkCapNearHomeInWaterfall();
};

View File

@ -181,6 +181,12 @@ def common_sead_types(c, path):
FAIL("Forbidden type used: "+t+". Use equivalent of <basis/seadTypes.h> instead (f32, s32, u32, ...)", line, path)
return
def common_void_params(c, path):
for line in c.splitlines():
if "(void)" in line:
FAIL("Function parameters should be empty instead of \"(void)\"!", line, path)
return
def common_const_type(c, path):
for line in c.splitlines():
line = line.split("//")[0]
@ -310,6 +316,7 @@ def check_source(c, path):
common_no_namespace_qualifiers(c, path)
common_include_order(c, path, False)
common_sead_types(c, path)
common_void_params(c, path)
common_const_type(c, path)
def check_header(c, path):
@ -317,6 +324,7 @@ def check_header(c, path):
common_no_namespace_qualifiers(c, path)
common_include_order(c, path, True)
common_sead_types(c, path)
common_void_params(c, path)
common_const_type(c, path)
header_sorted_visibility(c, path)
header_no_offset_comments(c, path)