[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c01e2c3 2/7: Make certain classes 'final' as
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c01e2c3 2/7: Make certain classes 'final' as suggested by '-Wsuggest-final-types' |
Date: |
Fri, 22 Mar 2019 05:53:36 -0400 (EDT) |
branch: master
commit c01e2c3beff24b236406e6950152533deb2273bc
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Make certain classes 'final' as suggested by '-Wsuggest-final-types'
The advantage of these changes is that certain calls are devirtualized.
The false-positive rate for these suggestions was:
-Wsuggest-final-types: 6 out of 17 source files
-Wsuggest-final-methods: 100% false positives
---
about_dialog.hpp | 2 +-
account_value.hpp | 2 +-
any_member.hpp | 2 +-
input_sequence_entry.hpp | 2 +-
ledger.hpp | 2 +-
ledger_invariant.hpp | 2 +-
ledger_variant.hpp | 2 +-
main_wx_test.cpp | 2 +-
mc_enum.hpp | 2 +-
previewframe_ex.hpp | 2 +-
tn_range.hpp | 2 +-
11 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/about_dialog.hpp b/about_dialog.hpp
index f3e6271..a2b7157 100644
--- a/about_dialog.hpp
+++ b/about_dialog.hpp
@@ -48,7 +48,7 @@
/// keystrokes for scrolling would, astonishingly, fail to work), and,
/// for consistency, so does the first.
-class AboutDialog
+class AboutDialog final
:public wxDialog
{
public:
diff --git a/account_value.hpp b/account_value.hpp
index fbe962f..c3c355a 100644
--- a/account_value.hpp
+++ b/account_value.hpp
@@ -45,7 +45,7 @@ class Ledger;
class LedgerInvariant;
class LedgerVariant;
-class LMI_SO AccountValue
+class LMI_SO AccountValue final
:protected BasicValues
{
friend class SolveHelper;
diff --git a/any_member.hpp b/any_member.hpp
index 7ba1c69..d8e665d 100644
--- a/any_member.hpp
+++ b/any_member.hpp
@@ -108,7 +108,7 @@ inline placeholder::~placeholder() = default;
// Definition of class holder.
template<typename ClassType, typename ValueType>
-class holder
+class holder final
:public placeholder
{
// Friendship is extended to class any_member only to support its
diff --git a/input_sequence_entry.hpp b/input_sequence_entry.hpp
index ea79f1f..a352801 100644
--- a/input_sequence_entry.hpp
+++ b/input_sequence_entry.hpp
@@ -35,7 +35,7 @@ class Input;
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxTextCtrl;
-class InputSequenceEntry
+class InputSequenceEntry final
:public wxPanel
{
public:
diff --git a/ledger.hpp b/ledger.hpp
index a9fa5f3..a454df4 100644
--- a/ledger.hpp
+++ b/ledger.hpp
@@ -60,7 +60,7 @@ class LedgerInvariant;
class LedgerVariant;
class ledger_map_holder;
-class LMI_SO Ledger
+class LMI_SO Ledger final
{
friend class ledger_test;
diff --git a/ledger_invariant.hpp b/ledger_invariant.hpp
index 25ac68c..5377841 100644
--- a/ledger_invariant.hpp
+++ b/ledger_invariant.hpp
@@ -40,7 +40,7 @@
class BasicValues;
class Ledger;
-class LMI_SO LedgerInvariant
+class LMI_SO LedgerInvariant final
:public LedgerBase
{
public:
diff --git a/ledger_variant.hpp b/ledger_variant.hpp
index 12c9320..246b85b 100644
--- a/ledger_variant.hpp
+++ b/ledger_variant.hpp
@@ -39,7 +39,7 @@
class BasicValues;
-class LMI_SO LedgerVariant
+class LMI_SO LedgerVariant final
:public LedgerBase
{
public:
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index 373fca6..a4d5a3d 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -629,7 +629,7 @@ wxWindow* wx_test_focus_controller_child(MvcController&
dialog, char const* name
}
// Application to drive the tests
-class SkeletonTest : public Skeleton
+class SkeletonTest final : public Skeleton
{
public:
SkeletonTest()
diff --git a/mc_enum.hpp b/mc_enum.hpp
index a624a4e..3eac004 100644
--- a/mc_enum.hpp
+++ b/mc_enum.hpp
@@ -89,7 +89,7 @@ class LMI_SO mc_enum_base
/// explained in the documentation for class mc_enum_data.
template<typename T>
-class mc_enum
+class mc_enum final
:public mc_enum_base
{
static_assert(std::is_enum<T>::value);
diff --git a/previewframe_ex.hpp b/previewframe_ex.hpp
index fbba6f2..9efe684 100644
--- a/previewframe_ex.hpp
+++ b/previewframe_ex.hpp
@@ -39,7 +39,7 @@
#include <wx/prntbase.h>
-class PreviewFrameEx
+class PreviewFrameEx final
:public wxPreviewFrame
{
public:
diff --git a/tn_range.hpp b/tn_range.hpp
index a43123e..7a9f174 100644
--- a/tn_range.hpp
+++ b/tn_range.hpp
@@ -226,7 +226,7 @@ class LMI_SO tn_range_base
/// the right thing.
template<typename Number, typename Trammel>
-class tn_range
+class tn_range final
:public tn_range_base
{
static_assert(std::is_base_of<trammel_base<Number>,Trammel>::value);
- [lmi-commits] [lmi] master updated (eebb410 -> ec7be84), Greg Chicares, 2019/03/22
- [lmi-commits] [lmi] master c01e2c3 2/7: Make certain classes 'final' as suggested by '-Wsuggest-final-types',
Greg Chicares <=
- [lmi-commits] [lmi] master 784d552 4/7: Explain why '-Wsign-promo' is not enabled, Greg Chicares, 2019/03/22
- [lmi-commits] [lmi] master 5cb593a 3/7: Enable '-Wnon-virtual-dtor'; fix the issues it flags, Greg Chicares, 2019/03/22
- [lmi-commits] [lmi] master a1dadae 6/7: Explain why '-Wmissing-declarations' is not enabled, Greg Chicares, 2019/03/22
- [lmi-commits] [lmi] master f3cc535 1/7: Revise lists of postponed compiler options, Greg Chicares, 2019/03/22
- [lmi-commits] [lmi] master ec7be84 7/7: Enable '-Wswitch-enum'; fix the issues it flags, Greg Chicares, 2019/03/22
- [lmi-commits] [lmi] master 78a4de0 5/7: Enable '-Wnull-dereference'; fix the issues it flags, Greg Chicares, 2019/03/22