From 9a0cc4b7dc8dae79fc912a04a9d4679d42815a4a Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Wed, 8 Dec 2021 17:00:44 +0000 Subject: [PATCH] Use alias declarations instead of 'typedef' --- cmake/CompilerWarnings.cmake | 2 +- examples/joystick/Joystick.cpp | 2 +- examples/vulkan/Vulkan.cpp | 4 +- include/SFML/Audio/Music.hpp | 2 +- include/SFML/Audio/SoundBuffer.hpp | 2 +- include/SFML/Audio/SoundFileFactory.hpp | 4 +- include/SFML/Config.hpp | 20 +++++----- include/SFML/Graphics/Font.hpp | 4 +- include/SFML/Graphics/Glsl.hpp | 34 ++++++++-------- include/SFML/Graphics/Rect.hpp | 8 ++-- include/SFML/Graphics/Shader.hpp | 4 +- include/SFML/Network/Http.hpp | 4 +- include/SFML/Network/Packet.hpp | 2 +- include/SFML/Network/SocketHandle.hpp | 4 +- include/SFML/System/String.hpp | 4 +- include/SFML/System/Utf.hpp | 14 +++---- include/SFML/System/Vector2.hpp | 8 ++-- include/SFML/System/Vector3.hpp | 6 +-- include/SFML/Window/Context.hpp | 2 +- include/SFML/Window/GlResource.hpp | 2 +- include/SFML/Window/Vulkan.hpp | 10 ++--- include/SFML/Window/WindowBase.hpp | 2 +- include/SFML/Window/WindowHandle.hpp | 16 ++++---- src/SFML/Graphics/RenderTarget.cpp | 2 +- src/SFML/Main/SFMLActivity.cpp | 2 +- src/SFML/Network/Unix/SocketImpl.hpp | 4 +- src/SFML/Network/Win32/SocketImpl.hpp | 4 +- src/SFML/Window/GlContext.cpp | 40 +++++++++---------- .../Window/OSX/AutoreleasePoolWrapper.hpp | 4 +- src/SFML/Window/OSX/CursorImpl.hpp | 4 +- src/SFML/Window/OSX/HIDInputManager.hpp | 2 +- src/SFML/Window/OSX/JoystickImpl.hpp | 6 +-- src/SFML/Window/OSX/SFContext.hpp | 12 +++--- src/SFML/Window/OSX/WindowImplCocoa.hpp | 10 ++--- src/SFML/Window/Unix/Display.cpp | 2 +- src/SFML/Window/Unix/JoystickImpl.cpp | 2 +- src/SFML/Window/Unix/WindowImplX11.cpp | 4 +- src/SFML/Window/Vulkan.cpp | 4 +- src/SFML/Window/Win32/JoystickImpl.cpp | 6 +-- src/SFML/Window/Win32/WindowImplWin32.cpp | 4 +- src/SFML/Window/WindowImpl.cpp | 14 +++---- 41 files changed, 143 insertions(+), 143 deletions(-) diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake index e84b08a2..2cd1d240 100644 --- a/cmake/CompilerWarnings.cmake +++ b/cmake/CompilerWarnings.cmake @@ -84,7 +84,7 @@ function(set_file_warnings) ${CLANG_AND_GCC_WARNINGS} ${NON_ANDROID_GCC_WARNINGS} -Wlogical-op # warn about logical operations being used where bitwise were probably wanted - # -Wuseless-cast # warn if you perform a cast to the same type (disabled because it is not portable as some typedefs might vary between platforms) + # -Wuseless-cast # warn if you perform a cast to the same type (disabled because it is not portable as some type aliases might vary between platforms) ) # Don't enable -Wduplicated-branches for GCC < 8.1 since it will lead to false positives diff --git a/examples/joystick/Joystick.cpp b/examples/joystick/Joystick.cpp index 62f512fc..143ff8d8 100644 --- a/examples/joystick/Joystick.cpp +++ b/examples/joystick/Joystick.cpp @@ -18,7 +18,7 @@ namespace sf::Text value; }; - typedef std::unordered_map Texts; + using Texts = std::unordered_map; Texts texts; std::ostringstream sstr; float threshold = 0.1f; diff --git a/examples/vulkan/Vulkan.cpp b/examples/vulkan/Vulkan.cpp index befd71c8..80a4a7ae 100644 --- a/examples/vulkan/Vulkan.cpp +++ b/examples/vulkan/Vulkan.cpp @@ -20,8 +20,8 @@ //////////////////////////////////////////////////////////// namespace { - typedef float Vec3[3]; - typedef float Matrix[4][4]; + using Vec3 = float[3]; + using Matrix = float[4][4]; // Multiply 2 matrices void matrixMultiply(Matrix& result, const Matrix& left, const Matrix& right) diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp index e68277ab..141db6a1 100644 --- a/include/SFML/Audio/Music.hpp +++ b/include/SFML/Audio/Music.hpp @@ -84,7 +84,7 @@ public: }; // Define the relevant Span types - typedef Span