From bd7c085bd019ec4a012154c3d290769672932a4e Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 14 Nov 2021 11:26:24 +0400 Subject: [PATCH] Fix warning in GCC on C++20. --- ui/style/style_core_font.cpp | 2 -- ui/style/style_core_font.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/style/style_core_font.cpp b/ui/style/style_core_font.cpp index 9f91524..7d2c3ef 100644 --- a/ui/style/style_core_font.cpp +++ b/ui/style/style_core_font.cpp @@ -301,8 +301,6 @@ FontData::FontData(int size, uint32 flags, int family, Font *other) , _family(family) { if (other) { memcpy(modified, other, sizeof(modified)); - } else { - memset(modified, 0, sizeof(modified)); } modified[_flags] = Font(this); diff --git a/ui/style/style_core_font.h b/ui/style/style_core_font.h index 638dcb5..df98408 100644 --- a/ui/style/style_core_font.h +++ b/ui/style/style_core_font.h @@ -24,7 +24,7 @@ int registerFontFamily(const QString &family); class FontData; class Font { public: - Font(Qt::Initialization = Qt::Uninitialized) : ptr(0) { + Font(Qt::Initialization = Qt::Uninitialized) { } Font(int size, uint32 flags, const QString &family); Font(int size, uint32 flags, int family); @@ -43,7 +43,7 @@ public: operator const QFont &() const; private: - FontData *ptr; + FontData *ptr = nullptr; void init(int size, uint32 flags, int family, Font *modified); friend void startManager();