Browse Source

Several warnings fixed with '-Wall -Wextra' and on MSVC with '/W4'.

Michael Ragazzon 5 years ago
parent
commit
005b4042c7
63 changed files with 333 additions and 353 deletions
  1. 2 1
      .appveyor.yml
  2. 1 1
      .travis.yml
  3. 1 1
      Include/RmlUi/Core/Lua/LuaType.inl
  4. 2 9
      Include/RmlUi/Core/Platform.h
  5. 1 0
      Include/RmlUi/Core/StyleSheet.h
  6. 1 0
      Include/RmlUi/Core/TypeConverter.h
  7. 2 2
      Samples/basic/animation/src/main.cpp
  8. 2 2
      Samples/basic/benchmark/src/main.cpp
  9. 1 1
      Samples/basic/bitmapfont/src/FontEngineBitmap.cpp
  10. 1 1
      Samples/basic/bitmapfont/src/FontEngineBitmap.h
  11. 6 6
      Samples/basic/bitmapfont/src/FontEngineInterfaceBitmap.cpp
  12. 6 2
      Samples/basic/demo/src/main.cpp
  13. 91 91
      Samples/basic/sdl2/src/main.cpp
  14. 4 6
      Samples/basic/sfml2/src/RenderInterfaceSFML.cpp
  15. 1 1
      Samples/basic/sfml2/src/SystemInterfaceSFML.cpp
  16. 1 1
      Samples/basic/sfml2/src/SystemInterfaceSFML.h
  17. 23 23
      Samples/basic/sfml2/src/main.cpp
  18. 2 3
      Samples/invaders/src/DecoratorInstancerDefender.cpp
  19. 2 3
      Samples/invaders/src/DecoratorInstancerStarfield.cpp
  20. 1 1
      Samples/invaders/src/EventInstancer.cpp
  21. 2 3
      Samples/luainvaders/src/DecoratorInstancerDefender.cpp
  22. 2 3
      Samples/luainvaders/src/DecoratorInstancerStarfield.cpp
  23. 2 2
      Samples/luainvaders/src/LuaInterface.cpp
  24. 3 3
      Samples/shell/src/ShellRenderInterfaceOpenGL.cpp
  25. 2 2
      Samples/shell/src/win32/ShellWin32.cpp
  26. 2 3
      Samples/tutorial/datagrid/src/DecoratorInstancerDefender.cpp
  27. 2 3
      Samples/tutorial/datagrid_tree/src/DecoratorInstancerDefender.cpp
  28. 8 8
      Source/Controls/ElementDataGridRow.cpp
  29. 6 6
      Source/Controls/ElementFormControlDataSelect.cpp
  30. 2 4
      Source/Controls/InputTypeButton.cpp
  31. 1 1
      Source/Controls/InputTypeRange.cpp
  32. 1 1
      Source/Controls/Lua/ElementFormControlSelect.cpp
  33. 10 10
      Source/Controls/WidgetTextInput.cpp
  34. 1 1
      Source/Core/ComputeProperty.cpp
  35. 1 1
      Source/Core/Context.cpp
  36. 3 3
      Source/Core/DecoratorTiledInstancer.cpp
  37. 6 3
      Source/Core/Element.cpp
  38. 6 5
      Source/Core/ElementAnimation.cpp
  39. 7 2
      Source/Core/ElementStyle.cpp
  40. 2 2
      Source/Core/FontEngineDefault/FontFaceHandleDefault.cpp
  41. 1 1
      Source/Core/FontEngineDefault/FontFaceLayer.cpp
  42. 3 3
      Source/Core/FontEngineDefault/FreeTypeInterface.cpp
  43. 15 24
      Source/Core/FontEngineInterface.cpp
  44. 1 0
      Source/Core/IdNameMap.h
  45. 3 2
      Source/Core/LayoutEngine.cpp
  46. 2 2
      Source/Core/Lua/Context.cpp
  47. 4 4
      Source/Core/Lua/Document.cpp
  48. 4 4
      Source/Core/Lua/Element.cpp
  49. 2 2
      Source/Core/Lua/Event.cpp
  50. 1 1
      Source/Core/Lua/LuaDocumentElementInstancer.cpp
  51. 1 1
      Source/Core/Lua/LuaEventListener.cpp
  52. 4 4
      Source/Core/Lua/RmlUi.cpp
  53. 1 1
      Source/Core/PropertyParserAnimation.cpp
  54. 2 2
      Source/Core/PropertyParserColour.cpp
  55. 36 33
      Source/Core/PropertyParserTransform.cpp
  56. 3 2
      Source/Core/PropertyParserTransform.h
  57. 7 25
      Source/Core/RenderInterface.cpp
  58. 2 2
      Source/Core/Spritesheet.cpp
  59. 3 3
      Source/Core/StyleSheetParser.cpp
  60. 1 1
      Source/Core/StyleSheetParser.h
  61. 2 4
      Source/Core/SystemInterface.cpp
  62. 8 8
      Source/Core/TransformPrimitive.cpp
  63. 7 3
      changelog.md

+ 2 - 1
.appveyor.yml

@@ -2,6 +2,7 @@ version: build.{build}
 image: Visual Studio 2017
 environment:
   FREETYPE_VER: 2.10.1
+  CXXFLAGS: /DWIN32 /D_WINDOWS /W4 /GR /EHsc /permissive- /w44062
   matrix:
     - VS_GENERATOR: Visual Studio 15 2017 Win64
       PLATFORM_NAME: win64
@@ -20,7 +21,7 @@ install:
     mkdir Build-Dynamic, Build-Static
     
     cd Build-Dynamic
-    cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=ON -DBUILD_SAMPLES=ON ..
+    cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=ON -DBUILD_SAMPLES=ON -DCMAKE_CXX_FLAGS="%CXXFLAGS%" ..
 
     cd ../Build-Static
     cmake -G "%VS_GENERATOR%" -DBUILD_SHARED_LIBS=OFF -DBUILD_SAMPLES=OFF ..

+ 1 - 1
.travis.yml

@@ -3,7 +3,7 @@ dist: bionic
 language: c++
 env:
   global:
-    - CXXFLAGS="-pedantic -Wall"
+    - CXXFLAGS="-pedantic -Wall -Wextra"
 
 cache: 
   apt: true

+ 1 - 1
Include/RmlUi/Core/Lua/LuaType.inl

@@ -292,7 +292,7 @@ int LuaType<T>::newindex(lua_State* L)
 
 
 template<typename T>
-void LuaType<T>::_regfunctions(lua_State* L, int meta, int methods)
+void LuaType<T>::_regfunctions(lua_State* L, int /*meta*/, int methods)
 {
     //fill method table with methods.
     for(RegType* m = (RegType*)GetMethodTable<T>(); m->name; m++)

+ 2 - 9
Include/RmlUi/Core/Platform.h

@@ -57,21 +57,14 @@
 
 
 #if defined(RMLUI_PLATFORM_WIN32) && !defined(__MINGW32__)
-	// alignment of a member was sensitive to packing
-	#pragma warning(disable : 4121)
+	// declaration of 'identifier' hides class member
+	#pragma warning(disable : 4458)
 
 	// <type> needs to have dll-interface to be used by clients
 	#pragma warning(disable : 4251)
 
-	// assignment operator could not be generated
-	#pragma warning(disable : 4512)
-
 	// <function> was declared deprecated
 	#pragma warning(disable : 4996)
-
-	#if !defined _CRT_SECURE_NO_DEPRECATE
-		#define _CRT_SECURE_NO_DEPRECATE
-	#endif
 #endif
 
 // Wraps unused variables in methods or functions to avoid compiler warnings.  This should

+ 1 - 0
Include/RmlUi/Core/StyleSheet.h

@@ -47,6 +47,7 @@ struct Sprite;
 struct Spritesheet;
 
 struct KeyframeBlock {
+	KeyframeBlock(float normalized_time) : normalized_time(normalized_time) {}
 	float normalized_time;  // [0, 1]
 	PropertyDictionary properties;
 };

+ 1 - 0
Include/RmlUi/Core/TypeConverter.h

@@ -29,6 +29,7 @@
 #ifndef RMLUICORETYPECONVERTER_H
 #define RMLUICORETYPECONVERTER_H
 
+#include "Platform.h"
 #include "Types.h"
 #include "Log.h"
 #include "StringUtilities.h"

+ 2 - 2
Samples/basic/animation/src/main.cpp

@@ -308,7 +308,7 @@ public:
 		}
 	}
 
-	void OnDetach(Rml::Core::Element* element) override { delete this; }
+	void OnDetach(Rml::Core::Element* /*element*/) override { delete this; }
 
 private:
 	Rml::Core::String value;
@@ -320,7 +320,7 @@ class EventInstancer : public Rml::Core::EventListenerInstancer
 public:
 
 	/// Instances a new event handle for Invaders.
-	Rml::Core::EventListener* InstanceEventListener(const Rml::Core::String& value, Rml::Core::Element* element) override
+	Rml::Core::EventListener* InstanceEventListener(const Rml::Core::String& value, Rml::Core::Element* /*element*/) override
 	{
 		return new Event(value);
 	}

+ 2 - 2
Samples/basic/benchmark/src/main.cpp

@@ -220,7 +220,7 @@ public:
 		}
 	}
 
-	void OnDetach(Rml::Core::Element* element) override { delete this; }
+	void OnDetach(Rml::Core::Element* /*element*/) override { delete this; }
 
 private:
 	Rml::Core::String value;
@@ -232,7 +232,7 @@ class EventInstancer : public Rml::Core::EventListenerInstancer
 public:
 
 	/// Instances a new event handle for Invaders.
-	Rml::Core::EventListener* InstanceEventListener(const Rml::Core::String& value, Rml::Core::Element* element) override
+	Rml::Core::EventListener* InstanceEventListener(const Rml::Core::String& value, Rml::Core::Element* /*element*/) override
 	{
 		return new Event(value);
 	}

+ 1 - 1
Samples/basic/bitmapfont/src/FontEngineBitmap.cpp

@@ -45,7 +45,7 @@ namespace FontProviderBitmap
 		fonts.clear();
 	}
 
-	bool LoadFontFace(const String& file_name, bool fallback_face)
+	bool LoadFontFace(const String& file_name)
 	{
 		// Load the xml meta file into memory
 		std::unique_ptr<byte[]> data;

+ 1 - 1
Samples/basic/bitmapfont/src/FontEngineBitmap.h

@@ -39,7 +39,7 @@ namespace FontProviderBitmap
 {
 	void Initialise();
 	void Shutdown();
-	bool LoadFontFace(const String& file_name, bool fallback_face);
+	bool LoadFontFace(const String& file_name);
 	FontFaceBitmap* GetFontFaceHandle(const String& family, FontStyle style, FontWeight weight, int size);
 }
 

+ 6 - 6
Samples/basic/bitmapfont/src/FontEngineInterfaceBitmap.cpp

@@ -40,12 +40,12 @@ FontEngineInterfaceBitmap::~FontEngineInterfaceBitmap()
 	FontProviderBitmap::Shutdown();
 }
 
-bool FontEngineInterfaceBitmap::LoadFontFace(const String& file_name, bool fallback_face)
+bool FontEngineInterfaceBitmap::LoadFontFace(const String& file_name, bool /*fallback_face*/)
 {
-	return FontProviderBitmap::LoadFontFace(file_name, fallback_face);
+	return FontProviderBitmap::LoadFontFace(file_name);
 }
 
-bool FontEngineInterfaceBitmap::LoadFontFace(const byte* data, int data_size, const String& font_family, FontStyle style, FontWeight weight, bool fallback_face)
+bool FontEngineInterfaceBitmap::LoadFontFace(const byte* /*data*/, int /*data_size*/, const String& font_family, FontStyle /*style*/, FontWeight /*weight*/, bool /*fallback_face*/)
 {
 	// We return 'true' here to allow the debugger to continue loading, but we will use our own fonts when it asks for a handle.
 	// The debugger might look a bit off with our own fonts, but hey it works.
@@ -61,7 +61,7 @@ FontFaceHandle FontEngineInterfaceBitmap::GetFontFaceHandle(const String& family
 	return reinterpret_cast<FontFaceHandle>(handle);
 }
 
-FontEffectsHandle FontEngineInterfaceBitmap::PrepareFontEffects(FontFaceHandle handle, const FontEffectList& font_effects)
+FontEffectsHandle FontEngineInterfaceBitmap::PrepareFontEffects(FontFaceHandle /*handle*/, const FontEffectList& /*font_effects*/)
 {
 	// Font effects are not rendered in this implementation.
 	return 0;
@@ -104,14 +104,14 @@ int FontEngineInterfaceBitmap::GetStringWidth(FontFaceHandle handle, const Strin
 	return handle_bitmap->GetStringWidth(string, prior_character);
 }
 
-int FontEngineInterfaceBitmap::GenerateString(FontFaceHandle handle, FontEffectsHandle font_effects_handle, const String& string,
+int FontEngineInterfaceBitmap::GenerateString(FontFaceHandle handle, FontEffectsHandle /*font_effects_handle*/, const String& string,
 	const Vector2f& position, const Colourb& colour, GeometryList& geometry)
 {
 	auto handle_bitmap = reinterpret_cast<FontFaceBitmap*>(handle);
 	return handle_bitmap->GenerateString(string, position, colour, geometry);
 }
 
-int FontEngineInterfaceBitmap::GetVersion(FontFaceHandle handle)
+int FontEngineInterfaceBitmap::GetVersion(FontFaceHandle /*handle*/)
 {
 	return 0;
 }

+ 6 - 2
Samples/basic/demo/src/main.cpp

@@ -309,7 +309,7 @@ public:
 		}
 		else if (value == "change_color")
 		{
-			Colourb color(Math::RandomInteger(255), Math::RandomInteger(255), Math::RandomInteger(255));
+			Colourb color((byte)Math::RandomInteger(255), (byte)Math::RandomInteger(255), (byte)Math::RandomInteger(255));
 			element->Animate("image-color", Property(color, Property::COLOUR), tweening_parameters.duration, Tween(tweening_parameters.type, tweening_parameters.direction));
 			event.StopPropagation();
 		}
@@ -342,7 +342,9 @@ public:
 			if (it != tweening_functions.end())
 				tweening_parameters.type = it->second;
 			else
+			{
 				RMLUI_ERROR;
+			}
 		}
 		else if (value == "tween_direction")
 		{
@@ -354,7 +356,9 @@ public:
 			else if(value == "in-out")
 				tweening_parameters.direction = Tween::InOut;
 			else
+			{
 				RMLUI_ERROR;
+			}
 		}
 		else if (value == "tween_duration")
 		{
@@ -425,7 +429,7 @@ public:
 		}
 	}
 
-	void OnDetach(Rml::Core::Element* element) override { delete this; }
+	void OnDetach(Rml::Core::Element* /*element*/) override { delete this; }
 
 private:
 	Rml::Core::String value;

+ 91 - 91
Samples/basic/sdl2/src/main.cpp

@@ -40,54 +40,54 @@
 
 #include <GL/glew.h>
 
-int main(int argc, char **argv)
+int main(int /*argc*/, char** /*argv*/)
 {
 #ifdef RMLUI_PLATFORM_WIN32
-        DoAllocConsole();
+	DoAllocConsole();
 #endif
 
-        int window_width = 1024;
-        int window_height = 768;
-
-    SDL_Init( SDL_INIT_VIDEO );
-    SDL_Window * screen = SDL_CreateWindow("LibRmlUi SDL2 test", 20, 20, window_width, window_height, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
-    SDL_GLContext glcontext = SDL_GL_CreateContext(screen);
-    int oglIdx = -1;
-    int nRD = SDL_GetNumRenderDrivers();
-    for(int i=0; i<nRD; i++)
-    {
-        SDL_RendererInfo info;
-        if(!SDL_GetRenderDriverInfo(i, &info))
-        {
-            if(!strcmp(info.name, "opengl"))
-            {
-                oglIdx = i;
-            }
-        }
-    }
-    SDL_Renderer * renderer = SDL_CreateRenderer(screen, oglIdx, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
-
-    GLenum err = glewInit();
-
-    if(err != GLEW_OK)
-        fprintf(stderr, "GLEW ERROR: %s\n", glewGetErrorString(err));
-
-    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
-    glMatrixMode(GL_PROJECTION|GL_MODELVIEW);
-    glLoadIdentity();
-    glOrtho(0, window_width, window_height, 0, 0, 1);
- 
+	int window_width = 1024;
+	int window_height = 768;
+
+	SDL_Init(SDL_INIT_VIDEO);
+	SDL_Window* screen = SDL_CreateWindow("LibRmlUi SDL2 test", 20, 20, window_width, window_height, SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE);
+	SDL_GLContext glcontext = SDL_GL_CreateContext(screen);
+	int oglIdx = -1;
+	int nRD = SDL_GetNumRenderDrivers();
+	for (int i = 0; i < nRD; i++)
+	{
+		SDL_RendererInfo info;
+		if (!SDL_GetRenderDriverInfo(i, &info))
+		{
+			if (!strcmp(info.name, "opengl"))
+			{
+				oglIdx = i;
+			}
+		}
+	}
+	SDL_Renderer* renderer = SDL_CreateRenderer(screen, oglIdx, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
+
+	GLenum err = glewInit();
+
+	if (err != GLEW_OK)
+		fprintf(stderr, "GLEW ERROR: %s\n", glewGetErrorString(err));
+
+	SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
+	glMatrixMode(GL_PROJECTION | GL_MODELVIEW);
+	glLoadIdentity();
+	glOrtho(0, window_width, window_height, 0, 0, 1);
+
 	RmlUiSDL2Renderer Renderer(renderer, screen);
 	RmlUiSDL2SystemInterface SystemInterface;
-	
+
 	Rml::Core::String root = Shell::FindSamplesRoot();
 	ShellFileInterface FileInterface(root);
 
 	Rml::Core::SetFileInterface(&FileInterface);
 	Rml::Core::SetRenderInterface(&Renderer);
-    Rml::Core::SetSystemInterface(&SystemInterface);
+	Rml::Core::SetSystemInterface(&SystemInterface);
 
-	if(!Rml::Core::Initialise())
+	if (!Rml::Core::Initialise())
 		return 1;
 
 	Rml::Core::LoadFontFace("assets/Delicious-Bold.otf");
@@ -95,14 +95,14 @@ int main(int argc, char **argv)
 	Rml::Core::LoadFontFace("assets/Delicious-Italic.otf");
 	Rml::Core::LoadFontFace("assets/Delicious-Roman.otf");
 
-	Rml::Core::Context *Context = Rml::Core::CreateContext("default",
+	Rml::Core::Context* Context = Rml::Core::CreateContext("default",
 		Rml::Core::Vector2i(window_width, window_height));
 
 	Rml::Debugger::Initialise(Context);
 
-	Rml::Core::ElementDocument *Document = Context->LoadDocument("assets/demo.rml");
+	Rml::Core::ElementDocument* Document = Context->LoadDocument("assets/demo.rml");
 
-	if(Document)
+	if (Document)
 	{
 		Document->Show();
 		fprintf(stdout, "\nDocument loaded");
@@ -112,67 +112,67 @@ int main(int argc, char **argv)
 		fprintf(stdout, "\nDocument is nullptr");
 	}
 
-    bool done = false;
+	bool done = false;
 
-	while(!done)
+	while (!done)
 	{
-        SDL_Event event;
+		SDL_Event event;
 
-        SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255);
-        SDL_RenderClear(renderer);
+		SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255);
+		SDL_RenderClear(renderer);
 
 		Context->Render();
-        SDL_RenderPresent(renderer);
-
-        while(SDL_PollEvent(&event))
-        {
-            switch(event.type)
-            {
-                case SDL_QUIT:
-                    done = true;
-                    break;
-
-                case SDL_MOUSEMOTION:
-                    Context->ProcessMouseMove(event.motion.x, event.motion.y, SystemInterface.GetKeyModifiers());
-                    break;
-                case SDL_MOUSEBUTTONDOWN:
-                    Context->ProcessMouseButtonDown(SystemInterface.TranslateMouseButton(event.button.button), SystemInterface.GetKeyModifiers());
-                    break;
-
-                case SDL_MOUSEBUTTONUP:
-                    Context->ProcessMouseButtonUp(SystemInterface.TranslateMouseButton(event.button.button), SystemInterface.GetKeyModifiers());
-                    break;
-
-                case SDL_MOUSEWHEEL:
-                    Context->ProcessMouseWheel(event.wheel.y, SystemInterface.GetKeyModifiers());
-                    break;
-
-                case SDL_KEYDOWN:
-                {
-                    // Intercept F8 key stroke to toggle RmlUi's visual debugger tool
-                    if( event.key.keysym.sym == SDLK_F8 )
-                    {
-                        Rml::Debugger::SetVisible( ! Rml::Debugger::IsVisible() );
-                        break;
-                    }
-                    
-                    Context->ProcessKeyDown(SystemInterface.TranslateKey(event.key.keysym.sym), SystemInterface.GetKeyModifiers());
-                    break;
-                }
-                
-                default:
-                    break;
-            }
-        }
+		SDL_RenderPresent(renderer);
+
+		while (SDL_PollEvent(&event))
+		{
+			switch (event.type)
+			{
+			case SDL_QUIT:
+				done = true;
+				break;
+
+			case SDL_MOUSEMOTION:
+				Context->ProcessMouseMove(event.motion.x, event.motion.y, SystemInterface.GetKeyModifiers());
+				break;
+			case SDL_MOUSEBUTTONDOWN:
+				Context->ProcessMouseButtonDown(SystemInterface.TranslateMouseButton(event.button.button), SystemInterface.GetKeyModifiers());
+				break;
+
+			case SDL_MOUSEBUTTONUP:
+				Context->ProcessMouseButtonUp(SystemInterface.TranslateMouseButton(event.button.button), SystemInterface.GetKeyModifiers());
+				break;
+
+			case SDL_MOUSEWHEEL:
+				Context->ProcessMouseWheel(event.wheel.y, SystemInterface.GetKeyModifiers());
+				break;
+
+			case SDL_KEYDOWN:
+			{
+				// Intercept F8 key stroke to toggle RmlUi's visual debugger tool
+				if (event.key.keysym.sym == SDLK_F8)
+				{
+					Rml::Debugger::SetVisible(!Rml::Debugger::IsVisible());
+					break;
+				}
+
+				Context->ProcessKeyDown(SystemInterface.TranslateKey(event.key.keysym.sym), SystemInterface.GetKeyModifiers());
+				break;
+			}
+
+			default:
+				break;
+			}
+		}
 		Context->Update();
 	}
 
-    Rml::Core::Shutdown();
+	Rml::Core::Shutdown();
 
-    SDL_DestroyRenderer(renderer);
-    SDL_GL_DeleteContext(glcontext);
-    SDL_DestroyWindow(screen);
-    SDL_Quit();
+	SDL_DestroyRenderer(renderer);
+	SDL_GL_DeleteContext(glcontext);
+	SDL_DestroyWindow(screen);
+	SDL_Quit();
 
 	return 0;
 }

+ 4 - 6
Samples/basic/sfml2/src/RenderInterfaceSFML.cpp

@@ -207,15 +207,13 @@ void RmlUiSFMLRenderer::RenderCompiledGeometry(Rml::Core::CompiledGeometryHandle
 	glEnable(GL_TEXTURE_COORD_ARRAY);
 	glEnable(GL_COLOR_ARRAY);
 
-	#define BUFFER_OFFSET(x) ((char*)0 + x)
-
 	glBindBuffer(GL_ARRAY_BUFFER, RealGeometry->VertexID);
-	glVertexPointer(2, GL_FLOAT, sizeof(RmlUiSFMLRendererVertex), BUFFER_OFFSET(0));
-	glTexCoordPointer(2, GL_FLOAT, sizeof(RmlUiSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f)));
-	glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(RmlUiSFMLRendererVertex), BUFFER_OFFSET(sizeof(sf::Vector2f[2])));
+	glVertexPointer(2, GL_FLOAT, sizeof(RmlUiSFMLRendererVertex), (const void*)0);
+	glTexCoordPointer(2, GL_FLOAT, sizeof(RmlUiSFMLRendererVertex), (const void*)sizeof(sf::Vector2f));
+	glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(RmlUiSFMLRendererVertex), (const void*)sizeof(sf::Vector2f[2]));
 
 	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, RealGeometry->IndexID);
-	glDrawElements(GL_TRIANGLES, RealGeometry->NumVertices, GL_UNSIGNED_INT, BUFFER_OFFSET(0));
+	glDrawElements(GL_TRIANGLES, RealGeometry->NumVertices, GL_UNSIGNED_INT, (const void*)0);
 
 	glBindBuffer(GL_ARRAY_BUFFER, 0);
 

+ 1 - 1
Samples/basic/sfml2/src/SystemInterfaceSFML.cpp

@@ -28,7 +28,7 @@
 #include <RmlUi/Core.h>
 #include "SystemInterfaceSFML.h"
 
-int RmlUiSFMLSystemInterface::GetKeyModifiers(sf::Window *Window)
+int RmlUiSFMLSystemInterface::GetKeyModifiers()
 {
 	int Modifiers = 0;
 

+ 1 - 1
Samples/basic/sfml2/src/SystemInterfaceSFML.h

@@ -36,7 +36,7 @@ class RmlUiSFMLSystemInterface : public Rml::Core::SystemInterface
 {
 public:
 	Rml::Core::Input::KeyIdentifier TranslateKey(sf::Keyboard::Key Key);
-	int GetKeyModifiers(sf::Window *Window);
+	int GetKeyModifiers();
 	
 	double GetElapsedTime() override;
 	bool LogMessage(Rml::Core::Log::Type type, const Rml::Core::String& message) override;

+ 23 - 23
Samples/basic/sfml2/src/main.cpp

@@ -45,14 +45,14 @@
 #include <Shell.h>
 #include <ShellFileInterface.h>
 
-int main(int argc, char **argv)
+int main(int /*argc*/, char** /*argv*/)
 {
 #ifdef RMLUI_PLATFORM_WIN32
-        AllocConsole();
+	AllocConsole();
 #endif
 
-        int window_width = 1024;
-        int window_height = 768;
+	int window_width = 1024;
+	int window_height = 768;
 
 	sf::RenderWindow MyWindow(sf::VideoMode(window_width, window_height), "RmlUi with SFML2", sf::Style::Close);
 	MyWindow.setVerticalSyncEnabled(true);
@@ -61,9 +61,9 @@ int main(int argc, char **argv)
 	GLenum err = glewInit();
 	if (GLEW_OK != err)
 	{
-	  /* Problem: glewInit failed, something is seriously wrong. */
-	  fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
-	  //...
+		/* Problem: glewInit failed, something is seriously wrong. */
+		fprintf(stderr, "Error: %s\n", glewGetErrorString(err));
+		//...
 	}
 	fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
 #endif
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
 	Rml::Core::String root = Shell::FindSamplesRoot();
 	ShellFileInterface FileInterface(root);
 
-	if(!MyWindow.isOpen())
+	if (!MyWindow.isOpen())
 		return 1;
 
 	Renderer.SetWindow(&MyWindow);
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
 	Rml::Core::SetSystemInterface(&SystemInterface);
 
 
-	if(!Rml::Core::Initialise())
+	if (!Rml::Core::Initialise())
 		return 1;
 
 	Rml::Core::LoadFontFace("assets/Delicious-Bold.otf");
@@ -94,14 +94,14 @@ int main(int argc, char **argv)
 	Rml::Core::LoadFontFace("assets/Delicious-Italic.otf");
 	Rml::Core::LoadFontFace("assets/Delicious-Roman.otf");
 
-	Rml::Core::Context *Context = Rml::Core::CreateContext("default",
+	Rml::Core::Context* Context = Rml::Core::CreateContext("default",
 		Rml::Core::Vector2i(MyWindow.getSize().x, MyWindow.getSize().y));
 
 	Rml::Debugger::Initialise(Context);
 
-	Rml::Core::ElementDocument *Document = Context->LoadDocument("assets/demo.rml");
+	Rml::Core::ElementDocument* Document = Context->LoadDocument("assets/demo.rml");
 
-	if(Document)
+	if (Document)
 	{
 		Document->Show();
 		fprintf(stdout, "\nDocument loaded");
@@ -111,7 +111,7 @@ int main(int argc, char **argv)
 		fprintf(stdout, "\nDocument is nullptr");
 	}
 
-	while(MyWindow.isOpen())
+	while (MyWindow.isOpen())
 	{
 		static sf::Event event;
 
@@ -119,28 +119,28 @@ int main(int argc, char **argv)
 		Context->Render();
 		MyWindow.display();
 
-		while(MyWindow.pollEvent(event))
+		while (MyWindow.pollEvent(event))
 		{
-			switch(event.type)
+			switch (event.type)
 			{
 			case sf::Event::Resized:
 				Renderer.Resize();
 				break;
 			case sf::Event::MouseMoved:
 				Context->ProcessMouseMove(event.mouseMove.x, event.mouseMove.y,
-					SystemInterface.GetKeyModifiers(&MyWindow));
+					SystemInterface.GetKeyModifiers());
 				break;
 			case sf::Event::MouseButtonPressed:
 				Context->ProcessMouseButtonDown(event.mouseButton.button,
-					SystemInterface.GetKeyModifiers(&MyWindow));
+					SystemInterface.GetKeyModifiers());
 				break;
 			case sf::Event::MouseButtonReleased:
 				Context->ProcessMouseButtonUp(event.mouseButton.button,
-					SystemInterface.GetKeyModifiers(&MyWindow));
+					SystemInterface.GetKeyModifiers());
 				break;
 			case sf::Event::MouseWheelMoved:
 				Context->ProcessMouseWheel(-event.mouseWheel.delta,
-					SystemInterface.GetKeyModifiers(&MyWindow));
+					SystemInterface.GetKeyModifiers());
 				break;
 			case sf::Event::TextEntered:
 				if (event.text.unicode > 32)
@@ -148,20 +148,20 @@ int main(int argc, char **argv)
 				break;
 			case sf::Event::KeyPressed:
 				Context->ProcessKeyDown(SystemInterface.TranslateKey(event.key.code),
-					SystemInterface.GetKeyModifiers(&MyWindow));
+					SystemInterface.GetKeyModifiers());
 				break;
 			case sf::Event::KeyReleased:
-				if(event.key.code == sf::Keyboard::F8)
+				if (event.key.code == sf::Keyboard::F8)
 				{
 					Rml::Debugger::SetVisible(!Rml::Debugger::IsVisible());
 				};
 
-				if(event.key.code == sf::Keyboard::Escape) {
+				if (event.key.code == sf::Keyboard::Escape) {
 					MyWindow.close();
 				}
 
 				Context->ProcessKeyUp(SystemInterface.TranslateKey(event.key.code),
-					SystemInterface.GetKeyModifiers(&MyWindow));
+					SystemInterface.GetKeyModifiers());
 				break;
 			case sf::Event::Closed:
 				MyWindow.close();

+ 2 - 3
Samples/invaders/src/DecoratorInstancerDefender.cpp

@@ -43,10 +43,9 @@ DecoratorInstancerDefender::~DecoratorInstancerDefender()
 }
 
 // Instances a decorator given the property tag and attributes from the RCSS file.
-std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& RMLUI_UNUSED_PARAMETER(name), const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& interface)
+std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& /*name*/,
+	const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& /*interface*/)
 {
-	RMLUI_UNUSED(name);
-
 	const Rml::Core::Property* image_source_property = properties.GetProperty(id_image_src);
 	Rml::Core::String image_source = image_source_property->Get< Rml::Core::String >();
 	Rml::Core::String source_path;

+ 2 - 3
Samples/invaders/src/DecoratorInstancerStarfield.cpp

@@ -47,10 +47,9 @@ DecoratorInstancerStarfield::~DecoratorInstancerStarfield()
 }
 
 // Instances a decorator given the property tag and attributes from the RCSS file.
-std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerStarfield::InstanceDecorator(const Rml::Core::String& RMLUI_UNUSED_PARAMETER(name), const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& interface)
+std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerStarfield::InstanceDecorator(const Rml::Core::String& /*name*/,
+	const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& /*interface*/)
 {
-	RMLUI_UNUSED(name);
-
 	int num_layers = Rml::Core::Math::RealToInteger(properties.GetProperty(id_num_layers)->Get< float >());
 	Rml::Core::Colourb top_colour = properties.GetProperty(id_top_colour)->Get< Rml::Core::Colourb >();
 	Rml::Core::Colourb bottom_colour = properties.GetProperty(id_bottom_colour)->Get< Rml::Core::Colourb >();

+ 1 - 1
Samples/invaders/src/EventInstancer.cpp

@@ -38,7 +38,7 @@ EventInstancer::~EventInstancer()
 }
 
 // Instances a new event handle for Invaders.
-Rml::Core::EventListener* EventInstancer::InstanceEventListener(const Rml::Core::String& value, Rml::Core::Element* element)
+Rml::Core::EventListener* EventInstancer::InstanceEventListener(const Rml::Core::String& value, Rml::Core::Element* /*element*/)
 {
 	return new Event(value);
 }

+ 2 - 3
Samples/luainvaders/src/DecoratorInstancerDefender.cpp

@@ -43,10 +43,9 @@ DecoratorInstancerDefender::~DecoratorInstancerDefender()
 }
 
 // Instances a decorator given the property tag and attributes from the RCSS file.
-std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& RMLUI_UNUSED_PARAMETER(name), const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& interface)
+std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& /*name*/,
+	const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& /*interface*/)
 {
-	RMLUI_UNUSED(name);
-
 	const Rml::Core::Property* image_source_property = properties.GetProperty(id_image_src);
 	Rml::Core::String image_source = image_source_property->Get< Rml::Core::String >();
 	Rml::Core::String source_path;

+ 2 - 3
Samples/luainvaders/src/DecoratorInstancerStarfield.cpp

@@ -47,10 +47,9 @@ DecoratorInstancerStarfield::~DecoratorInstancerStarfield()
 }
 
 // Instances a decorator given the property tag and attributes from the RCSS file.
-std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerStarfield::InstanceDecorator(const Rml::Core::String& RMLUI_UNUSED_PARAMETER(name), const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& interface)
+std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerStarfield::InstanceDecorator(const Rml::Core::String& /*name*/,
+	const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& /*interface*/)
 {
-	RMLUI_UNUSED(name);
-
 	int num_layers = Rml::Core::Math::RealToInteger(properties.GetProperty(id_num_layers)->Get< float >());
 	Rml::Core::Colourb top_colour = properties.GetProperty(id_top_colour)->Get< Rml::Core::Colourb >();
 	Rml::Core::Colourb bottom_colour = properties.GetProperty(id_bottom_colour)->Get< Rml::Core::Colourb >();

+ 2 - 2
Samples/luainvaders/src/LuaInterface.cpp

@@ -71,7 +71,7 @@ void LuaInterface::InitGame(lua_State *L)
     lua_pop(L,1); //pop Game
 }
 
-int GameShutdown(lua_State* L)
+int GameShutdown(lua_State* /*L*/)
 {
     Shell::RequestExit();
     return 0;
@@ -98,7 +98,7 @@ int GameSetDefenderColour(lua_State* L)
     return 0;
 }
 
-int GameSubmitHighScore(lua_State* L)
+int GameSubmitHighScore(lua_State* /*L*/)
 {
     int score = GameDetails::GetScore();
     if(score > 0)

+ 3 - 3
Samples/shell/src/ShellRenderInterfaceOpenGL.cpp

@@ -119,13 +119,13 @@ void ShellRenderInterfaceOpenGL::SetScissorRegion(int x, int y, int width, int h
 		glScissor(x, m_height - (y + height), width, height);
 	} else {
 		// clear the stencil buffer
-		glStencilMask(-1);
+		glStencilMask(GLuint(-1));
 		glClear(GL_STENCIL_BUFFER_BIT);
 
 		// fill the stencil buffer
 		glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
 		glDepthMask(GL_FALSE);
-		glStencilFunc(GL_NEVER, 1, -1);
+		glStencilFunc(GL_NEVER, 1, GLuint(-1));
 		glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
 
 		float fx = (float)x;
@@ -150,7 +150,7 @@ void ShellRenderInterfaceOpenGL::SetScissorRegion(int x, int y, int width, int h
 		glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
 		glDepthMask(GL_TRUE);
 		glStencilMask(0);
-		glStencilFunc(GL_EQUAL, 1, -1);
+		glStencilFunc(GL_EQUAL, 1, GLuint(-1));
 	}
 }
 

+ 2 - 2
Samples/shell/src/win32/ShellWin32.cpp

@@ -377,7 +377,7 @@ void Shell::GetClipboardText(Rml::Core::String& text)
 	}
 }
 
-static LRESULT CALLBACK WindowProcedure(HWND window_handle, UINT message, WPARAM w_param, LPARAM l_param)
+static LRESULT CALLBACK WindowProcedure(HWND local_window_handle, UINT message, WPARAM w_param, LPARAM l_param)
 {
 	// See what kind of message we've got.
 	switch (message)
@@ -419,5 +419,5 @@ static LRESULT CALLBACK WindowProcedure(HWND window_handle, UINT message, WPARAM
 	}
 
 	// All unhandled messages go to DefWindowProc.
-	return DefWindowProc(window_handle, message, w_param, l_param);
+	return DefWindowProc(local_window_handle, message, w_param, l_param);
 }

+ 2 - 3
Samples/tutorial/datagrid/src/DecoratorInstancerDefender.cpp

@@ -26,10 +26,9 @@ DecoratorInstancerDefender::~DecoratorInstancerDefender()
 }
 
 // Instances a decorator given the property tag and attributes from the RCSS file.
-std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& RMLUI_UNUSED_PARAMETER(name), const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& interface)
+std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& /*name*/,
+	const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& /*interface*/)
 {
-	RMLUI_UNUSED(name);
-
 	const Rml::Core::Property* image_source_property = properties.GetProperty(id_image_src);
 	Rml::Core::String image_source = image_source_property->Get< Rml::Core::String >();
 	Rml::Core::String source_path;

+ 2 - 3
Samples/tutorial/datagrid_tree/src/DecoratorInstancerDefender.cpp

@@ -26,10 +26,9 @@ DecoratorInstancerDefender::~DecoratorInstancerDefender()
 }
 
 // Instances a decorator given the property tag and attributes from the RCSS file.
-std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& RMLUI_UNUSED_PARAMETER(name), const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& interface)
+std::shared_ptr<Rml::Core::Decorator> DecoratorInstancerDefender::InstanceDecorator(const Rml::Core::String& /*name*/,
+	const Rml::Core::PropertyDictionary& properties, const Rml::Core::DecoratorInstancerInterface& /*interface*/)
 {
-	RMLUI_UNUSED(name);
-
 	const Rml::Core::Property* image_source_property = properties.GetProperty(id_image_src);
 	Rml::Core::String image_source = image_source_property->Get< Rml::Core::String >();
 	Rml::Core::String source_path;

+ 8 - 8
Source/Controls/ElementDataGridRow.cpp

@@ -252,7 +252,7 @@ ElementDataGrid* ElementDataGridRow::GetParentGrid()
 	return parent_grid;
 }
 
-void ElementDataGridRow::OnDataSourceDestroy(DataSource* RMLUI_UNUSED_PARAMETER(_data_source))
+void ElementDataGridRow::OnDataSourceDestroy(DataSource* /*data_source*/)
 {
 	if(data_source != nullptr)
 	{
@@ -497,21 +497,21 @@ void ElementDataGridRow::Load(const DataQuery& row_information)
 			Rml::Core::StringList raw_data;
 			raw_data.reserve(column->fields.size());
 			size_t raw_data_total_len = 0;
-			for (size_t i = 0; i < column->fields.size(); i++)
+			for (size_t j = 0; j < column->fields.size(); j++)
 			{
-				if (column->fields[i] == DataSource::DEPTH)
+				if (column->fields[j] == DataSource::DEPTH)
 				{
 					raw_data.push_back(Rml::Core::CreateString(8, "%d", depth));
 					raw_data_total_len += raw_data.back().length();
 				}
-				else if (column->fields[i] == DataSource::NUM_CHILDREN)
+				else if (column->fields[j] == DataSource::NUM_CHILDREN)
 				{
 					raw_data.push_back(Rml::Core::CreateString(8, "%d", children.size()));
 					raw_data_total_len += raw_data.back().length();
 				}
 				else
 				{
-					raw_data.push_back(row_information.Get< Rml::Core::String >(column->fields[i], ""));
+					raw_data.push_back(row_information.Get< Rml::Core::String >(column->fields[j], ""));
 					raw_data_total_len += raw_data.back().length();
 				}
 			}
@@ -524,13 +524,13 @@ void ElementDataGridRow::Load(const DataQuery& row_information)
 			else
 			{
 				cell_string.reserve(raw_data_total_len + raw_data.size() + 1);
-				for (size_t i = 0; i < raw_data.size(); i++)
+				for (size_t j = 0; j < raw_data.size(); j++)
 				{
-					if (i > 0)
+					if (j > 0)
 					{
 						cell_string += ",";
 					}
-					cell_string += raw_data[i];
+					cell_string += raw_data[j];
 				}
 			}
 

+ 6 - 6
Source/Controls/ElementFormControlDataSelect.cpp

@@ -194,18 +194,18 @@ void ElementFormControlDataSelect::BuildOptions()
 	DataQuery query(data_source, data_table, fields);
 	while (query.NextRow())
 	{
-		Rml::Core::StringList fields;
+		Rml::Core::StringList fields_list;
 		Rml::Core::String value = query.Get<Rml::Core::String>(0, "");
 
 		for (size_t i = 1; i < query.GetNumFields(); ++i)
-			fields.push_back(query.Get< Rml::Core::String>(i, ""));
+			fields_list.push_back(query.Get< Rml::Core::String>(i, ""));
 
-		Rml::Core::String formatted("");
-		if (fields.size() > 0)
-			formatted = fields[0];
+		Rml::Core::String formatted;
+		if (fields_list.size() > 0)
+			formatted = fields_list[0];
 
 		if (data_formatter)
-			data_formatter->FormatData(formatted, fields);
+			data_formatter->FormatData(formatted, fields_list);
 
 		// Add the data as an option.
 		widget->AddOption(formatted, value, -1, false);

+ 2 - 4
Source/Controls/InputTypeButton.cpp

@@ -47,15 +47,13 @@ bool InputTypeButton::IsSubmitted()
 	return false;
 }
 
-void InputTypeButton::ProcessDefaultAction(Core::Event& event)
+void InputTypeButton::ProcessDefaultAction(Core::Event& /*event*/)
 {
 }
 
 // Sizes the dimensions to the element's inherent size.
-bool InputTypeButton::GetIntrinsicDimensions(Rml::Core::Vector2f& RMLUI_UNUSED_PARAMETER(dimensions))
+bool InputTypeButton::GetIntrinsicDimensions(Rml::Core::Vector2f& /*dimensions*/)
 {
-	RMLUI_UNUSED(dimensions);
-
 	return false;
 }
 

+ 1 - 1
Source/Controls/InputTypeRange.cpp

@@ -94,7 +94,7 @@ bool InputTypeRange::OnAttributeChange(const Core::ElementAttributes& changed_at
 }
 
 // Checks for necessary functional changes in the control as a result of the event.
-void InputTypeRange::ProcessDefaultAction(Core::Event& event)
+void InputTypeRange::ProcessDefaultAction(Core::Event& /*event*/)
 {
 }
 

+ 1 - 1
Source/Controls/Lua/ElementFormControlSelect.cpp

@@ -61,7 +61,7 @@ int ElementFormControlSelectRemove(lua_State* L, ElementFormControlSelect* obj)
     return 0;
 }
 
-int ElementFormControlSelectRemoveAll(lua_State* L, ElementFormControlSelect* obj)
+int ElementFormControlSelectRemoveAll(lua_State* /*L*/, ElementFormControlSelect* obj)
 {
     obj->RemoveAll();
     return 0;

+ 10 - 10
Source/Controls/WidgetTextInput.cpp

@@ -317,28 +317,28 @@ void WidgetTextInput::ProcessEvent(Core::Event& event)
 
 		switch (key_identifier)
 		{
-		case Core::Input::KI_NUMPAD4:	if (numlock) break;
+		case Core::Input::KI_NUMPAD4:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_LEFT:		MoveCursorHorizontal(ctrl ? CursorMovement::PreviousWord : CursorMovement::Left, shift); break;
 
-		case Core::Input::KI_NUMPAD6:	if (numlock) break;
+		case Core::Input::KI_NUMPAD6:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_RIGHT:		MoveCursorHorizontal(ctrl ? CursorMovement::NextWord : CursorMovement::Right, shift); break;
 
-		case Core::Input::KI_NUMPAD8:	if (numlock) break;
+		case Core::Input::KI_NUMPAD8:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_UP:		MoveCursorVertical(-1, shift); break;
 
-		case Core::Input::KI_NUMPAD2:	if (numlock) break;
+		case Core::Input::KI_NUMPAD2:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_DOWN:		MoveCursorVertical(1, shift); break;
 
-		case Core::Input::KI_NUMPAD7:	if (numlock) break;
+		case Core::Input::KI_NUMPAD7:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_HOME:		MoveCursorHorizontal(ctrl ? CursorMovement::Begin : CursorMovement::BeginLine, shift); break;
 
-		case Core::Input::KI_NUMPAD1:	if (numlock) break;
+		case Core::Input::KI_NUMPAD1:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_END:		MoveCursorHorizontal(ctrl ? CursorMovement::End : CursorMovement::EndLine, shift); break;
 
-		case Core::Input::KI_NUMPAD3:	if (numlock) break;
+		case Core::Input::KI_NUMPAD3:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_PRIOR:		MoveCursorVertical(-int(internal_dimensions.y / parent->GetLineHeight()) + 1, shift); break;
 
-		case Core::Input::KI_NUMPAD9:	if (numlock) break;
+		case Core::Input::KI_NUMPAD9:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_NEXT:		MoveCursorVertical(int(internal_dimensions.y / parent->GetLineHeight()) - 1, shift); break;
 
 		case Core::Input::KI_BACK:
@@ -354,7 +354,7 @@ void WidgetTextInput::ProcessEvent(Core::Event& event)
 		}
 		break;
 
-		case Core::Input::KI_DECIMAL:	if (numlock) break;
+		case Core::Input::KI_DECIMAL:	if (numlock) break; //-fallthrough
 		case Core::Input::KI_DELETE:
 		{
 			CursorMovement direction = (ctrl ? CursorMovement::NextWord : CursorMovement::Right);
@@ -466,7 +466,7 @@ void WidgetTextInput::ProcessEvent(Core::Event& event)
 			// specially by selecting whole words at a time, which is not yet implemented.
 			break;
 		}
-		// Else, fall through:
+		//-fallthrough
 	case EventId::Mousedown:
 	{
 		if (event.GetTargetElement() == parent)

+ 1 - 1
Source/Core/ComputeProperty.cpp

@@ -179,7 +179,7 @@ float ComputeFontsize(const Property& property, const Style::ComputedValues& val
 		{
 		case Property::PERCENT:
 			multiplier = 0.01f;
-			//[[fallthrough]];
+			//-fallthrough
 		case Property::EM:
 			if (!parent_values)
 				return 0;

+ 1 - 1
Source/Core/Context.cpp

@@ -511,7 +511,7 @@ bool Context::ProcessKeyUp(Input::KeyIdentifier key_identifier, int key_modifier
 bool Context::ProcessTextInput(char character)
 {
 	// Only the standard ASCII character set is a valid subset of UTF-8.
-	if (character < 0 || character > 127)
+	if (static_cast<unsigned char>(character) > 127)
 		return false;
 	return ProcessTextInput(static_cast<Character>(character));
 }

+ 3 - 3
Source/Core/DecoratorTiledInstancer.cpp

@@ -153,12 +153,12 @@ bool DecoratorTiledInstancer::GetTileProperties(DecoratorTiled::Tile* tiles, Tex
 				properties.GetProperty(ids.align_y)
 			};
 
-			for (int i = 0; i < 2; i++)
+			for (int dimension = 0; dimension < 2; dimension++)
 			{
 				using Style::LengthPercentage;
 
-				auto& align = tile.align[i];
-				auto& property = *align_properties[i];
+				LengthPercentage align = tile.align[dimension];
+				const Property& property = *align_properties[dimension];
 				if (property.unit == Property::KEYWORD)
 				{
 					enum { TOP_LEFT, CENTER, BOTTOM_RIGHT };

+ 6 - 3
Source/Core/Element.cpp

@@ -1786,12 +1786,12 @@ void Element::OnPropertyChange(const PropertyIdSet& changed_properties)
 }
 
 // Called when a child node has been added somewhere in the hierarchy
-void Element::OnChildAdd(Element* child)
+void Element::OnChildAdd(Element* /*child*/)
 {
 }
 
 // Called when a child node has been removed somewhere in the hierarchy
-void Element::OnChildRemove(Element* child)
+void Element::OnChildRemove(Element* /*child*/)
 {
 }
 
@@ -2323,7 +2323,10 @@ void Element::HandleAnimationProperty()
 		bool element_has_animations = (!animation_list.empty() || !animations.empty());
 		StyleSheet* stylesheet = nullptr;
 
-		if (element_has_animations && (stylesheet = GetStyleSheet().get()))
+		if (element_has_animations)
+			stylesheet = GetStyleSheet().get();
+
+		if (stylesheet)
 		{
 			// Remove existing animations
 			{

+ 6 - 5
Source/Core/ElementAnimation.cpp

@@ -316,6 +316,7 @@ static bool PrepareTransforms(std::vector<AnimationKey>& keys, Element& element,
 	for (int i = start_index; i < (int)keys.size(); i++)
 	{
 		Property& property = keys[i].property;
+		RMLUI_ASSERT(property.value.GetType() == Variant::TRANSFORMPTR);
 
 		if (!property.value.GetReference<TransformPtr>())
 			property.value = std::make_shared<Transform>();
@@ -333,7 +334,7 @@ static bool PrepareTransforms(std::vector<AnimationKey>& keys, Element& element,
 		}
 
 		if (must_decompose)
-			result = CombineAndDecompose(transform, element);
+			result &= CombineAndDecompose(transform, element);
 	}
 
 	if (!result)
@@ -370,13 +371,13 @@ static bool PrepareTransforms(std::vector<AnimationKey>& keys, Element& element,
 		auto& t0 = prop0.value.GetReference<TransformPtr>();
 		auto& t1 = prop1.value.GetReference<TransformPtr>();
 
-		auto result = PrepareTransformPair(*t0, *t1, element);
+		auto prepare_result = PrepareTransformPair(*t0, *t1, element);
 
-		if (result == PrepareTransformResult::Invalid)
+		if (prepare_result == PrepareTransformResult::Invalid)
 			return false;
 
-		bool changed_t0 = ((int)result & (int)PrepareTransformResult::ChangedT0);
-		bool changed_t1 = ((int)result & (int)PrepareTransformResult::ChangedT1);
+		bool changed_t0 = ((int)prepare_result & (int)PrepareTransformResult::ChangedT0);
+		bool changed_t1 = ((int)prepare_result & (int)PrepareTransformResult::ChangedT1);
 
 		dirty_list[i] = false;
 		dirty_list[i - 1] = dirty_list[i - 1] || changed_t0;

+ 7 - 2
Source/Core/ElementStyle.cpp

@@ -876,8 +876,13 @@ PropertyIdSet ElementStyle::ComputeValues(Style::ComputedValues& values, const S
 			else
 				values.font_effect.reset();
 			break;
-
-		default:
+		// Unhandled properties. Must be manually retrieved with 'GetProperty()'.
+		case PropertyId::FillImage:
+			break;
+		// Invalid properties
+		case PropertyId::Invalid:
+		case PropertyId::NumDefinedIds:
+		case PropertyId::MaxNumIds:
 			break;
 		}
 	}

+ 2 - 2
Source/Core/FontEngineDefault/FontFaceHandleDefault.cpp

@@ -251,8 +251,8 @@ int FontFaceHandleDefault::GenerateString(GeometryList& geometry, const String&
 		RMLUI_ASSERT(geometry_index < (int)geometry.size());
 
 		// Bind the textures to the geometries.
-		for (int i = 0; i < num_textures; ++i)
-			geometry[geometry_index + i].SetTexture(layer->GetTexture(i));
+		for (int tex_index = 0; tex_index < num_textures; ++tex_index)
+			geometry[geometry_index + tex_index].SetTexture(layer->GetTexture(tex_index));
 
 		line_width = 0;
 		Character prior_character = Character::Null;

+ 1 - 1
Source/Core/FontEngineDefault/FontFaceLayer.cpp

@@ -163,7 +163,7 @@ bool FontFaceLayer::Generate(const FontFaceHandleDefault* handle, const FontFace
 		{
 			int texture_id = i;
 
-			TextureCallback texture_callback = [handle, effect_ptr, texture_id, handle_version](const String& name, UniquePtr<const byte[]>& data, Vector2i& dimensions) -> bool {
+			TextureCallback texture_callback = [handle, effect_ptr, texture_id, handle_version](const String& /*name*/, UniquePtr<const byte[]>& data, Vector2i& dimensions) -> bool {
 				bool result = handle->GenerateLayerTexture(data, dimensions, effect_ptr, texture_id, handle_version);
 				return result;
 			};

+ 3 - 3
Source/Core/FontEngineDefault/FreeTypeInterface.cpp

@@ -41,7 +41,7 @@ static FT_Library ft_library = nullptr;
 
 static bool BuildGlyph(FT_Face ft_face, Character character, FontGlyphMap& glyphs);
 static void BuildGlyphMap(FT_Face ft_face, int size, FontGlyphMap& glyphs);
-static void GenerateMetrics(FT_Face ft_face, const FontGlyphMap& glyphs, FontMetrics& metrics);
+static void GenerateMetrics(FT_Face ft_face, FontMetrics& metrics);
 
 
 bool FreeType::Initialise()
@@ -139,7 +139,7 @@ bool FreeType::InitialiseFaceHandle(FontFaceHandleFreetype face, int font_size,
 	BuildGlyphMap(ft_face, font_size, glyphs);
 
 	// Generate the metrics for the handle.
-	GenerateMetrics(ft_face, glyphs, metrics);
+	GenerateMetrics(ft_face, metrics);
 
 	return true;
 }
@@ -356,7 +356,7 @@ static bool BuildGlyph(FT_Face ft_face, Character character, FontGlyphMap& glyph
 	return true;
 }
 
-static void GenerateMetrics(FT_Face ft_face, const FontGlyphMap& glyphs, FontMetrics& metrics)
+static void GenerateMetrics(FT_Face ft_face, FontMetrics& metrics)
 {
 	metrics.line_height = ft_face->size->metrics.height >> 6;
 	metrics.baseline = metrics.line_height - (ft_face->size->metrics.ascender >> 6);

+ 15 - 24
Source/Core/FontEngineInterface.cpp

@@ -39,74 +39,65 @@ FontEngineInterface::~FontEngineInterface()
 {
 }
 
-bool FontEngineInterface::LoadFontFace(const String& file_name, bool fallback_face)
+bool FontEngineInterface::LoadFontFace(const String& /*file_name*/, bool /*fallback_face*/)
 {
 	return false;
 }
 
-bool FontEngineInterface::LoadFontFace(const byte* data, int data_size, const String& font_family, Style::FontStyle style, Style::FontWeight weight, bool fallback_face)
+bool FontEngineInterface::LoadFontFace(const byte* /*data*/, int /*data_size*/, const String& /*font_family*/,
+	Style::FontStyle /*style*/, Style::FontWeight /*weight*/, bool /*fallback_face*/)
 {
 	return false;
 }
 
-FontFaceHandle FontEngineInterface::GetFontFaceHandle(const String& RMLUI_UNUSED_PARAMETER(family), Style::FontStyle RMLUI_UNUSED_PARAMETER(style),
-	Style::FontWeight RMLUI_UNUSED_PARAMETER(weight), int RMLUI_UNUSED_PARAMETER(size))
+FontFaceHandle FontEngineInterface::GetFontFaceHandle(const String& /*family*/, Style::FontStyle /*style*/,
+	Style::FontWeight /*weight*/, int /*size*/)
 {
-	RMLUI_UNUSED(family);
-	RMLUI_UNUSED(style);
-	RMLUI_UNUSED(weight);
-	RMLUI_UNUSED(size);
 	return 0;
 }
 	
-FontEffectsHandle FontEngineInterface::PrepareFontEffects(FontFaceHandle, const FontEffectList& font_effects)
+FontEffectsHandle FontEngineInterface::PrepareFontEffects(FontFaceHandle /*handle*/, const FontEffectList& /*font_effects*/)
 {
 	return 0;
 }
 
-int FontEngineInterface::GetSize(FontFaceHandle)
+int FontEngineInterface::GetSize(FontFaceHandle /*handle*/)
 {
 	return 0;
 }
 
-int FontEngineInterface::GetXHeight(FontFaceHandle)
+int FontEngineInterface::GetXHeight(FontFaceHandle /*handle*/)
 {
 	return 0;
 }
 
-int FontEngineInterface::GetLineHeight(FontFaceHandle)
+int FontEngineInterface::GetLineHeight(FontFaceHandle /*handle*/)
 {
 	return 0;
 }
 
-int FontEngineInterface::GetBaseline(FontFaceHandle)
+int FontEngineInterface::GetBaseline(FontFaceHandle /*handle*/)
 {
 	return 0;
 }
 
-float FontEngineInterface::GetUnderline(FontFaceHandle, float &)
+float FontEngineInterface::GetUnderline(FontFaceHandle /*handle*/, float& /*thickness*/)
 {
 	return 0;
 }
 
-int FontEngineInterface::GetStringWidth(FontFaceHandle, const String& RMLUI_UNUSED_PARAMETER(string), Character RMLUI_UNUSED_PARAMETER(prior_character))
+int FontEngineInterface::GetStringWidth(FontFaceHandle /*handle*/, const String& /*string*/, Character /*prior_character*/)
 {
-	RMLUI_UNUSED(string);
-	RMLUI_UNUSED(prior_character);
 	return 0;
 }
 
-int FontEngineInterface::GenerateString(FontFaceHandle, FontEffectsHandle, const String& RMLUI_UNUSED_PARAMETER(string),
-	const Vector2f& RMLUI_UNUSED_PARAMETER(position), const Colourb& RMLUI_UNUSED_PARAMETER(colour), GeometryList& RMLUI_UNUSED_PARAMETER(geometry))
+int FontEngineInterface::GenerateString(FontFaceHandle /*face_handle*/, FontEffectsHandle /*font_effects_handle*/, const String& /*string*/,
+	const Vector2f& /*position*/, const Colourb& /*colour*/, GeometryList& /*geometry*/)
 {
-	RMLUI_UNUSED(string);
-	RMLUI_UNUSED(position);
-	RMLUI_UNUSED(colour);
-	RMLUI_UNUSED(geometry);
 	return 0;
 }
 
-int FontEngineInterface::GetVersion(FontFaceHandle handle)
+int FontEngineInterface::GetVersion(FontFaceHandle /*handle*/)
 {
 	return 0;
 }

+ 1 - 0
Source/Core/IdNameMap.h

@@ -65,6 +65,7 @@ public:
 	{
 		std::ptrdiff_t cnt = std::count_if(name_map.begin(), name_map.end(), [](const String& name) { return !name.empty(); });
 		RMLUI_ASSERT(cnt == (std::ptrdiff_t)number_of_defined_ids && reverse_map.size() == (size_t)number_of_defined_ids);
+		(void)number_of_defined_ids;
 		(void)cnt;
 	}
 

+ 3 - 2
Source/Core/LayoutEngine.cpp

@@ -259,9 +259,10 @@ float LayoutEngine::ClampHeight(float height, const ComputedValues& computed, fl
 	return Math::Clamp(height, min_height, max_height);
 }
 
-void* LayoutEngine::AllocateLayoutChunk(size_t RMLUI_UNUSED_ASSERT_PARAMETER(size))
+void* LayoutEngine::AllocateLayoutChunk(size_t size)
 {
 	RMLUI_ASSERT(size <= LayoutChunk::size);
+	(void)size;
 	
 	return layout_chunk_pool.AllocateAndConstruct();
 }
@@ -357,7 +358,7 @@ bool LayoutEngine::FormatElementBlock(Element* element)
 				break;
 			}
 		}
-
+		//-fallthrough
 		// We caused our parent to add a vertical scrollbar; bail out!
 		case LayoutBlockBox::LAYOUT_PARENT:
 		{

+ 2 - 2
Source/Core/Lua/Context.cpp

@@ -38,7 +38,7 @@ namespace Rml {
 namespace Core {
 namespace Lua {
 typedef Rml::Core::ElementDocument Document;
-template<> void ExtraInit<Context>(lua_State* L, int metatable_index) { return; }
+template<> void ExtraInit<Context>(lua_State* /*L*/, int /*metatable_index*/) { return; }
 
 //methods
 int ContextAddEventListener(lua_State* L, Context* obj)
@@ -104,7 +104,7 @@ int ContextRender(lua_State* L, Context* obj)
     return 1;
 }
 
-int ContextUnloadAllDocuments(lua_State* L, Context* obj)
+int ContextUnloadAllDocuments(lua_State* /*L*/, Context* obj)
 {
     obj->UnloadAllDocuments();
     return 0;

+ 4 - 4
Source/Core/Lua/Document.cpp

@@ -78,13 +78,13 @@ template<> void ExtraInit<Document>(lua_State* L, int metatable_index)
 }
 
 //methods
-int DocumentPullToFront(lua_State* L, Document* obj)
+int DocumentPullToFront(lua_State* /*L*/, Document* obj)
 {
     obj->PullToFront();
     return 0;
 }
 
-int DocumentPushToBack(lua_State* L, Document* obj)
+int DocumentPushToBack(lua_State* /*L*/, Document* obj)
 {
     obj->PushToBack();
     return 0;
@@ -109,13 +109,13 @@ int DocumentShow(lua_State* L, Document* obj)
     return 0;
 }
 
-int DocumentHide(lua_State* L, Document* obj)
+int DocumentHide(lua_State* /*L*/, Document* obj)
 {
     obj->Hide();
     return 0;
 }
 
-int DocumentClose(lua_State* L, Document* obj)
+int DocumentClose(lua_State* /*L*/, Document* obj)
 {
     obj->Close();
     return 0;

+ 4 - 4
Source/Core/Lua/Element.cpp

@@ -108,13 +108,13 @@ int ElementAppendChild(lua_State* L, Element* obj)
     return 0;
 }
 
-int ElementBlur(lua_State* L, Element* obj)
+int ElementBlur(lua_State* /*L*/, Element* obj)
 {
     obj->Blur();
     return 0;
 }
 
-int ElementClick(lua_State* L, Element* obj)
+int ElementClick(lua_State* /*L*/, Element* obj)
 {
     obj->Click();
     return 0;
@@ -153,7 +153,7 @@ int ElementDispatchEvent(lua_State* L, Element* obj)
     return 0;
 }
 
-int ElementFocus(lua_State* L, Element* obj)
+int ElementFocus(lua_State* /*L*/, Element* obj)
 {
     obj->Focus();
     return 0;
@@ -634,7 +634,7 @@ LUACORETYPEDEFINE(Element)
 
 
 
-template<> void ExtraInit<ElementPtr>(lua_State* L, int metatable_index)
+template<> void ExtraInit<ElementPtr>(lua_State* /*L*/, int /*metatable_index*/)
 {
 	return;
 }

+ 2 - 2
Source/Core/Lua/Event.cpp

@@ -38,10 +38,10 @@
 namespace Rml {
 namespace Core {
 namespace Lua {
-template<> void ExtraInit<Event>(lua_State* L, int metatable_index) { return; }
+template<> void ExtraInit<Event>(lua_State* /*L*/, int /*metatable_index*/) { return; }
 
 //method
-int EventStopPropagation(lua_State* L, Event* obj)
+int EventStopPropagation(lua_State* /*L*/, Event* obj)
 {
     obj->StopPropagation();
     return 0;

+ 1 - 1
Source/Core/Lua/LuaDocumentElementInstancer.cpp

@@ -38,7 +38,7 @@ namespace Lua {
 /// @param[in] parent The element the new element is destined to be parented to.
 /// @param[in] tag The tag of the element to instance.
 /// @param[in] attributes Dictionary of attributes.
-ElementPtr LuaDocumentElementInstancer::InstanceElement(Element* parent, const String& tag, const XMLAttributes& attributes)
+ElementPtr LuaDocumentElementInstancer::InstanceElement(Element* /*parent*/, const String& tag, const XMLAttributes& /*attributes*/)
 {
 	return ElementPtr(new LuaDocument(tag));
 }

+ 1 - 1
Source/Core/Lua/LuaEventListener.cpp

@@ -116,7 +116,7 @@ LuaEventListener::~LuaEventListener()
 	lua_pop(L, 1); // pop table
 }
 
-void LuaEventListener::OnDetach(Element* element)
+void LuaEventListener::OnDetach(Element* /*element*/)
 {
 	// We consider this listener owned by its element, so we must delete ourselves when
 	// we detach (probably because element was removed).

+ 4 - 4
Source/Core/Lua/RmlUi.cpp

@@ -54,9 +54,9 @@ void LuaRmlUiPushrmluiGlobal(lua_State* L)
     lua_setglobal(L,"rmlui");
 }
 
-template<> void ExtraInit<LuaRmlUi>(lua_State* L, int metatable_index) { return; }
+template<> void ExtraInit<LuaRmlUi>(lua_State* /*L*/, int /*metatable_index*/) { return; }
 
-int LuaRmlUiCreateContext(lua_State* L, LuaRmlUi* obj)
+int LuaRmlUiCreateContext(lua_State* L, LuaRmlUi* /*obj*/)
 {
     const char* name = luaL_checkstring(L,1);
     Vector2i* dimensions = LuaType<Vector2i>::check(L,2);
@@ -72,14 +72,14 @@ int LuaRmlUiCreateContext(lua_State* L, LuaRmlUi* obj)
     return 1;
 }
 
-int LuaRmlUiLoadFontFace(lua_State* L, LuaRmlUi* obj)
+int LuaRmlUiLoadFontFace(lua_State* L, LuaRmlUi* /*obj*/)
 {
     const char* file = luaL_checkstring(L,1);
     lua_pushboolean(L,LoadFontFace(file));
     return 1;
 }
 
-int LuaRmlUiRegisterTag(lua_State* L, LuaRmlUi* obj)
+int LuaRmlUiRegisterTag(lua_State* L, LuaRmlUi* /*obj*/)
 {
     const char* tag = luaL_checkstring(L,1);
     LuaElementInstancer* lei = (LuaElementInstancer*)LuaType<ElementInstancer>::check(L,2);

+ 1 - 1
Source/Core/PropertyParserAnimation.cpp

@@ -353,7 +353,7 @@ static bool ParseTransition(Property & property, const StringList& transition_va
 }
 
 
-bool PropertyParserAnimation::ParseValue(Property & property, const String & value, const ParameterMap & parameters) const
+bool PropertyParserAnimation::ParseValue(Property & property, const String & value, const ParameterMap & /*parameters*/) const
 {
 	StringList list_of_values;
 	{

+ 2 - 2
Source/Core/PropertyParserColour.cpp

@@ -81,7 +81,7 @@ bool PropertyParserColour::ParseValue(Property& property, const String& value, c
 		{
 			// Single hex digit per channel, RGB and alpha.
 			case 5:		hex_values[3][0] = hex_values[3][1] = value[4];
-
+						//-fallthrough
 			// Single hex digit per channel, RGB only.
 			case 4:		hex_values[0][0] = hex_values[0][1] = value[1];
 						hex_values[1][0] = hex_values[1][1] = value[2];
@@ -91,7 +91,7 @@ bool PropertyParserColour::ParseValue(Property& property, const String& value, c
 			// Two hex digits per channel, RGB and alpha.
 			case 9:		hex_values[3][0] = value[7];
 						hex_values[3][1] = value[8];
-
+						//-fallthrough
 			// Two hex digits per channel, RGB only.
 			case 7:		memcpy(hex_values, &value.c_str()[1], sizeof(char) * 6);
 						break;

+ 36 - 33
Source/Core/PropertyParserTransform.cpp

@@ -46,7 +46,7 @@ PropertyParserTransform::~PropertyParserTransform()
 }
 
 // Called to parse a RCSS transform declaration.
-bool PropertyParserTransform::ParseValue(Property& property, const String& value, const ParameterMap& parameters) const
+bool PropertyParserTransform::ParseValue(Property& property, const String& value, const ParameterMap& /*parameters*/) const
 {
 	if(value == "none")
 	{
@@ -55,7 +55,7 @@ bool PropertyParserTransform::ParseValue(Property& property, const String& value
 		return true;
 	}
 
-	UniquePtr<Transform> transform(new Transform);
+	TransformPtr transform = std::make_shared<Transform>();
 
 	char const* next = value.c_str();
 
@@ -72,97 +72,98 @@ bool PropertyParserTransform::ParseValue(Property& property, const String& value
 	const PropertyParser* number3[] = { &number, &number, &number };
 	const PropertyParser* number6[] = { &number, &number, &number, &number, &number, &number };
 	const PropertyParser* number16[] = { &number, &number, &number, &number, &number, &number, &number, &number, &number, &number, &number, &number, &number, &number, &number, &number };
-	while (strlen(next))
+
+	while (*next)
 	{
 		using namespace Transforms;
 		int bytes_read = 0;
 
-		if ((bytes_read = Scan(next, "perspective", length1, args, 1)))
+		if (Scan(bytes_read, next, "perspective", length1, args, 1))
 		{
 			transform->AddPrimitive({ Perspective(args) });
 		}
-		else if ((bytes_read = Scan(next, "matrix", number6, args, 6)))
+		else if (Scan(bytes_read, next, "matrix", number6, args, 6))
 		{
 			transform->AddPrimitive({ Matrix2D(args) });
 		}
-		else if ((bytes_read = Scan(next, "matrix3d", number16, args, 16)))
+		else if (Scan(bytes_read, next, "matrix3d", number16, args, 16))
 		{
 			transform->AddPrimitive({ Matrix3D(args) });
 		}
-		else if ((bytes_read = Scan(next, "translateX", length1, args, 1)))
+		else if (Scan(bytes_read, next, "translateX", length1, args, 1))
 		{
 			transform->AddPrimitive({ TranslateX(args) });
 		}
-		else if ((bytes_read = Scan(next, "translateY", length1, args, 1)))
+		else if (Scan(bytes_read, next, "translateY", length1, args, 1))
 		{
 			transform->AddPrimitive({ TranslateY(args) });
 		}
-		else if ((bytes_read = Scan(next, "translateZ", length1, args, 1)))
+		else if (Scan(bytes_read, next, "translateZ", length1, args, 1))
 		{
 			transform->AddPrimitive({ TranslateZ(args) });
 		}
-		else if ((bytes_read = Scan(next, "translate", length2, args, 2)))
+		else if (Scan(bytes_read, next, "translate", length2, args, 2))
 		{
 			transform->AddPrimitive({ Translate2D(args) });
 		}
-		else if ((bytes_read = Scan(next, "translate3d", length3, args, 3)))
+		else if (Scan(bytes_read, next, "translate3d", length3, args, 3))
 		{
 			transform->AddPrimitive({ Translate3D(args) });
 		}
-		else if ((bytes_read = Scan(next, "scaleX", number1, args, 1)))
+		else if (Scan(bytes_read, next, "scaleX", number1, args, 1))
 		{
 			transform->AddPrimitive({ ScaleX(args) });
 		}
-		else if ((bytes_read = Scan(next, "scaleY", number1, args, 1)))
+		else if (Scan(bytes_read, next, "scaleY", number1, args, 1))
 		{
 			transform->AddPrimitive({ ScaleY(args) });
 		}
-		else if ((bytes_read = Scan(next, "scaleZ", number1, args, 1)))
+		else if (Scan(bytes_read, next, "scaleZ", number1, args, 1))
 		{
 			transform->AddPrimitive({ ScaleZ(args) });
 		}
-		else if ((bytes_read = Scan(next, "scale", number2, args, 2)))
+		else if (Scan(bytes_read, next, "scale", number2, args, 2))
 		{
 			transform->AddPrimitive({ Scale2D(args) });
 		}
-		else if ((bytes_read = Scan(next, "scale", number1, args, 1)))
+		else if (Scan(bytes_read, next, "scale", number1, args, 1))
 		{
 			args[1] = args[0];
 			transform->AddPrimitive({ Scale2D(args) });
 		}
-		else if ((bytes_read = Scan(next, "scale3d", number3, args, 3)))
+		else if (Scan(bytes_read, next, "scale3d", number3, args, 3))
 		{
 			transform->AddPrimitive({ Scale3D(args) });
 		}
-		else if ((bytes_read = Scan(next, "rotateX", angle1, args, 1)))
+		else if (Scan(bytes_read, next, "rotateX", angle1, args, 1))
 		{
 			transform->AddPrimitive({ RotateX(args) });
 		}
-		else if ((bytes_read = Scan(next, "rotateY", angle1, args, 1)))
+		else if (Scan(bytes_read, next, "rotateY", angle1, args, 1))
 		{
 			transform->AddPrimitive({ RotateY(args) });
 		}
-		else if ((bytes_read = Scan(next, "rotateZ", angle1, args, 1)))
+		else if (Scan(bytes_read, next, "rotateZ", angle1, args, 1))
 		{
 			transform->AddPrimitive({ RotateZ(args) });
 		}
-		else if ((bytes_read = Scan(next, "rotate", angle1, args, 1)))
+		else if (Scan(bytes_read, next, "rotate", angle1, args, 1))
 		{
 			transform->AddPrimitive({ Rotate2D(args) });
 		}
-		else if ((bytes_read = Scan(next, "rotate3d", number3angle1, args, 4)))
+		else if (Scan(bytes_read, next, "rotate3d", number3angle1, args, 4))
 		{
 			transform->AddPrimitive({ Rotate3D(args) });
 		}
-		else if ((bytes_read = Scan(next, "skewX", angle1, args, 1)))
+		else if (Scan(bytes_read, next, "skewX", angle1, args, 1))
 		{
 			transform->AddPrimitive({ SkewX(args) });
 		}
-		else if ((bytes_read = Scan(next, "skewY", angle1, args, 1)))
+		else if (Scan(bytes_read, next, "skewY", angle1, args, 1))
 		{
 			transform->AddPrimitive({ SkewY(args) });
 		}
-		else if ((bytes_read = Scan(next, "skew", angle2, args, 2)))
+		else if (Scan(bytes_read, next, "skew", angle2, args, 2))
 		{
 			transform->AddPrimitive({ Skew2D(args) });
 		}
@@ -177,15 +178,16 @@ bool PropertyParserTransform::ParseValue(Property& property, const String& value
 		}
 	}
 	
-	property.value = Variant(TransformPtr(std::move(transform)));
+	property.value = Variant(std::move(transform));
 	property.unit = Property::TRANSFORM;
 
 	return true;
 }
 
 // Scan a string for a parameterized keyword with a certain number of numeric arguments.
-int PropertyParserTransform::Scan(const char* str, const char* keyword, const PropertyParser** parsers, Transforms::NumericValue* args, int nargs) const
+bool PropertyParserTransform::Scan(int& out_bytes_read, const char* str, const char* keyword, const PropertyParser** parsers, Transforms::NumericValue* args, int nargs) const
 {
+	out_bytes_read = 0;
 	int total_bytes_read = 0, bytes_read = 0;
 
 	/* use the quicker stack-based argument buffer, if possible */
@@ -217,7 +219,7 @@ int PropertyParserTransform::Scan(const char* str, const char* keyword, const Pr
 	}
 	else
 	{
-		return 0;
+		return false;
 	}
 
 	/* skip any white space */
@@ -235,7 +237,7 @@ int PropertyParserTransform::Scan(const char* str, const char* keyword, const Pr
 	}
 	else
 	{
-		return 0;
+		return false;
 	}
 
 	/* parse the arguments */
@@ -254,7 +256,7 @@ int PropertyParserTransform::Scan(const char* str, const char* keyword, const Pr
 		}
 		else
 		{
-			return 0;
+			return false;
 		}
 
 		/* find the comma */
@@ -268,7 +270,7 @@ int PropertyParserTransform::Scan(const char* str, const char* keyword, const Pr
 			}
 			else
 			{
-				return 0;
+				return false;
 			}
 		}
 	}
@@ -282,10 +284,11 @@ int PropertyParserTransform::Scan(const char* str, const char* keyword, const Pr
 	}
 	else
 	{
-		return 0;
+		return false;
 	}
 
-	return total_bytes_read;
+	out_bytes_read = total_bytes_read;
+	return total_bytes_read > 0;
 }
 
 }

+ 3 - 2
Source/Core/PropertyParserTransform.h

@@ -58,13 +58,14 @@ public:
 
 private:
 	/// Scan a string for a parameterized keyword with a certain number of numeric arguments.
+	/// @param[out] out_bytes_read The number of bytes read if the keyword occurs at the beginning of str, 0 otherwise.
 	/// @param[in] str The string to search for the parameterized keyword
 	/// @param[in] keyword The name of the keyword to search for
 	/// @param[in] parsers The numeric argument parsers
 	/// @param[out] args The numeric arguments encountered
 	/// @param[in] nargs The number of numeric arguments expected
-	/// @returns The number of bytes read, if the function call occurs at the beginning of str, 0 otherwise.
-	int Scan(const char* str, const char* keyword, const PropertyParser** parsers, Transforms::NumericValue* args, int nargs) const;
+	/// @return True if parsed successfully, false otherwise.
+	bool Scan(int& out_bytes_read, const char* str, const char* keyword, const PropertyParser** parsers, Transforms::NumericValue* args, int nargs) const;
 
 	PropertyParserNumber number, length, angle;
 };

+ 7 - 25
Source/Core/RenderInterface.cpp

@@ -43,58 +43,40 @@ RenderInterface::~RenderInterface()
 }
 
 // Called by RmlUi when it wants to compile geometry it believes will be static for the forseeable future.
-CompiledGeometryHandle RenderInterface::CompileGeometry(Vertex* RMLUI_UNUSED_PARAMETER(vertices), int RMLUI_UNUSED_PARAMETER(num_vertices), int* RMLUI_UNUSED_PARAMETER(indices), int RMLUI_UNUSED_PARAMETER(num_indices), TextureHandle RMLUI_UNUSED_PARAMETER(texture))
+CompiledGeometryHandle RenderInterface::CompileGeometry(Vertex* /*vertices*/, int /*num_vertices*/, int* /*indices*/, int /*num_indices*/, TextureHandle /*texture*/)
 {
-	RMLUI_UNUSED(vertices);
-	RMLUI_UNUSED(num_vertices);
-	RMLUI_UNUSED(indices);
-	RMLUI_UNUSED(num_indices);
-	RMLUI_UNUSED(texture);
-
 	return 0;
 }
 
 // Called by RmlUi when it wants to render application-compiled geometry.
-void RenderInterface::RenderCompiledGeometry(CompiledGeometryHandle RMLUI_UNUSED_PARAMETER(geometry), const Vector2f& RMLUI_UNUSED_PARAMETER(translation))
+void RenderInterface::RenderCompiledGeometry(CompiledGeometryHandle /*geometry*/, const Vector2f& /*translation*/)
 {
-	RMLUI_UNUSED(geometry);
-	RMLUI_UNUSED(translation);
 }
 
 // Called by RmlUi when it wants to release application-compiled geometry.
-void RenderInterface::ReleaseCompiledGeometry(CompiledGeometryHandle RMLUI_UNUSED_PARAMETER(geometry))
+void RenderInterface::ReleaseCompiledGeometry(CompiledGeometryHandle /*geometry*/)
 {
-	RMLUI_UNUSED(geometry);
 }
 
 // Called by RmlUi when a texture is required by the library.
-bool RenderInterface::LoadTexture(TextureHandle& RMLUI_UNUSED_PARAMETER(texture_handle), Vector2i& RMLUI_UNUSED_PARAMETER(texture_dimensions), const String& RMLUI_UNUSED_PARAMETER(source))
+bool RenderInterface::LoadTexture(TextureHandle& /*texture_handle*/, Vector2i& /*texture_dimensions*/, const String& /*source*/)
 {
-	RMLUI_UNUSED(texture_handle);
-	RMLUI_UNUSED(texture_dimensions);
-	RMLUI_UNUSED(source);
-
 	return false;
 }
 
 // Called by RmlUi when a texture is required to be built from an internally-generated sequence of pixels.
-bool RenderInterface::GenerateTexture(TextureHandle& RMLUI_UNUSED_PARAMETER(texture_handle), const byte* RMLUI_UNUSED_PARAMETER(source), const Vector2i& RMLUI_UNUSED_PARAMETER(source_dimensions))
+bool RenderInterface::GenerateTexture(TextureHandle& /*texture_handle*/, const byte* /*source*/, const Vector2i& /*source_dimensions*/)
 {
-	RMLUI_UNUSED(texture_handle);
-	RMLUI_UNUSED(source);
-	RMLUI_UNUSED(source_dimensions);
-	
 	return false;
 }
 
 // Called by RmlUi when a loaded texture is no longer required.
-void RenderInterface::ReleaseTexture(TextureHandle RMLUI_UNUSED_PARAMETER(texture))
+void RenderInterface::ReleaseTexture(TextureHandle /*texture*/)
 {
-	RMLUI_UNUSED(texture);
 }
 
 // Called by RmlUi when it wants to change the current transform matrix to a new matrix.
-void RenderInterface::SetTransform(const Matrix4f* transform)
+void RenderInterface::SetTransform(const Matrix4f* /*transform*/)
 {
 }
 

+ 2 - 2
Source/Core/Spritesheet.cpp

@@ -54,8 +54,8 @@ bool SpritesheetList::AddSpriteSheet(const String& name, const String& image_sou
 	{
 		const String& sprite_name = sprite_definition.first;
 		const Rectangle& sprite_rectangle = sprite_definition.second;
-		auto result = sprite_map.emplace(sprite_name, Sprite{ sprite_rectangle, sprite_sheet.get() });
-		if (result.second)
+		auto sprite_result = sprite_map.emplace(sprite_name, Sprite{ sprite_rectangle, sprite_sheet.get() });
+		if (sprite_result.second)
 		{
 			sprite_names.push_back(sprite_name);
 		}

+ 3 - 3
Source/Core/StyleSheetParser.cpp

@@ -243,7 +243,7 @@ bool StyleSheetParser::ParseKeyframeBlock(KeyframesMap& keyframes_map, const Str
 		auto it = std::find_if(keyframes.blocks.begin(), keyframes.blocks.end(), [selector](const KeyframeBlock& keyframe_block) { return Math::AbsoluteValue(keyframe_block.normalized_time - selector) < 0.0001f; });
 		if (it == keyframes.blocks.end())
 		{
-			keyframes.blocks.push_back(KeyframeBlock{ selector });
+			keyframes.blocks.emplace_back(selector);
 			it = (keyframes.blocks.end() - 1);
 		}
 		else
@@ -370,7 +370,7 @@ int StyleSheetParser::Parse(StyleSheetNode* node, Stream* _stream, const StyleSh
 					{
 						auto source = std::make_shared<PropertySource>(stream_file_name, rule_line_number, rule_name_list[i]);
 						properties.SetSourceOfAllProperties(source);
-						ImportProperties(node, rule_name_list[i], properties, rule_count, rule_line_number);
+						ImportProperties(node, rule_name_list[i], properties, rule_count);
 					}
 
 					rule_count++;
@@ -607,7 +607,7 @@ bool StyleSheetParser::ReadProperties(AbstractPropertyParser& property_parser, b
 }
 
 // Updates the StyleNode tree, creating new nodes as necessary, setting the definition index
-bool StyleSheetParser::ImportProperties(StyleSheetNode* node, String rule_name, const PropertyDictionary& properties, int rule_specificity, int rule_line_number)
+bool StyleSheetParser::ImportProperties(StyleSheetNode* node, String rule_name, const PropertyDictionary& properties, int rule_specificity)
 {
 	StyleSheetNode* leaf_node = node;
 

+ 1 - 1
Source/Core/StyleSheetParser.h

@@ -89,7 +89,7 @@ private:
 	// @param names The names of the nodes
 	// @param properties The dictionary of properties
 	// @param rule_specificity The specifity of the rule
-	bool ImportProperties(StyleSheetNode* node, String rule_name, const PropertyDictionary& properties, int rule_specificity, int rule_line_number);
+	bool ImportProperties(StyleSheetNode* node, String rule_name, const PropertyDictionary& properties, int rule_specificity);
 
 	// Attempts to parse a @keyframes block
 	bool ParseKeyframeBlock(KeyframesMap & keyframes_map, const String & identifier, const String & rules, const PropertyDictionary & properties);

+ 2 - 4
Source/Core/SystemInterface.cpp

@@ -67,16 +67,14 @@ bool SystemInterface::LogMessage(Log::Type logtype, const String& message)
 	return true;
 }
 #else
-bool SystemInterface::LogMessage(Log::Type RMLUI_UNUSED_PARAMETER(logtype), const String& message)
+bool SystemInterface::LogMessage(Log::Type /*logtype*/, const String& message)
 {
-	RMLUI_UNUSED(logtype);
-
 	fprintf(stderr,"%s\n", message.c_str());
 	return true;
 }
 #endif	
 
-void SystemInterface::SetMouseCursor(const String& cursor_name)
+void SystemInterface::SetMouseCursor(const String& /*cursor_name*/)
 {
 }
 

+ 8 - 8
Source/Core/TransformPrimitive.cpp

@@ -475,12 +475,12 @@ struct PrepareVisitor
 		return true;
 	}
 	template <size_t N>
-	bool operator()(ResolvedPrimitive<N>& p)
+	bool operator()(ResolvedPrimitive<N>& /*p*/)
 	{
 		// No conversion needed for resolved transforms (with some exceptions below)
 		return true;
 	}
-	bool operator()(DecomposedMatrix4& p)
+	bool operator()(DecomposedMatrix4& /*p*/)
 	{
 		return true;
 	}
@@ -495,17 +495,17 @@ struct PrepareVisitor
 		p.values[2] = vec.z;
 		return true;
 	}
-	bool operator()(Matrix3D& p)
+	bool operator()(Matrix3D& /*p*/)
 	{
 		// Matrices must be decomposed for interpolation
 		return false;
 	}
-	bool operator()(Matrix2D& p)
+	bool operator()(Matrix2D& /*p*/)
 	{
 		// Matrix2D can also be optimized for interpolation, but for now we decompose it to a full DecomposedMatrix4
 		return false;
 	}
-	bool operator()(Perspective& p)
+	bool operator()(Perspective& /*p*/)
 	{
 		// Perspective must be decomposed
 		return false;
@@ -703,9 +703,9 @@ struct InterpolateVisitor
 		p0.values[3] = p0.values[3] * (1.0f - alpha) + p1.values[3] * alpha;
 		return true;
 	}
-	bool Interpolate(Matrix2D& p0, const Matrix2D& p1) { return false; /* Error if we get here, see PrepareForInterpolation() */ }
-	bool Interpolate(Matrix3D& p0, const Matrix3D& p1) { return false; /* Error if we get here, see PrepareForInterpolation() */ }
-	bool Interpolate(Perspective& p0, const Perspective& p1) { return false; /* Error if we get here, see PrepareForInterpolation() */ }
+	bool Interpolate(Matrix2D& /*p0*/, const Matrix2D& /*p1*/) { return false; /* Error if we get here, see PrepareForInterpolation() */ }
+	bool Interpolate(Matrix3D& /*p0*/, const Matrix3D& /*p1*/) { return false; /* Error if we get here, see PrepareForInterpolation() */ }
+	bool Interpolate(Perspective& /*p0*/, const Perspective& /*p1*/) { return false; /* Error if we get here, see PrepareForInterpolation() */ }
 
 	bool Interpolate(DecomposedMatrix4& p0, const DecomposedMatrix4& p1)
 	{

+ 7 - 3
changelog.md

@@ -10,7 +10,7 @@
 
 - Prevent scrolling in the parent window when scrolling inside the selection box.
 - Close the selection box when scrolling in the parent document.
-- The selection box will now limit it's height to the available space within the context's window dimensions, and position itself either below or above the `select` element as appropriate. [#91](https://github.com/mikke89/RmlUi/issues/91)
+- The selection box will now limit its height to the available space within the context's window dimensions, and position itself either below or above the `select` element as appropriate. [#91](https://github.com/mikke89/RmlUi/issues/91)
 
 ### Cleaning up header files
 
@@ -27,7 +27,7 @@ The library now makes use of CMake's precompiled header support (requires CMake
 - The `style` attribute no longer requires a semi-colon `;` after the final property.
 - The sample projects now universally use the `F8` key to toggle the RmlUi debugger on all platforms.
 - Add an upper limit to the number of possible custom properties and events. This change will reduce the number of dynamic allocations in some cases.
-- Build improvements and several warnings fixed. Compiles cleanly with `-Wall`.
+- Build improvements and several warnings fixed. Compiles cleanly with `-Wall -Wextra` and on MSVC with `/W4`.
 - The sample projects now find their assets when building and running the sample with Visual Studio's native CMake support and default settings. This also applies when targeting Windows Subsystem for Linux (WSL).
 - The mouse cursor API is now implemented on the X11 shell.
 - RmlUi is now C++20 compatible (C++14 is still the minimum requirement).
@@ -38,7 +38,11 @@ The library now makes use of CMake's precompiled header support (requires CMake
 - Re-implement `Rml::Core::ReleaseCompiledGeometries()` [#84](https://github.com/mikke89/RmlUi/issues/84).
 - Property `white-space: nowrap` no longer disables horizontal scrollbars on overflow [#94](https://github.com/mikke89/RmlUi/issues/94).
 - Changes to font effects are now properly applied whenever the `font-effect` property is changed [#98](https://github.com/mikke89/RmlUi/issues/98).
-- Fix structural pseudo-selectors only being applied if written with parenthesis [#30](https://github.com/mikke89/RmlUi/issues/30).
+- Fix structural pseudo-selectors only being applied if written with parenthesis [#30](https://github.com/mikke89/RmlUi/issues/30#issuecomment-597648310).
+
+### Breaking changes
+
+- The `height` property of `selectbox` will no longer take any effect. Note that `max-height` can still be used.
 
 
 ## RmlUi 3.2