Skip to content

Commit dca480a

Browse files
JohnCoconuthuangwei1024
authored andcommitted
remove void arg in func delcaration and reformat (cocos2d#19758)
f(void) is same as f() in C++ (but not in C), hence removing void. And reformat the code around f(void) a bit.
1 parent 04750b5 commit dca480a

File tree

251 files changed

+1092
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+1092
-1096
lines changed

cocos/2d/CCAction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ class CC_DLL Speed : public Action
294294

295295
CC_CONSTRUCTOR_ACCESS:
296296
Speed();
297-
virtual ~Speed(void);
297+
virtual ~Speed();
298298
/** Initializes the action. */
299299
bool initWithAction(ActionInterval *action, float speed);
300300

cocos/2d/CCActionEase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ bool ActionEase::initWithAction(ActionInterval *action)
6464
return false;
6565
}
6666

67-
ActionEase::~ActionEase(void)
67+
ActionEase::~ActionEase()
6868
{
6969
CC_SAFE_RELEASE(_inner);
7070
}
@@ -82,7 +82,7 @@ void ActionEase::startWithTarget(Node *target)
8282
}
8383
}
8484

85-
void ActionEase::stop(void)
85+
void ActionEase::stop()
8686
{
8787
if (_inner)
8888
_inner->stop();

cocos/2d/CCActionGrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ Rect Grid3DAction::getGridRect() const
131131

132132
// implementation of TiledGrid3DAction
133133

134-
GridBase* TiledGrid3DAction::getGrid(void)
134+
GridBase* TiledGrid3DAction::getGrid()
135135
{
136136
return TiledGrid3D::create(_gridSize, _gridNodeTarget->getGridRect());
137137
}

cocos/2d/CCActionInterval.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ class CC_DLL Repeat : public ActionInterval
253253
virtual Repeat* clone() const override;
254254
virtual Repeat* reverse() const override;
255255
virtual void startWithTarget(Node *target) override;
256-
virtual void stop(void) override;
256+
virtual void stop() override;
257257
/**
258258
* @param dt In seconds.
259259
*/
260260
virtual void update(float dt) override;
261-
virtual bool isDone(void) const override;
261+
virtual bool isDone() const override;
262262

263263
CC_CONSTRUCTOR_ACCESS:
264264
Repeat() {}
@@ -321,13 +321,13 @@ class CC_DLL RepeatForever : public ActionInterval
321321
// Overrides
322322
//
323323
virtual RepeatForever* clone() const override;
324-
virtual RepeatForever* reverse(void) const override;
324+
virtual RepeatForever* reverse() const override;
325325
virtual void startWithTarget(Node* target) override;
326326
/**
327327
* @param dt In seconds.
328328
*/
329329
virtual void step(float dt) override;
330-
virtual bool isDone(void) const override;
330+
virtual bool isDone() const override;
331331

332332
CC_CONSTRUCTOR_ACCESS:
333333
RepeatForever()

cocos/2d/CCActionTiledGrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ TurnOffTiles* TurnOffTiles::clone() const
566566
return TurnOffTiles::create(_duration, _gridSize, _seed);
567567
}
568568

569-
TurnOffTiles::~TurnOffTiles(void)
569+
TurnOffTiles::~TurnOffTiles()
570570
{
571571
CC_SAFE_DELETE_ARRAY(_tilesOrder);
572572
}

cocos/2d/CCAnimation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ Animation::Animation()
156156

157157
}
158158

159-
Animation::~Animation(void)
159+
Animation::~Animation()
160160
{
161161
CCLOGINFO("deallocing Animation: %p", this);
162162
}
@@ -185,7 +185,7 @@ void Animation::addSpriteFrameWithTexture(Texture2D *pobTexture, const Rect& rec
185185
addSpriteFrame(frame);
186186
}
187187

188-
float Animation::getDuration(void) const
188+
float Animation::getDuration() const
189189
{
190190
return _totalDelayUnits * _delayPerUnit;
191191
}

cocos/2d/CCAnimation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class CC_DLL Animation : public Ref, public Clonable
170170
/** Creates an animation.
171171
* @since v0.99.5
172172
*/
173-
static Animation* create(void);
173+
static Animation* create();
174174

175175
/* Creates an animation with an array of SpriteFrame and a delay between frames in seconds.
176176
* The frames will be added with one "delay unit".
@@ -284,7 +284,7 @@ class CC_DLL Animation : public Ref, public Clonable
284284

285285
CC_CONSTRUCTOR_ACCESS:
286286
Animation();
287-
virtual ~Animation(void);
287+
virtual ~Animation();
288288

289289
/** Initializes a Animation. */
290290
bool init();

cocos/2d/CCAnimationCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class CC_DLL AnimationCache : public Ref
8181
/** @deprecated Use destroyInstance() instead. */
8282
CC_DEPRECATED_ATTRIBUTE static void purgeSharedAnimationCache() { return AnimationCache::destroyInstance(); }
8383

84-
bool init(void);
84+
bool init();
8585

8686
/** Adds a Animation with a name.
8787
*

cocos/2d/CCAtlasNode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class CC_DLL AtlasNode : public Node, public TextureProtocol
8585
virtual void setTexture(Texture2D *texture) override;
8686
virtual bool isOpacityModifyRGB() const override;
8787
virtual void setOpacityModifyRGB(bool isOpacityModifyRGB) override;
88-
virtual const Color3B& getColor(void) const override;
88+
virtual const Color3B& getColor() const override;
8989
virtual void setColor(const Color3B& color) override;
9090
virtual void setOpacity(GLubyte opacity) override;
9191
/**

cocos/2d/CCFontFNT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ BMFontConfiguration::~BMFontConfiguration()
222222
CC_SAFE_DELETE(_characterSet);
223223
}
224224

225-
std::string BMFontConfiguration::description(void) const
225+
std::string BMFontConfiguration::description() const
226226
{
227227
return StringUtils::format(
228228
"<BMFontConfiguration = " CC_FORMAT_PRINTF_SIZE_T " | Glphys:%d Kernings:%d | Image = %s>",

0 commit comments

Comments
 (0)