Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang tidy modernize redundant void arg #19900

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Checks: >
bugprone-forwarding-reference-overload,
bugprone-inaccurate-erase,
bugprone-incorrect-roundings,
modernize-redundant-void-arg,

WarningsAsErrors: '*'
HeaderFilterRegex: '/(?!external)/.*'
Expand Down
2 changes: 1 addition & 1 deletion cocos/scripting/js-bindings/auto/jsb_cocos2dx_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19069,7 +19069,7 @@ bool js_cocos2dx_FileUtils_getStringFromFile(JSContext *cx, uint32_t argc, jsval
{
JS::RootedObject jstarget(cx, args.thisv().toObjectOrNull());
std::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, jstarget, args.get(1), args.thisv()));
auto lambda = [=](std::string larg0) -> void {
auto lambda = [=](const std::string& larg0) -> void {
JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET
jsval largv[1];
largv[0] = std_string_to_jsval(cx, larg0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6737,7 +6737,7 @@ bool js_cocos2dx_extension_AssetsManagerEx_setVerifyCallback(JSContext *cx, uint
{
JS::RootedObject jstarget(cx, args.thisv().toObjectOrNull());
std::shared_ptr<JSFunctionWrapper> func(new JSFunctionWrapper(cx, jstarget, args.get(0), args.thisv()));
auto lambda = [=](const std::string& larg0, cocos2d::extension::ManifestAsset larg1) -> bool {
auto lambda = [=](const std::string& larg0, const cocos2d::extension::ManifestAsset& larg1) -> bool {
JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET
jsval largv[2];
largv[0] = std_string_to_jsval(cx, larg0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ ActionManagerTests::ActionManagerTests()
//
//------------------------------------------------------------------

ActionManagerTest::ActionManagerTest(void)
ActionManagerTest::ActionManagerTest()
{
}

ActionManagerTest::~ActionManagerTest(void)
ActionManagerTest::~ActionManagerTest()
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/ActionsEaseTest/ActionsEaseTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1003,11 +1003,11 @@ ActionsEaseTests::ActionsEaseTests()
ADD_TEST_CASE(SpeedTest);
}

EaseSpriteDemo::EaseSpriteDemo(void)
EaseSpriteDemo::EaseSpriteDemo()
{
}

EaseSpriteDemo::~EaseSpriteDemo(void)
EaseSpriteDemo::~EaseSpriteDemo()
{
_grossini->release();
_tamara->release();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ ActionsProgressTests::ActionsProgressTests()
// SpriteDemo
//
//------------------------------------------------------------------
SpriteDemo::SpriteDemo(void)
SpriteDemo::SpriteDemo()
{
}

SpriteDemo::~SpriteDemo(void)
SpriteDemo::~SpriteDemo()
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/Box2DTestBed/Box2dView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void Box2dTestBed::onTouchMoved(Touch* touch, Event* event)
// Box2DView
//
//------------------------------------------------------------------
Box2DView::Box2DView(void)
Box2DView::Box2DView()
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/Box2DTestBed/GLES-Render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GLESDebugDraw::GLESDebugDraw( float32 ratio )
this->initShader();
}

void GLESDebugDraw::initShader( void )
void GLESDebugDraw::initShader( )
{
mShaderProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_U_COLOR);

Expand Down
16 changes: 8 additions & 8 deletions tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void CameraRotationTest::update(float dt)
// Camera3DTestDemo
//
//------------------------------------------------------------------
Camera3DTestDemo::Camera3DTestDemo(void)
Camera3DTestDemo::Camera3DTestDemo()
: _cameraType(CameraType::Free)
, _incRot(nullptr)
, _decRot(nullptr)
Expand All @@ -187,7 +187,7 @@ Camera3DTestDemo::Camera3DTestDemo(void)
, _bRotateRight(false)
{
}
Camera3DTestDemo::~Camera3DTestDemo(void)
Camera3DTestDemo::~Camera3DTestDemo()
{
}
void Camera3DTestDemo::reachEndCallBack()
Expand Down Expand Up @@ -701,7 +701,7 @@ void Camera3DTestDemo::onTouchesRotateRightEnd(Touch* touch, Event* event)

////////////////////////////////////////////////////////////
// CameraCullingDemo
CameraCullingDemo::CameraCullingDemo(void)
CameraCullingDemo::CameraCullingDemo()
: _layer3D(nullptr)
, _cameraType(CameraType::FirstPerson)
, _cameraFirst(nullptr)
Expand All @@ -712,7 +712,7 @@ CameraCullingDemo::CameraCullingDemo(void)
, _row(3)
{
}
CameraCullingDemo::~CameraCullingDemo(void)
CameraCullingDemo::~CameraCullingDemo()
{
}

Expand Down Expand Up @@ -982,7 +982,7 @@ void CameraCullingDemo::drawCameraFrustum()

////////////////////////////////////////////////////////////
// CameraArcBallDemo
CameraArcBallDemo::CameraArcBallDemo(void)
CameraArcBallDemo::CameraArcBallDemo()
: CameraBaseTest()
, _layer3D(nullptr)
, _cameraType(CameraType::Free)
Expand All @@ -997,7 +997,7 @@ CameraArcBallDemo::CameraArcBallDemo(void)
, _sprite3D2(nullptr)
{
}
CameraArcBallDemo::~CameraArcBallDemo(void)
CameraArcBallDemo::~CameraArcBallDemo()
{
}

Expand Down Expand Up @@ -1204,7 +1204,7 @@ void CameraArcBallDemo::update(float dt)

////////////////////////////////////////////////////////////
// FogTestDemo
FogTestDemo::FogTestDemo(void)
FogTestDemo::FogTestDemo()
: CameraBaseTest()
, _layer3D(nullptr)
, _cameraType(CameraType::Free)
Expand All @@ -1213,7 +1213,7 @@ FogTestDemo::FogTestDemo(void)
, _state(nullptr)
{
}
FogTestDemo::~FogTestDemo(void)
FogTestDemo::~FogTestDemo()
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/ConsoleTest/ConsoleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ BaseTestConsole::BaseTestConsole()
{
}

BaseTestConsole::~BaseTestConsole(void)
BaseTestConsole::~BaseTestConsole()
{
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ std::string Issue631::subtitle() const
//
//------------------------------------------------------------------

void EffectAdvanceBaseTest::onEnter(void)
void EffectAdvanceBaseTest::onEnter()
{
TestCase::onEnter();

Expand Down Expand Up @@ -344,7 +344,7 @@ void EffectAdvanceBaseTest::onEnter(void)

}

EffectAdvanceBaseTest::~EffectAdvanceBaseTest(void)
EffectAdvanceBaseTest::~EffectAdvanceBaseTest()
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/EffectsTest/EffectsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,6 @@ void EffectBaseTest::checkAnim(float dt)
_gridNodeTarget->setGrid(nullptr);
}

EffectBaseTest::~EffectBaseTest(void)
EffectBaseTest::~EffectBaseTest()
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ SocketIOTest::SocketIOTest()
}


SocketIOTest::~SocketIOTest(void)
SocketIOTest::~SocketIOTest()
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/MotionStreakTest/MotionStreakTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ std::string Issue12226::subtitle() const
//
//------------------------------------------------------------------

MotionStreakTest::MotionStreakTest(void)
MotionStreakTest::MotionStreakTest()
{
}

MotionStreakTest::~MotionStreakTest(void)
MotionStreakTest::~MotionStreakTest()
{
}

Expand Down
12 changes: 6 additions & 6 deletions tests/cpp-tests/Classes/NavMeshTest/NavMeshTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ void NavMeshDisabled::onEnter()
}
#else

NavMeshBaseTestDemo::NavMeshBaseTestDemo(void)
NavMeshBaseTestDemo::NavMeshBaseTestDemo()
: _camera(nullptr)
, _needMoveAgents(false)
{

}

NavMeshBaseTestDemo::~NavMeshBaseTestDemo(void)
NavMeshBaseTestDemo::~NavMeshBaseTestDemo()
{
for (auto iter : _agents){
AgentUserData *data = static_cast<AgentUserData *>(iter.first->getUserData());
Expand Down Expand Up @@ -263,12 +263,12 @@ void NavMeshBaseTestDemo::update(float delta)
}
}

NavMeshBasicTestDemo::NavMeshBasicTestDemo(void)
NavMeshBasicTestDemo::NavMeshBasicTestDemo()
{

}

NavMeshBasicTestDemo::~NavMeshBasicTestDemo(void)
NavMeshBasicTestDemo::~NavMeshBasicTestDemo()
{
}

Expand Down Expand Up @@ -335,12 +335,12 @@ void NavMeshBasicTestDemo::onEnter()
createAgent(result.hitPosition);
}

NavMeshAdvanceTestDemo::NavMeshAdvanceTestDemo(void)
NavMeshAdvanceTestDemo::NavMeshAdvanceTestDemo()
{

}

NavMeshAdvanceTestDemo::~NavMeshAdvanceTestDemo(void)
NavMeshAdvanceTestDemo::~NavMeshAdvanceTestDemo()
{

}
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/NodeTest/NodeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ CocosNodeTests::CocosNodeTests()
ADD_TEST_CASE(Issue16735Test);
}

TestCocosNodeDemo::TestCocosNodeDemo(void)
TestCocosNodeDemo::TestCocosNodeDemo()
{
}

TestCocosNodeDemo::~TestCocosNodeDemo(void)
TestCocosNodeDemo::~TestCocosNodeDemo()
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/Particle3DTest/Particle3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void Particle3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, coco

}

Particle3DTestDemo::Particle3DTestDemo( void )
Particle3DTestDemo::Particle3DTestDemo()
: _angle(0.0f)
{

Expand All @@ -138,7 +138,7 @@ void Particle3DTestDemo::update( float delta )
}
}

Particle3DTestDemo::~Particle3DTestDemo( void )
Particle3DTestDemo::~Particle3DTestDemo()
{
_particleLab->release();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/ParticleTest/ParticleTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,12 +1075,12 @@ ParticleTests::ParticleTests()
ADD_TEST_CASE(ParticleSpriteFrame);
}

ParticleDemo::~ParticleDemo(void)
ParticleDemo::~ParticleDemo()
{
CC_SAFE_RELEASE(_emitter);
}

void ParticleDemo::onEnter(void)
void ParticleDemo::onEnter()
{
TestCase::onEnter();

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/Physics3DTest/Physics3DTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void Physics3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, cocos
}
}

Physics3DTestDemo::Physics3DTestDemo( void )
Physics3DTestDemo::Physics3DTestDemo()
: _angle(0.0f)
, _camera(nullptr)
{
Expand All @@ -188,7 +188,7 @@ void Physics3DTestDemo::update( float /*delta*/ )

}

Physics3DTestDemo::~Physics3DTestDemo( void )
Physics3DTestDemo::~Physics3DTestDemo()
{

}
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/PhysicsTest/PhysicsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace
return (LOGO_IMAGE[(x >> 3) + y * LOGO_RAW_LENGTH] >> (~x & 0x7)) & 1;
}

float frand(void)
float frand()
{
return rand() / RAND_MAX;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp-tests/Classes/TileMapTest/TileMapTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ TileDemo::TileDemo()
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
}

TileDemo::~TileDemo(void)
TileDemo::~TileDemo()
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/TouchesTest/Ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

USING_NS_CC;

Ball::Ball(void)
Ball::Ball()
{
}

Ball::~Ball(void)
Ball::~Ball()
{
}

Expand Down
4 changes: 2 additions & 2 deletions tests/cpp-tests/Classes/TouchesTest/Paddle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

USING_NS_CC;

Paddle::Paddle(void)
Paddle::Paddle()
{
}

Paddle::~Paddle(void)
Paddle::~Paddle()
{
}

Expand Down