From 2e10543fbb6ccea7e60c37fe8e340b7a85d92bf0 Mon Sep 17 00:00:00 2001 From: MonsterDruide1 <5958456@gmail.com> Date: Sun, 15 Oct 2023 15:57:15 +0200 Subject: [PATCH] Remove `;` after namespaces --- lib/al/include/Library/HitSensor/HitSensorKeeper.h | 2 +- lib/al/include/Library/HostIO/HioNode.h | 2 +- lib/al/include/Library/HostIO/IUseName.h | 2 +- lib/al/include/Library/LiveActor/LiveActorGroup.h | 2 +- lib/al/include/Library/Nerve/IUseNerve.h | 2 +- lib/al/include/Library/Nerve/NerveExecutor.h | 2 +- lib/al/include/Library/Nerve/NerveStateCtrl.h | 2 +- lib/al/include/Library/Network/HtmlViewer.h | 2 +- lib/al/include/Library/Rail/IUseRail.h | 2 +- lib/al/include/Library/Yaml/ByamlUtil.h | 2 +- lib/al/include/Project/HitSensor/HitSensor.h | 2 +- lib/al/include/Project/HitSensor/SensorHitGroup.h | 2 +- lib/al/include/Project/Item/ActorScoreKeeper.h | 2 +- lib/al/src/Library/Base/String.cpp | 2 +- lib/al/src/Library/LiveActor/LiveActorGroup.cpp | 2 +- lib/al/src/Library/Math/MathUtil.cpp | 2 +- lib/al/src/Library/Nerve/NerveStateCtrl.cpp | 2 +- lib/al/src/Library/Placement/PlacementInfo.cpp | 2 +- lib/al/src/Library/Resource/Resource.cpp | 2 +- lib/al/src/Project/HitSensor/HitSensor.cpp | 2 +- tools/check-format.py | 6 ++++-- 21 files changed, 24 insertions(+), 22 deletions(-) diff --git a/lib/al/include/Library/HitSensor/HitSensorKeeper.h b/lib/al/include/Library/HitSensor/HitSensorKeeper.h index eb86074f..ea52e715 100755 --- a/lib/al/include/Library/HitSensor/HitSensorKeeper.h +++ b/lib/al/include/Library/HitSensor/HitSensorKeeper.h @@ -16,4 +16,4 @@ class HitSensorKeeper { s32 mSensorCount; HitSensor** mSensors; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/HostIO/HioNode.h b/lib/al/include/Library/HostIO/HioNode.h index 86cea8f0..8bed679c 100755 --- a/lib/al/include/Library/HostIO/HioNode.h +++ b/lib/al/include/Library/HostIO/HioNode.h @@ -10,4 +10,4 @@ class HioNode : public IUseHioNode { public: // ?? }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/HostIO/IUseName.h b/lib/al/include/Library/HostIO/IUseName.h index 915f652d..8b88ea22 100644 --- a/lib/al/include/Library/HostIO/IUseName.h +++ b/lib/al/include/Library/HostIO/IUseName.h @@ -5,4 +5,4 @@ class IUseName { public: virtual const char* getName() const = 0; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/LiveActor/LiveActorGroup.h b/lib/al/include/Library/LiveActor/LiveActorGroup.h index c0e5492c..220f78ad 100755 --- a/lib/al/include/Library/LiveActor/LiveActorGroup.h +++ b/lib/al/include/Library/LiveActor/LiveActorGroup.h @@ -48,4 +48,4 @@ class DeriveActorGroup : LiveActorGroup { void makeActorAliveAll() { LiveActorGroup::makeActorAliveAll(); } void makeActorDeadAll() { LiveActorGroup::makeActorDeadAll(); } }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Nerve/IUseNerve.h b/lib/al/include/Library/Nerve/IUseNerve.h index 366afd10..3cb5e484 100644 --- a/lib/al/include/Library/Nerve/IUseNerve.h +++ b/lib/al/include/Library/Nerve/IUseNerve.h @@ -9,4 +9,4 @@ class IUseNerve { virtual NerveKeeper* getNerveKeeper() const = 0; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Nerve/NerveExecutor.h b/lib/al/include/Library/Nerve/NerveExecutor.h index e9997c7c..700e0e84 100755 --- a/lib/al/include/Library/Nerve/NerveExecutor.h +++ b/lib/al/include/Library/Nerve/NerveExecutor.h @@ -22,4 +22,4 @@ class NerveExecutor : public IUseNerve, public HioNode { private: NerveKeeper* mKeeper = nullptr; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Nerve/NerveStateCtrl.h b/lib/al/include/Library/Nerve/NerveStateCtrl.h index 49fda50b..20d815f3 100755 --- a/lib/al/include/Library/Nerve/NerveStateCtrl.h +++ b/lib/al/include/Library/Nerve/NerveStateCtrl.h @@ -32,4 +32,4 @@ class NerveStateCtrl { State* mStates; State* mCurrentState; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Network/HtmlViewer.h b/lib/al/include/Library/Network/HtmlViewer.h index e1bbaf4d..07b12b38 100644 --- a/lib/al/include/Library/Network/HtmlViewer.h +++ b/lib/al/include/Library/Network/HtmlViewer.h @@ -7,4 +7,4 @@ class HtmlViewer { public: void call(const char*, sead::BufferedSafeStringBase*) const; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Rail/IUseRail.h b/lib/al/include/Library/Rail/IUseRail.h index 3afe9d84..b5c408e2 100755 --- a/lib/al/include/Library/Rail/IUseRail.h +++ b/lib/al/include/Library/Rail/IUseRail.h @@ -7,4 +7,4 @@ class IUseRail { public: virtual RailRider* getRailRider() const = 0; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Library/Yaml/ByamlUtil.h b/lib/al/include/Library/Yaml/ByamlUtil.h index f7d5294c..cc14e525 100755 --- a/lib/al/include/Library/Yaml/ByamlUtil.h +++ b/lib/al/include/Library/Yaml/ByamlUtil.h @@ -93,4 +93,4 @@ struct PrintParams { void printByamlIter(const u8*); void printByamlIter(const ByamlIter&); void printByamlIter_(const ByamlIter&, PrintParams*); -}; // namespace al +} // namespace al diff --git a/lib/al/include/Project/HitSensor/HitSensor.h b/lib/al/include/Project/HitSensor/HitSensor.h index 397e1a76..5f2cd502 100644 --- a/lib/al/include/Project/HitSensor/HitSensor.h +++ b/lib/al/include/Project/HitSensor/HitSensor.h @@ -42,4 +42,4 @@ class HitSensor { const sead::Vector3* mFollowPos; // _48 const sead::Matrix34* mFollowMtx; // _50 }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Project/HitSensor/SensorHitGroup.h b/lib/al/include/Project/HitSensor/SensorHitGroup.h index d82ef63c..db011c79 100755 --- a/lib/al/include/Project/HitSensor/SensorHitGroup.h +++ b/lib/al/include/Project/HitSensor/SensorHitGroup.h @@ -18,4 +18,4 @@ class SensorHitGroup { s32 mSensorCount = 0; HitSensor** mSensors; }; -}; // namespace al +} // namespace al diff --git a/lib/al/include/Project/Item/ActorScoreKeeper.h b/lib/al/include/Project/Item/ActorScoreKeeper.h index b1729649..b54d7aa6 100644 --- a/lib/al/include/Project/Item/ActorScoreKeeper.h +++ b/lib/al/include/Project/Item/ActorScoreKeeper.h @@ -25,4 +25,4 @@ class ActorScoreKeeper { Entry* array; s32 size; }; -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Base/String.cpp b/lib/al/src/Library/Base/String.cpp index 8b39e42f..4dfaa61f 100755 --- a/lib/al/src/Library/Base/String.cpp +++ b/lib/al/src/Library/Base/String.cpp @@ -66,4 +66,4 @@ bool isEndWithString(const char* pString_0, const char* pString_1) { return isEqualString(&pString_0[pString0_Len - pString1_Len], pString_1); } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/LiveActor/LiveActorGroup.cpp b/lib/al/src/Library/LiveActor/LiveActorGroup.cpp index 29e38070..f592df87 100755 --- a/lib/al/src/Library/LiveActor/LiveActorGroup.cpp +++ b/lib/al/src/Library/LiveActor/LiveActorGroup.cpp @@ -107,4 +107,4 @@ void LiveActorGroup::makeActorDeadAll() { mActors[i]->makeActorDead(); } } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Math/MathUtil.cpp b/lib/al/src/Library/Math/MathUtil.cpp index a15f1731..718746fe 100755 --- a/lib/al/src/Library/Math/MathUtil.cpp +++ b/lib/al/src/Library/Math/MathUtil.cpp @@ -97,4 +97,4 @@ f32 lerpValue(f32 x, f32 y, f32 time) { time = 1.0f; return (x * (1.0f - time)) + (time * y); } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Nerve/NerveStateCtrl.cpp b/lib/al/src/Library/Nerve/NerveStateCtrl.cpp index a5d64a74..899b2bca 100644 --- a/lib/al/src/Library/Nerve/NerveStateCtrl.cpp +++ b/lib/al/src/Library/Nerve/NerveStateCtrl.cpp @@ -63,4 +63,4 @@ void NerveStateCtrl::tryEndCurrentState() { mCurrentState = nullptr; } } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Placement/PlacementInfo.cpp b/lib/al/src/Library/Placement/PlacementInfo.cpp index 597f40f3..3c921991 100755 --- a/lib/al/src/Library/Placement/PlacementInfo.cpp +++ b/lib/al/src/Library/Placement/PlacementInfo.cpp @@ -7,4 +7,4 @@ void PlacementInfo::set(const ByamlIter& placement_iter, const ByamlIter& zone_i mPlacementIter = placement_iter; mZoneIter = zone_iter; } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Library/Resource/Resource.cpp b/lib/al/src/Library/Resource/Resource.cpp index 84cfd350..f3c8957b 100755 --- a/lib/al/src/Library/Resource/Resource.cpp +++ b/lib/al/src/Library/Resource/Resource.cpp @@ -49,4 +49,4 @@ void Resource::cleanupResGraphicsFile() { agl::g3d::ResFile::Cleanup(mResFile); mResFile = nullptr; } -}; // namespace al +} // namespace al diff --git a/lib/al/src/Project/HitSensor/HitSensor.cpp b/lib/al/src/Project/HitSensor/HitSensor.cpp index 8b9482ac..7c03591e 100755 --- a/lib/al/src/Project/HitSensor/HitSensor.cpp +++ b/lib/al/src/Project/HitSensor/HitSensor.cpp @@ -49,4 +49,4 @@ void HitSensor::addHitSensor(HitSensor* pSensor) { ++mSensorCount; } } -}; // namespace al +} // namespace al diff --git a/tools/check-format.py b/tools/check-format.py index 45afb892..5b098a8f 100755 --- a/tools/check-format.py +++ b/tools/check-format.py @@ -50,7 +50,7 @@ def common_no_namespace_qualifiers(c, path): allowed_namespaces = [] for l in nest_level: - if l != "": + if l != "" and l != None: if "::" not in l: allowed_namespaces.append(l) else: @@ -59,9 +59,11 @@ def common_no_namespace_qualifiers(c, path): parts = re.split("([{}])", line) for x in parts: if x == "{": - nest_level.append("") + nest_level.append(None) continue if x == "}": + if nest_level[-1] != None: # is closing namespace + if CHECK(lambda a:a=="}", line.rstrip(), "Closing namespace expects only \"}\" in line!", path): return del nest_level[-1] continue