Added readability-qualified-auto, -redundant-access-specifiers

Fixed clang-format escapes

Fixed OSX clang-tidy issues

Collapsed extraneous lines

Fixed clang-format escape
This commit is contained in:
Norm Evangelista 2023-01-18 08:27:17 -08:00 committed by Chris Thrasher
parent 84f56d0936
commit 6ef8e487cc
27 changed files with 19 additions and 39 deletions

View File

@ -6,6 +6,8 @@ Checks: >
readability-container-size-empty, readability-container-size-empty,
readability-identifier-naming, readability-identifier-naming,
readability-isolate-declaration, readability-isolate-declaration,
readability-qualified-auto,
readability-redundant-access-specifiers,
-clang-analyzer-core.NonNullParamChecker, -clang-analyzer-core.NonNullParamChecker,
-clang-analyzer-core.NullDereference, -clang-analyzer-core.NullDereference,
-clang-analyzer-nullability.NullablePassedToNonnull, -clang-analyzer-nullability.NullablePassedToNonnull,
@ -22,6 +24,13 @@ Checks: >
-modernize-use-auto, -modernize-use-auto,
-modernize-use-nodiscard, -modernize-use-nodiscard,
-modernize-use-trailing-return-type, -modernize-use-trailing-return-type,
-readability-braces-around-statements,
-readability-container-contains,
-readability-function-cognitive-complexity,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-implicit-bool-conversion
CheckOptions: CheckOptions:
- { key: readability-identifier-naming.ClassCase, value: CamelCase } - { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: camelBack } - { key: readability-identifier-naming.FunctionCase, value: camelBack }

View File

@ -70,7 +70,6 @@ private:
virtual void onUpdate(float time, float x, float y) = 0; virtual void onUpdate(float time, float x, float y) = 0;
virtual void onDraw(sf::RenderTarget& target, const sf::RenderStates& states) const = 0; virtual void onDraw(sf::RenderTarget& target, const sf::RenderStates& states) const = 0;
private:
std::string m_name; std::string m_name;
bool m_isLoaded{}; bool m_isLoaded{};

View File

@ -66,7 +66,6 @@ public:
std::string family; //!< The font family std::string family; //!< The font family
}; };
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -84,7 +84,6 @@ public:
// NOLINTNEXTLINE(readability-identifier-naming) // NOLINTNEXTLINE(readability-identifier-naming)
static CurrentTextureType CurrentTexture; static CurrentTextureType CurrentTexture;
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -299,7 +299,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void updateOutlineColors(); void updateOutlineColors();
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -61,7 +61,6 @@ public:
Pixels //!< Texture coordinates in range [0 .. size] Pixels //!< Texture coordinates in range [0 .. size]
}; };
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -180,7 +180,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void draw(RenderTarget& target, const RenderStates& states) const override; void draw(RenderTarget& target, const RenderStates& states) const override;
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -329,7 +329,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void draw(RenderTarget& target, const RenderStates& states) const override; void draw(RenderTarget& target, const RenderStates& states) const override;
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -162,7 +162,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool endOfPacket() const; bool endOfPacket() const;
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Test the validity of the packet, for reading /// \brief Test the validity of the packet, for reading
/// ///

View File

@ -67,7 +67,6 @@ public:
AnyPort = 0 //!< Special value that tells the system to pick any available port AnyPort = 0 //!< Special value that tells the system to pick any available port
}; };
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Destructor /// \brief Destructor
/// ///

View File

@ -156,7 +156,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
constexpr explicit Angle(float degrees); constexpr explicit Angle(float degrees);
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -115,7 +115,6 @@ private:
friend constexpr Time milliseconds(std::int32_t); friend constexpr Time milliseconds(std::int32_t);
friend constexpr Time microseconds(std::int64_t); friend constexpr Time microseconds(std::int64_t);
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -109,7 +109,6 @@ public:
NotAllowed //!< Action not allowed cursor NotAllowed //!< Action not allowed cursor
}; };
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///
@ -204,7 +203,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const priv::CursorImpl& getImpl() const; const priv::CursorImpl& getImpl() const;
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -52,7 +52,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(InputStream& stream); [[nodiscard]] static bool check(InputStream& stream);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///
@ -100,7 +99,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] std::uint64_t read(std::int16_t* samples, std::uint64_t maxCount) override; [[nodiscard]] std::uint64_t read(std::int16_t* samples, std::uint64_t maxCount) override;
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Hold the state that is passed to the decoder callbacks /// \brief Hold the state that is passed to the decoder callbacks
/// ///

View File

@ -70,7 +70,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(InputStream& stream); [[nodiscard]] static bool check(InputStream& stream);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -51,7 +51,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(InputStream& stream); [[nodiscard]] static bool check(InputStream& stream);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -49,7 +49,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(InputStream& stream); [[nodiscard]] static bool check(InputStream& stream);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -53,7 +53,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(const std::filesystem::path& filename); [[nodiscard]] static bool check(const std::filesystem::path& filename);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -54,7 +54,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(const std::filesystem::path& filename); [[nodiscard]] static bool check(const std::filesystem::path& filename);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -52,7 +52,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
[[nodiscard]] static bool check(const std::filesystem::path& filename); [[nodiscard]] static bool check(const std::filesystem::path& filename);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Default constructor /// \brief Default constructor
/// ///

View File

@ -388,7 +388,7 @@ float Font::getKerning(std::uint32_t first, std::uint32_t second, unsigned int c
if (first == 0 || second == 0) if (first == 0 || second == 0)
return 0.f; return 0.f;
auto face = m_fontHandles ? m_fontHandles->face.get() : nullptr; auto* face = m_fontHandles ? m_fontHandles->face.get() : nullptr;
if (face && setCurrentSize(characterSize)) if (face && setCurrentSize(characterSize))
{ {
@ -426,7 +426,7 @@ float Font::getKerning(std::uint32_t first, std::uint32_t second, unsigned int c
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float Font::getLineSpacing(unsigned int characterSize) const float Font::getLineSpacing(unsigned int characterSize) const
{ {
auto face = m_fontHandles ? m_fontHandles->face.get() : nullptr; auto* face = m_fontHandles ? m_fontHandles->face.get() : nullptr;
if (face && setCurrentSize(characterSize)) if (face && setCurrentSize(characterSize))
{ {
@ -442,7 +442,7 @@ float Font::getLineSpacing(unsigned int characterSize) const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float Font::getUnderlinePosition(unsigned int characterSize) const float Font::getUnderlinePosition(unsigned int characterSize) const
{ {
auto face = m_fontHandles ? m_fontHandles->face.get() : nullptr; auto* face = m_fontHandles ? m_fontHandles->face.get() : nullptr;
if (face && setCurrentSize(characterSize)) if (face && setCurrentSize(characterSize))
{ {
@ -463,7 +463,7 @@ float Font::getUnderlinePosition(unsigned int characterSize) const
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
float Font::getUnderlineThickness(unsigned int characterSize) const float Font::getUnderlineThickness(unsigned int characterSize) const
{ {
auto face = m_fontHandles ? m_fontHandles->face.get() : nullptr; auto* face = m_fontHandles ? m_fontHandles->face.get() : nullptr;
if (face && setCurrentSize(characterSize)) if (face && setCurrentSize(characterSize))
{ {
@ -557,7 +557,7 @@ Glyph Font::loadGlyph(std::uint32_t codePoint, unsigned int characterSize, bool
return glyph; return glyph;
// Get our FT_Face // Get our FT_Face
auto face = m_fontHandles->face.get(); auto* face = m_fontHandles->face.get();
if (!face) if (!face)
return glyph; return glyph;
@ -584,13 +584,13 @@ Glyph Font::loadGlyph(std::uint32_t codePoint, unsigned int characterSize, bool
{ {
if (bold) if (bold)
{ {
auto outlineGlyph = reinterpret_cast<FT_OutlineGlyph>(glyphDesc); auto* outlineGlyph = reinterpret_cast<FT_OutlineGlyph>(glyphDesc);
FT_Outline_Embolden(&outlineGlyph->outline, weight); FT_Outline_Embolden(&outlineGlyph->outline, weight);
} }
if (outlineThickness != 0) if (outlineThickness != 0)
{ {
auto stroker = m_fontHandles->stroker.get(); auto* stroker = m_fontHandles->stroker.get();
FT_Stroker_Set(stroker, FT_Stroker_Set(stroker,
static_cast<FT_Fixed>(outlineThickness * static_cast<float>(1 << 6)), static_cast<FT_Fixed>(outlineThickness * static_cast<float>(1 << 6)),
@ -605,7 +605,7 @@ Glyph Font::loadGlyph(std::uint32_t codePoint, unsigned int characterSize, bool
// Warning! After this line, do not read any data from glyphDesc directly, use // Warning! After this line, do not read any data from glyphDesc directly, use
// bitmapGlyph.root to access the FT_Glyph data. // bitmapGlyph.root to access the FT_Glyph data.
FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, nullptr, 1); FT_Glyph_To_Bitmap(&glyphDesc, FT_RENDER_MODE_NORMAL, nullptr, 1);
auto bitmapGlyph = reinterpret_cast<FT_BitmapGlyph>(glyphDesc); auto* bitmapGlyph = reinterpret_cast<FT_BitmapGlyph>(glyphDesc);
FT_Bitmap& bitmap = bitmapGlyph->bitmap; FT_Bitmap& bitmap = bitmapGlyph->bitmap;
// Apply bold if necessary -- fallback technique using bitmap (lower quality) // Apply bold if necessary -- fallback technique using bitmap (lower quality)
@ -799,7 +799,7 @@ bool Font::setCurrentSize(unsigned int characterSize) const
// only when necessary to avoid killing performances // only when necessary to avoid killing performances
// m_fontHandles and m_fontHandles->face are checked to be non-null before calling this method // m_fontHandles and m_fontHandles->face are checked to be non-null before calling this method
auto face = m_fontHandles->face.get(); auto* face = m_fontHandles->face.get();
FT_UShort currentSize = face->size->metrics.x_ppem; FT_UShort currentSize = face->size->metrics.x_ppem;
if (currentSize != characterSize) if (currentSize != characterSize)

View File

@ -134,7 +134,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static std::unique_ptr<GlContext> create(const ContextSettings& settings, const Vector2u& size); static std::unique_ptr<GlContext> create(const ContextSettings& settings, const Vector2u& size);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Check whether a given OpenGL extension is available /// \brief Check whether a given OpenGL extension is available
/// ///

View File

@ -83,7 +83,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
bool isKeyPressed(Keyboard::Key key); bool isKeyPressed(Keyboard::Key key);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the usb location ID of a given device /// \brief Get the usb location ID of a given device
/// ///
@ -213,7 +212,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static UInt8 usageToVirtualCode(UInt32 usage); static UInt8 usageToVirtualCode(UInt32 usage);
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -66,7 +66,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static HIDJoystickManager& getInstance(); static HIDJoystickManager& getInstance();
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the number of currently connected joystick /// \brief Get the number of currently connected joystick
/// ///
@ -100,7 +99,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
void update(); void update();
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Private "plug-in" callback /// \brief Private "plug-in" callback
/// \note Only 'context' parameter is used. /// \note Only 'context' parameter is used.
@ -117,7 +115,6 @@ private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void pluggedOut(void* context, IOReturn, void*, IOHIDDeviceRef); static void pluggedOut(void* context, IOReturn, void*, IOHIDDeviceRef);
private:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// Member data // Member data
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////

View File

@ -239,7 +239,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static void setUpProcess(); static void setUpProcess();
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Get the OS-specific handle of the window /// \brief Get the OS-specific handle of the window
/// ///

View File

@ -83,7 +83,6 @@ public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
static std::unique_ptr<WindowImpl> create(WindowHandle handle); static std::unique_ptr<WindowImpl> create(WindowHandle handle);
public:
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
/// \brief Destructor /// \brief Destructor
/// ///

View File

@ -18,7 +18,7 @@ TEST_CASE("[System] sf::err")
SUBCASE("Redirect buffer to observe contents") SUBCASE("Redirect buffer to observe contents")
{ {
sf::err() << "We'll never be able to observe this" << std::endl; // Ensure buffer is flushed sf::err() << "We'll never be able to observe this" << std::endl; // Ensure buffer is flushed
const auto defaultStreamBuffer = sf::err().rdbuf(); auto* const defaultStreamBuffer = sf::err().rdbuf();
CHECK(defaultStreamBuffer != nullptr); CHECK(defaultStreamBuffer != nullptr);
std::stringstream stream; std::stringstream stream;