Browse Source

Remove more semicolons to suppress the GCC pedantic warnings.

Yao Wei Tjong 姚伟忠 6 years ago
parent
commit
7c99a1c508

+ 2 - 2
Source/ThirdParty/toluapp/include/tolua++.h

@@ -139,13 +139,13 @@ static inline const char* tolua_tocppstring (lua_State* L, int narg, const char*
 
 	const char* s = tolua_tostring(L, narg, def);
 	return s?s:"";
-};
+}
 
 static inline const char* tolua_tofieldcppstring (lua_State* L, int lo, int index, const char* def) {
 
 	const char* s = tolua_tofieldstring(L, lo, index, def);
 	return s?s:"";
-};
+}
 
 #else
 #define tolua_tocppstring tolua_tostring

+ 1 - 1
Source/Urho3D/Audio/SoundStream.cpp

@@ -64,4 +64,4 @@ unsigned SoundStream::GetSampleSize() const
     return size;
 }
 
-};
+}

+ 2 - 1
Source/Urho3D/Container/HashMap.h

@@ -357,7 +357,8 @@ public:
     {
         this->operator [](key) = value;
         return *this;
-    };
+    }
+
     /// Populate the map using variadic template.
     template <typename... Args> HashMap& Populate(const T& key, const U& value, const Args&... args)
     {

+ 1 - 1
Source/Urho3D/Graphics/Renderer.cpp

@@ -1941,7 +1941,7 @@ String Renderer::GetShadowVariations() const
             return "VSM_SHADOW ";
     }
     return "";
-};
+}
 
 void Renderer::HandleScreenMode(StringHash eventType, VariantMap& eventData)
 {

+ 1 - 1
Source/Urho3D/LuaScript/LuaScriptEventListener.h

@@ -32,7 +32,7 @@ class URHO3D_API LuaScriptEventListener
 {
 public:
     /// Destruct.
-    virtual ~LuaScriptEventListener() = default;;
+    virtual ~LuaScriptEventListener() = default;
 
     /// Add a scripted event handler by function at the given stack index.
     virtual void AddEventHandler(const String& eventName, int index) = 0;

+ 3 - 0
Source/Urho3D/LuaScript/pkgs/ToCppHook.lua

@@ -104,6 +104,9 @@ function post_output_hook(package)
     result = string.gsub(result, "@1%(", "(\"\",")      -- is_pointer overload uses const char* as signature
     result = string.gsub(result, "@2%(", "(0.f,")       -- is_arithmetic overload uses double as signature
 
+    -- Suppress GCC 'pedantic' warnings due to extra semicolon in the emitted code
+    result = string.gsub(result, "TOLUA_API int luaopen_(.+)};", "TOLUA_API int luaopen_%1}")
+
     WRITE(result)
     WRITE([[
 #if __clang__

+ 1 - 1
Source/Urho3D/Scene/SplinePath.h

@@ -45,7 +45,7 @@ public:
     explicit SplinePath(Context* context);
 
     /// Destructor.
-    ~SplinePath() override = default;;
+    ~SplinePath() override = default;
     /// Register object factory.
     static void RegisterObject(Context* context);