From 4600c41f9bd0a04d7233be1e713a09936c5c2a6c Mon Sep 17 00:00:00 2001 From: mogemimi Date: Fri, 16 Oct 2015 14:58:53 +0900 Subject: [PATCH] Add override keywords --- .../scripting/js-bindings/manual/ScriptingCore.h | 16 ++++++++-------- extensions/Particle3D/PU/CCPURibbonTrail.h | 4 ++-- tests/js-tests/project/Classes/AppDelegate.h | 6 +++--- .../project/Classes/js_DrawNode3D_bindings.cpp | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cocos/scripting/js-bindings/manual/ScriptingCore.h b/cocos/scripting/js-bindings/manual/ScriptingCore.h index 8f1a608302..41b020e8b5 100644 --- a/cocos/scripting/js-bindings/manual/ScriptingCore.h +++ b/cocos/scripting/js-bindings/manual/ScriptingCore.h @@ -99,19 +99,19 @@ public: * Gets the script type, for ScriptingCore, it will return `cocos2d::kScriptTypeJavascript` * @return `cocos2d::kScriptTypeJavascript` */ - virtual cocos2d::ccScriptType getScriptType() { return cocos2d::kScriptTypeJavascript; }; + virtual cocos2d::ccScriptType getScriptType() override { return cocos2d::kScriptTypeJavascript; }; /** * @brief @~english Removes the C++ object's linked JavaScript proxy object from JavaScript context * @param obj @~english Object to be removed */ - virtual void removeScriptObjectByObject(cocos2d::Ref* obj); + virtual void removeScriptObjectByObject(cocos2d::Ref* obj) override; /** * @brief @~english Useless in ScriptingCore, please use evalString * @see evalString */ - virtual int executeString(const char* codes) { return 0; } + virtual int executeString(const char* codes) override { return 0; } /** * @brief @~english Pause scheduled tasks and actions for an object proxy. @@ -133,14 +133,14 @@ public: @brief Useless in ScriptingCore, please use runScript @param filename String object holding the filename of the script file that is to be executed */ - virtual int executeScriptFile(const char* filename) { return 0; } + virtual int executeScriptFile(const char* filename) override { return 0; } /** @brief @~english Useless in ScriptingCore, please use executeFunctionWithOwner @param functionName String object holding the name of the function, in the global script environment, that is to be executed. @return The integer value returned from the script function. */ - virtual int executeGlobalFunction(const char* functionName) { return 0; } + virtual int executeGlobalFunction(const char* functionName) override { return 0; } virtual int sendEvent(cocos2d::ScriptEvent* message) override; @@ -149,10 +149,10 @@ public: * @brief @~english Useless in ScriptingCore * @return @~english false */ - virtual bool handleAssert(const char *msg) { return false; } + virtual bool handleAssert(const char *msg) override { return false; } - virtual void setCalledFromScript(bool callFromScript) { _callFromScript = callFromScript; }; - virtual bool isCalledFromScript() { return _callFromScript; }; + virtual void setCalledFromScript(bool callFromScript) override { _callFromScript = callFromScript; }; + virtual bool isCalledFromScript() override { return _callFromScript; }; /** * @brief @~english Execute a js function with a JavaScript object as parameter. diff --git a/extensions/Particle3D/PU/CCPURibbonTrail.h b/extensions/Particle3D/PU/CCPURibbonTrail.h index 00ccf78781..d31a4aaed6 100644 --- a/extensions/Particle3D/PU/CCPURibbonTrail.h +++ b/extensions/Particle3D/PU/CCPURibbonTrail.h @@ -75,11 +75,11 @@ public: virtual float getTrailLength(void) const { return _trailLength; } /** @copydoc BillboardChain::setMaxChainElements */ - void setMaxChainElements(size_t maxElements); + void setMaxChainElements(size_t maxElements) override; /** @copydoc BillboardChain::setNumberOfChains */ virtual void setNumberOfChains(size_t numChains) override; /** @copydoc BillboardChain::clearChain */ - void clearChain(size_t chainIndex); + void clearChain(size_t chainIndex) override; /** Set the starting ribbon colour for a given segment. @param chainIndex The index of the chain diff --git a/tests/js-tests/project/Classes/AppDelegate.h b/tests/js-tests/project/Classes/AppDelegate.h index ee146a75d9..aabb7fa2f4 100644 --- a/tests/js-tests/project/Classes/AppDelegate.h +++ b/tests/js-tests/project/Classes/AppDelegate.h @@ -20,19 +20,19 @@ public: @return true Initialize success, app continue. @return false Initialize failed, app terminate. */ - virtual bool applicationDidFinishLaunching(); + virtual bool applicationDidFinishLaunching() override; /** @brief The function be called when the application enter background @param the pointer of the application */ - virtual void applicationDidEnterBackground(); + virtual void applicationDidEnterBackground() override; /** @brief The function be called when the application enter foreground @param the pointer of the application */ - virtual void applicationWillEnterForeground(); + virtual void applicationWillEnterForeground() override; }; #endif // _APP_DELEGATE_H_ diff --git a/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp b/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp index b8cd8a42e4..9618fb9926 100644 --- a/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp +++ b/tests/js-tests/project/Classes/js_DrawNode3D_bindings.cpp @@ -82,7 +82,7 @@ public: CC_CONSTRUCTOR_ACCESS: DrawNode3D(); virtual ~DrawNode3D(); - virtual bool init(); + virtual bool init() override; protected: struct V3F_C4B