From 33a2d0451c81d4f4305509412e68336c0721f853 Mon Sep 17 00:00:00 2001 From: Ricardo Quesada Date: Tue, 25 Nov 2014 17:53:52 -0800 Subject: [PATCH] Code conforms with the cocos2d-x c++ guidelines --- cocos/2d/CCAction.cpp | 6 +++--- cocos/2d/CCAction.h | 3 ++- cocos/2d/CCLabel.cpp | 2 +- cocos/2d/CCSprite.cpp | 2 +- cocos/2d/CCSprite.h | 3 +-- cocos/2d/CCSpriteBatchNode.cpp | 8 ++++---- cocos/2d/CCSpriteBatchNode.h | 2 +- cocos/2d/CCSpriteFrame.cpp | 6 +++--- cocos/2d/CCSpriteFrame.h | 18 +++++++++--------- cocos/2d/CCSpriteFrameCache.h | 13 +++++-------- cocos/2d/CCTMXLayer.h | 18 +++++++++--------- cocos/2d/CCTextFieldTTF.cpp | 2 +- cocos/2d/CCTextFieldTTF.h | 2 +- cocos/3d/CCAnimate3D.h | 2 +- cocos/3d/CCAnimation3D.h | 7 ++----- cocos/3d/CCAttachNode.h | 2 +- cocos/audio/apple/AudioCache.h | 4 +--- cocos/audio/apple/AudioCache.mm | 6 +++--- cocos/audio/apple/AudioEngine-inl.mm | 5 ++--- cocos/audio/apple/AudioPlayer.mm | 13 ++++++------- cocos/network/SocketIO.h | 4 ++-- .../Classes/Camera3DTest/Camera3DTest.cpp | 10 +++++----- .../CocoStudioSceneTest/SceneEditorTest.cpp | 3 +-- .../CocoStudioSceneTest/SceneEditorTest.h | 5 ++--- .../NotificationCenterTest.cpp | 1 - .../NotificationCenterTest.h | 2 -- .../NewEventDispatcherTest.cpp | 9 +++------ .../Classes/ParallaxTest/ParallaxTest.cpp | 2 +- 28 files changed, 71 insertions(+), 89 deletions(-) diff --git a/cocos/2d/CCAction.cpp b/cocos/2d/CCAction.cpp index 9502f8e9ea..7d441f106e 100644 --- a/cocos/2d/CCAction.cpp +++ b/cocos/2d/CCAction.cpp @@ -108,7 +108,7 @@ Speed* Speed::create(ActionInterval* action, float speed) bool Speed::initWithAction(ActionInterval *action, float speed) { - CCASSERT(action != nullptr, ""); + CCASSERT(action != nullptr, "action must not be NULL"); action->retain(); _innerAction = action; _speed = speed; @@ -121,7 +121,7 @@ Speed *Speed::clone() const auto a = new (std::nothrow) Speed(); a->initWithAction(_innerAction->clone(), _speed); a->autorelease(); - return a; + return a; } void Speed::startWithTarget(Node* target) @@ -198,7 +198,7 @@ Follow* Follow::reverse() const bool Follow::initWithTarget(Node *followedNode, const Rect& rect/* = Rect::ZERO*/) { - CCASSERT(followedNode != nullptr, ""); + CCASSERT(followedNode != nullptr, "FollowedNode can't be NULL"); followedNode->retain(); _followedNode = followedNode; diff --git a/cocos/2d/CCAction.h b/cocos/2d/CCAction.h index 35319d1f05..7c45391fcb 100644 --- a/cocos/2d/CCAction.h +++ b/cocos/2d/CCAction.h @@ -244,7 +244,8 @@ public: inline bool isBoundarySet() const { return _boundarySet; } /** alter behavior - turn on/off boundary */ - inline void setBoudarySet(bool value) { _boundarySet = value; } + inline void setBoundarySet(bool value) { _boundarySet = value; } + CC_DEPRECATED_ATTRIBUTE inline void setBoudarySet(bool value) { setBoundarySet(value); } // // Override diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 39f5316cf2..fe2927bbcf 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -498,7 +498,7 @@ void Label::setMaxLineWidth(unsigned int maxLineWidth) } } -void Label::setDimensions(unsigned int width,unsigned int height) +void Label::setDimensions(unsigned int width, unsigned int height) { if (height != _labelHeight || width != _labelWidth) { diff --git a/cocos/2d/CCSprite.cpp b/cocos/2d/CCSprite.cpp index 0dfe8b24ab..19378ea2da 100644 --- a/cocos/2d/CCSprite.cpp +++ b/cocos/2d/CCSprite.cpp @@ -982,7 +982,7 @@ SpriteFrame* Sprite::getSpriteFrame() const CC_SIZE_POINTS_TO_PIXELS(_contentSize)); } -SpriteBatchNode* Sprite::getBatchNode() +SpriteBatchNode* Sprite::getBatchNode() const { return _batchNode; } diff --git a/cocos/2d/CCSprite.h b/cocos/2d/CCSprite.h index 9a6bf87a72..226eb4d55b 100644 --- a/cocos/2d/CCSprite.h +++ b/cocos/2d/CCSprite.h @@ -167,7 +167,7 @@ public: * @return The SpriteBatchNode object if this sprite is rendered by SpriteBatchNode, * nullptr if the sprite isn't used batch node. */ - virtual SpriteBatchNode* getBatchNode(void); + virtual SpriteBatchNode* getBatchNode() const; /** * Sets the batch node to sprite * @warning This method is not recommended for game developers. Sample code for using batch node @@ -183,7 +183,6 @@ public: /// @} end of BatchNode methods - /// @{ /// @name Texture / Frame methods diff --git a/cocos/2d/CCSpriteBatchNode.cpp b/cocos/2d/CCSpriteBatchNode.cpp index 5a3f27dc3e..f74948d72d 100644 --- a/cocos/2d/CCSpriteBatchNode.cpp +++ b/cocos/2d/CCSpriteBatchNode.cpp @@ -378,7 +378,7 @@ void SpriteBatchNode::draw(Renderer *renderer, const Mat4 &transform, uint32_t f renderer->addCommand(&_batchCommand); } -void SpriteBatchNode::increaseAtlasCapacity(void) +void SpriteBatchNode::increaseAtlasCapacity() { // if we're going beyond the current TextureAtlas's capacity, // all the previously initialized sprites will need to redo their texture coords @@ -574,7 +574,7 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite) } } -void SpriteBatchNode::updateBlendFunc(void) +void SpriteBatchNode::updateBlendFunc() { if (! _textureAtlas->getTexture()->hasPremultipliedAlpha()) { @@ -594,12 +594,12 @@ void SpriteBatchNode::setBlendFunc(const BlendFunc &blendFunc) _blendFunc = blendFunc; } -const BlendFunc& SpriteBatchNode::getBlendFunc(void) const +const BlendFunc& SpriteBatchNode::getBlendFunc() const { return _blendFunc; } -Texture2D* SpriteBatchNode::getTexture(void) const +Texture2D* SpriteBatchNode::getTexture() const { return _textureAtlas->getTexture(); } diff --git a/cocos/2d/CCSpriteBatchNode.h b/cocos/2d/CCSpriteBatchNode.h index 6e7af1664b..cf54429a6d 100644 --- a/cocos/2d/CCSpriteBatchNode.h +++ b/cocos/2d/CCSpriteBatchNode.h @@ -79,7 +79,7 @@ public: /** returns the TextureAtlas object */ - inline TextureAtlas* getTextureAtlas(void) { return _textureAtlas; } + inline TextureAtlas* getTextureAtlas() { return _textureAtlas; } /** sets the TextureAtlas object */ inline void setTextureAtlas(TextureAtlas* textureAtlas) diff --git a/cocos/2d/CCSpriteFrame.cpp b/cocos/2d/CCSpriteFrame.cpp index ff40efc5c9..8a5a6468fe 100644 --- a/cocos/2d/CCSpriteFrame.cpp +++ b/cocos/2d/CCSpriteFrame.cpp @@ -69,7 +69,7 @@ SpriteFrame* SpriteFrame::create(const std::string& filename, const Rect& rect, return spriteFrame; } -SpriteFrame::SpriteFrame(void) +SpriteFrame::SpriteFrame() : _rotated(false) , _texture(nullptr) { @@ -123,7 +123,7 @@ bool SpriteFrame::initWithTextureFilename(const std::string& filename, const Rec return true; } -SpriteFrame::~SpriteFrame(void) +SpriteFrame::~SpriteFrame() { CCLOGINFO("deallocing SpriteFrame: %p", this); CC_SAFE_RELEASE(_texture); @@ -182,7 +182,7 @@ void SpriteFrame::setTexture(Texture2D * texture) } } -Texture2D* SpriteFrame::getTexture(void) +Texture2D* SpriteFrame::getTexture() { if( _texture ) { return _texture; diff --git a/cocos/2d/CCSpriteFrame.h b/cocos/2d/CCSpriteFrame.h index 05cd279482..e104eb016d 100644 --- a/cocos/2d/CCSpriteFrame.h +++ b/cocos/2d/CCSpriteFrame.h @@ -79,35 +79,35 @@ public: inline const Rect& getRectInPixels() const { return _rectInPixels; } void setRectInPixels(const Rect& rectInPixels); - inline bool isRotated(void) const { return _rotated; } + inline bool isRotated() const { return _rotated; } inline void setRotated(bool rotated) { _rotated = rotated; } /** get rect of the frame */ - inline const Rect& getRect(void) const { return _rect; } + inline const Rect& getRect() const { return _rect; } /** set rect of the frame */ void setRect(const Rect& rect); /** get offset of the frame */ - const Vec2& getOffsetInPixels(void) const; + const Vec2& getOffsetInPixels() const; /** set offset of the frame */ void setOffsetInPixels(const Vec2& offsetInPixels); /** get original size of the trimmed image */ - inline const Size& getOriginalSizeInPixels(void) const { return _originalSizeInPixels; } + inline const Size& getOriginalSizeInPixels() const { return _originalSizeInPixels; } /** set original size of the trimmed image */ inline void setOriginalSizeInPixels(const Size& sizeInPixels) { _originalSizeInPixels = sizeInPixels; } /** get original size of the trimmed image */ - inline const Size& getOriginalSize(void) const { return _originalSize; } + inline const Size& getOriginalSize() const { return _originalSize; } /** set original size of the trimmed image */ inline void setOriginalSize(const Size& sizeInPixels) { _originalSize = sizeInPixels; } /** get texture of the frame */ - Texture2D* getTexture(void); + Texture2D* getTexture(); /** set texture of the frame, the texture is retained */ void setTexture(Texture2D* pobTexture); - const Vec2& getOffset(void) const; + const Vec2& getOffset() const; void setOffset(const Vec2& offsets); // Overrides @@ -117,12 +117,12 @@ CC_CONSTRUCTOR_ACCESS: /** * @lua NA */ - SpriteFrame(void); + SpriteFrame(); /** * @lua NA */ - virtual ~SpriteFrame(void); + virtual ~SpriteFrame(); /** Initializes a SpriteFrame with a texture, rect in points. It is assumed that the frame was not trimmed. diff --git a/cocos/2d/CCSpriteFrameCache.h b/cocos/2d/CCSpriteFrameCache.h index 0722ba860a..0d843fa4f7 100644 --- a/cocos/2d/CCSpriteFrameCache.h +++ b/cocos/2d/CCSpriteFrameCache.h @@ -70,11 +70,6 @@ public: /** @deprecated Use destroyInstance() instead */ CC_DEPRECATED_ATTRIBUTE static void purgeSharedSpriteFrameCache() { return SpriteFrameCache::destroyInstance(); } -protected: - // MARMALADE: Made this protected not private, as deriving from this class is pretty useful - SpriteFrameCache(){} - -public: /** * @js NA * @lua NA @@ -82,7 +77,6 @@ public: virtual ~SpriteFrameCache(); bool init(); -public: /** Adds multiple Sprite Frames from a plist file. * A texture will be loaded automatically. The texture name will composed by replacing the .plist suffix with .png * If you want to use another texture, you should use the addSpriteFramesWithFile(const std::string& plist, const std::string& textureFileName) method. @@ -162,7 +156,10 @@ public: /** @deprecated use getSpriteFrameByName() instead */ CC_DEPRECATED_ATTRIBUTE SpriteFrame* spriteFrameByName(const std::string&name) { return getSpriteFrameByName(name); } -private: +protected: + // MARMALADE: Made this protected not private, as deriving from this class is pretty useful + SpriteFrameCache(){} + /*Adds multiple Sprite Frames with a dictionary. The texture will be associated with the created sprite frames. */ void addSpriteFramesWithDictionary(ValueMap& dictionary, Texture2D *texture); @@ -172,7 +169,7 @@ private: */ void removeSpriteFramesFromDictionary(ValueMap& dictionary); -protected: + Map _spriteFrames; ValueMap _spriteFramesAliases; std::set* _loadedFileNames; diff --git a/cocos/2d/CCTMXLayer.h b/cocos/2d/CCTMXLayer.h index f1b9c9330e..d915c61753 100644 --- a/cocos/2d/CCTMXLayer.h +++ b/cocos/2d/CCTMXLayer.h @@ -190,7 +190,7 @@ public: void removeChild(Node* child, bool cleanup) override; virtual std::string getDescription() const override; -private: +protected: Vec2 getPositionForIsoAt(const Vec2& pos); Vec2 getPositionForOrthoAt(const Vec2& pos); Vec2 getPositionForHexAt(const Vec2& pos); @@ -211,23 +211,23 @@ private: // index ssize_t atlasIndexForExistantZ(int z); ssize_t atlasIndexForNewZ(int z); - -protected: + + //! name of the layer std::string _layerName; //! TMX Layer supports opacity - unsigned char _opacity; + unsigned char _opacity; //! Only used when vertexZ is used - int _vertexZvalue; - bool _useAutomaticVertexZ; + int _vertexZvalue; + bool _useAutomaticVertexZ; //! used for optimization - Sprite *_reusedTile; - ccCArray *_atlasIndexArray; + Sprite *_reusedTile; + ccCArray *_atlasIndexArray; // used for retina display - float _contentScaleFactor; + float _contentScaleFactor; /** size of the layer in tiles */ Size _layerSize; diff --git a/cocos/2d/CCTextFieldTTF.cpp b/cocos/2d/CCTextFieldTTF.cpp index 1e971665f9..3e1378cf40 100644 --- a/cocos/2d/CCTextFieldTTF.cpp +++ b/cocos/2d/CCTextFieldTTF.cpp @@ -240,7 +240,7 @@ void TextFieldTTF::deleteBackward() if (_delegate && _delegate->onTextFieldDeleteBackward(this, _inputText.c_str() + len - deleteLen, static_cast(deleteLen))) { - // delegate doesn't wan't to delete backwards + // delegate doesn't want to delete backwards return; } diff --git a/cocos/2d/CCTextFieldTTF.h b/cocos/2d/CCTextFieldTTF.h index ee2f36ef5e..1e9b85f4f3 100644 --- a/cocos/2d/CCTextFieldTTF.h +++ b/cocos/2d/CCTextFieldTTF.h @@ -160,7 +160,7 @@ public: // place holder text property // place holder text displayed when there is no text in the text field. virtual void setPlaceHolder(const std::string& text); - virtual const std::string& getPlaceHolder(void) const; + virtual const std::string& getPlaceHolder() const; virtual void setSecureTextEntry(bool value); virtual bool isSecureTextEntry(); diff --git a/cocos/3d/CCAnimate3D.h b/cocos/3d/CCAnimate3D.h index d43fe5ffb1..1b75e9d3c3 100644 --- a/cocos/3d/CCAnimate3D.h +++ b/cocos/3d/CCAnimate3D.h @@ -85,7 +85,7 @@ public: float getWeight() const { return _weight; } void setWeight(float weight); - /** animate transistion time */ + /** animate transition time */ static float getTransitionTime() { return _transTime; } /**get & set play reverse, these are deprecated, use set negative speed instead*/ diff --git a/cocos/3d/CCAnimation3D.h b/cocos/3d/CCAnimation3D.h index a535e94e7b..5c5c849a61 100644 --- a/cocos/3d/CCAnimation3D.h +++ b/cocos/3d/CCAnimation3D.h @@ -70,18 +70,15 @@ public: Curve* getBoneCurveByName(const std::string& name) const; CC_CONSTRUCTOR_ACCESS: - Animation3D(); virtual ~Animation3D(); /**init Animation3D from bundle data*/ bool init(const Animation3DData& data); protected: - std::unordered_map _boneCurves;//bone curves map, key bone name, value AnimationCurve - - - float _duration; //animation duration + + float _duration; //animation duration }; /** diff --git a/cocos/3d/CCAttachNode.h b/cocos/3d/CCAttachNode.h index 8f43a4a2b5..f312b6cc7c 100644 --- a/cocos/3d/CCAttachNode.h +++ b/cocos/3d/CCAttachNode.h @@ -58,7 +58,7 @@ CC_CONSTRUCTOR_ACCESS: protected: - Bone3D* _attachBone; + Bone3D* _attachBone; }; diff --git a/cocos/audio/apple/AudioCache.h b/cocos/audio/apple/AudioCache.h index cdd3d7814e..af0d6124b5 100644 --- a/cocos/audio/apple/AudioCache.h +++ b/cocos/audio/apple/AudioCache.h @@ -53,10 +53,8 @@ public: void addCallbacks(const std::function &callback); -private: - +protected: void readDataTask(); - void invokingCallbacks(); //pcm data related stuff diff --git a/cocos/audio/apple/AudioCache.mm b/cocos/audio/apple/AudioCache.mm index d40c0b02bb..9afa0054be 100644 --- a/cocos/audio/apple/AudioCache.mm +++ b/cocos/audio/apple/AudioCache.mm @@ -53,13 +53,13 @@ using namespace cocos2d; using namespace cocos2d::experimental; AudioCache::AudioCache() -: _pcmData(nullptr) -, _dataSize(0) +: _dataSize(0) +, _pcmData(nullptr) , _bytesOfRead(0) -, _exitReadDataTask(false) , _queBufferFrames(0) , _queBufferBytes(0) , _alBufferReady(false) +, _exitReadDataTask(false) { } diff --git a/cocos/audio/apple/AudioEngine-inl.mm b/cocos/audio/apple/AudioEngine-inl.mm index 609e2dce89..e6a90d8f68 100644 --- a/cocos/audio/apple/AudioEngine-inl.mm +++ b/cocos/audio/apple/AudioEngine-inl.mm @@ -128,11 +128,10 @@ namespace cocos2d { } AudioEngineImpl::AudioEngineImpl() -: _lazyInitLoop(true) -, _threadPool(nullptr) +: _threadPool(nullptr) +, _lazyInitLoop(true) , _currentAudioID(0) { - } AudioEngineImpl::~AudioEngineImpl() diff --git a/cocos/audio/apple/AudioPlayer.mm b/cocos/audio/apple/AudioPlayer.mm index d084e8e410..a245db00b5 100644 --- a/cocos/audio/apple/AudioPlayer.mm +++ b/cocos/audio/apple/AudioPlayer.mm @@ -36,15 +36,14 @@ using namespace cocos2d; using namespace cocos2d::experimental; AudioPlayer::AudioPlayer() -: _exitThread(false) -, _streamingSource(false) -, _timeDirty(false) -, _currTime(0.0f) +: _audioCache(nullptr) , _finishCallbak(nullptr) , _ready(false) -, _audioCache(nullptr) -{ - +, _currTime(0.0f) +, _streamingSource(false) +, _exitThread(false) +, _timeDirty(false) +{ } AudioPlayer::~AudioPlayer() diff --git a/cocos/network/SocketIO.h b/cocos/network/SocketIO.h index 152a8c5c72..6e1f7fd682 100644 --- a/cocos/network/SocketIO.h +++ b/cocos/network/SocketIO.h @@ -162,7 +162,7 @@ public: SocketIO::SIODelegate* getDelegate() { return _delegate; }; /** - * @brief Disconnect from the endpoint, onClose will be called on the delegate when comlpete + * @brief Disconnect from the endpoint, onClose will be called on the delegate when complete */ void disconnect(); /** @@ -174,7 +174,7 @@ public: */ void emit(std::string eventname, std::string args); /** - * @brief Used to resgister a socket.io event callback + * @brief Used to register a socket.io event callback * Event argument should be passed using CC_CALLBACK2(&Base::function, this) */ void on(const std::string& eventName, SIOEvent e); diff --git a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp index c7dcae167c..0a4f31b5bb 100644 --- a/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp +++ b/tests/cpp-tests/Classes/Camera3DTest/Camera3DTest.cpp @@ -176,13 +176,13 @@ static Layer* restartSpriteTestAction() Camera3DTestDemo::Camera3DTestDemo(void) : BaseTest() -, _camera(nullptr) , _incRot(nullptr) +, _camera(nullptr) , _decRot(nullptr) -,_bZoomOut(false) -,_bZoomIn(false) -,_bRotateLeft(false) -,_bRotateRight(false) +, _bZoomOut(false) +, _bZoomIn(false) +, _bRotateLeft(false) +, _bRotateRight(false) { } Camera3DTestDemo::~Camera3DTestDemo(void) diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp index 5d4cc3ba9a..14c78a5c7a 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.cpp @@ -790,8 +790,7 @@ void AttributeComponentTest::defaultPlay() } TriggerTest::TriggerTest() -: _node(nullptr) -, _touchListener(nullptr) +: _touchListener(nullptr) { } diff --git a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h index a21187c159..f9f25d24b8 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/CocoStudioSceneTest/SceneEditorTest.h @@ -223,10 +223,9 @@ public: cocos2d::Node* createGameScene(); private: - cocos2d::Node *_node; + void defaultPlay(); + cocos2d::EventListener* _touchListener; -private: - void defaultPlay(); }; #endif // __HELLOWORLD_SCENE_H__ diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp index 1a4e3ddc64..d56c7d28a8 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp +++ b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.cpp @@ -77,7 +77,6 @@ void Light::updateLightState() } NotificationCenterTest::NotificationCenterTest() -: _showImage(false) { auto s = Director::getInstance()->getWinSize(); diff --git a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h index 2a7368abb5..1bfa9ca7cc 100644 --- a/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h +++ b/tests/cpp-tests/Classes/ExtensionsTest/NotificationCenterTest/NotificationCenterTest.h @@ -11,8 +11,6 @@ public: void toggleSwitch(cocos2d::Ref *sender); void connectToSwitch(cocos2d::Ref *sender); void doNothing(cocos2d::Ref *sender); -private: - bool _showImage; }; void runNotificationCenterTest(); diff --git a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp index 76ed0c977e..572fb7f3e8 100644 --- a/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp +++ b/tests/cpp-tests/Classes/NewEventDispatcherTest/NewEventDispatcherTest.cpp @@ -1350,17 +1350,14 @@ public: Sprite::onExit(); } -private: - - EventListenerTouchOneByOne * _eventListener; - int _fixedPriority; - TappedCallback _tappedCallback; +private: + EventListenerTouchOneByOne* _eventListener; + TappedCallback _tappedCallback; }; DanglingNodePointersTest::DanglingNodePointersTest() { #if CC_NODE_DEBUG_VERIFY_EVENT_LISTENERS == 1 && COCOS2D_DEBUG > 0 - Vec2 origin = Director::getInstance()->getVisibleOrigin(); Size size = Director::getInstance()->getVisibleSize(); diff --git a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp index de28727c7b..2439a774ce 100644 --- a/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp +++ b/tests/cpp-tests/Classes/ParallaxTest/ParallaxTest.cpp @@ -155,8 +155,8 @@ std::string Parallax2::title() const //------------------------------------------------------------------ Issue2572::Issue2572() : _preListSize(0) -, _printCount(0) , _moveTimer(0.0f) +, _printCount(0) , _addTimer(0.0f) { _addChildStep = 1.0f;