diff options
author | David Robillard <d@drobilla.net> | 2020-12-22 15:55:03 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-22 16:23:24 +0100 |
commit | 5ea33cc003ce4d3ef68e3b6e954c841f21db8efb (patch) | |
tree | 97d8955ed08faa70ca95958a3bb9ed5914c11ac3 | |
parent | 2769f3eadd6de75a2571b9c857509a76f7652205 (diff) | |
download | suil-5ea33cc003ce4d3ef68e3b6e954c841f21db8efb.tar.gz suil-5ea33cc003ce4d3ef68e3b6e954c841f21db8efb.tar.bz2 suil-5ea33cc003ce4d3ef68e3b6e954c841f21db8efb.zip |
Avoid "typedef" in C++
-rw-r--r-- | .clang-tidy | 1 | ||||
-rw-r--r-- | src/gtk2_in_qt4.cpp | 2 | ||||
-rw-r--r-- | src/gtk2_in_qt5.cpp | 4 | ||||
-rw-r--r-- | src/qt4_in_gtk2.cpp | 4 | ||||
-rw-r--r-- | src/qt5_in_gtk.cpp | 8 | ||||
-rw-r--r-- | src/win_in_gtk2.cpp | 4 | ||||
-rw-r--r-- | src/x11_in_qt4.cpp | 4 | ||||
-rw-r--r-- | src/x11_in_qt5.cpp | 4 |
8 files changed, 15 insertions, 16 deletions
diff --git a/.clang-tidy b/.clang-tidy index cf58bf2..636ba70 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,7 +19,6 @@ Checks: > -llvm-header-guard, -llvmlibc-*, -modernize-use-trailing-return-type, - -modernize-use-using, -readability-implicit-bool-conversion, -readability-non-const-parameter, WarningsAsErrors: '*' diff --git a/src/gtk2_in_qt4.cpp b/src/gtk2_in_qt4.cpp index c13561e..2bb3a03 100644 --- a/src/gtk2_in_qt4.cpp +++ b/src/gtk2_in_qt4.cpp @@ -27,7 +27,7 @@ extern "C" { -typedef struct _SuilGtk2InQt4Wrapper SuilGtk2InQt4Wrapper; +using SuilGtk2InQt4Wrapper = _SuilGtk2InQt4Wrapper; struct _SuilGtk2InQt4Wrapper { QX11EmbedContainer* host_widget; diff --git a/src/gtk2_in_qt5.cpp b/src/gtk2_in_qt5.cpp index e8967b5..14030b2 100644 --- a/src/gtk2_in_qt5.cpp +++ b/src/gtk2_in_qt5.cpp @@ -40,11 +40,11 @@ extern "C" { -typedef struct { +struct SuilGtk2InQt5Wrapper { QWidget* host_widget; QWindow* window; GtkWidget* plug; -} SuilGtk2InQt5Wrapper; +}; static void on_size_request(GtkWidget*, GtkRequisition* requisition, gpointer user_data) diff --git a/src/qt4_in_gtk2.cpp b/src/qt4_in_gtk2.cpp index bba1a03..a9631c1 100644 --- a/src/qt4_in_gtk2.cpp +++ b/src/qt4_in_gtk2.cpp @@ -29,8 +29,8 @@ extern "C" { #define SUIL_TYPE_QT_WRAPPER (suil_qt_wrapper_get_type()) #define SUIL_QT_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SUIL_TYPE_QT_WRAPPER, SuilQtWrapper)) -typedef struct _SuilQtWrapper SuilQtWrapper; -typedef struct _SuilQtWrapperClass SuilQtWrapperClass; +using SuilQtWrapper = _SuilQtWrapper; +using SuilQtWrapperClass = _SuilQtWrapperClass; struct _SuilQtWrapper { GtkSocket socket; diff --git a/src/qt5_in_gtk.cpp b/src/qt5_in_gtk.cpp index ae33436..5ce272c 100644 --- a/src/qt5_in_gtk.cpp +++ b/src/qt5_in_gtk.cpp @@ -45,7 +45,7 @@ extern "C" { -typedef struct { +struct SuilQtWrapper { GtkSocket socket; QWidget* qembed; SuilWrapper* wrapper; @@ -53,11 +53,11 @@ typedef struct { const LV2UI_Idle_Interface* idle_iface; guint idle_id; guint idle_ms; -} SuilQtWrapper; +}; -typedef struct { +struct SuilQtWrapperClass { GtkSocketClass parent_class; -} SuilQtWrapperClass; +}; GType suil_qt_wrapper_get_type(void); // Accessor for SUIL_TYPE_QT_WRAPPER diff --git a/src/win_in_gtk2.cpp b/src/win_in_gtk2.cpp index c1953eb..3bf9dd3 100644 --- a/src/win_in_gtk2.cpp +++ b/src/win_in_gtk2.cpp @@ -36,8 +36,8 @@ extern "C" { #define SUIL_TYPE_WIN_WRAPPER (suil_win_wrapper_get_type()) #define SUIL_WIN_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SUIL_TYPE_WIN_WRAPPER, SuilWinWrapper)) -typedef struct _SuilWinWrapper SuilWinWrapper; -typedef struct _SuilWinWrapperClass SuilWinWrapperClass; +using SuilWinWrapper = _SuilWinWrapper; +using SuilWinWrapperClass = _SuilWinWrapperClass; struct _SuilWinWrapper { GtkDrawingArea area; diff --git a/src/x11_in_qt4.cpp b/src/x11_in_qt4.cpp index 6437d57..9acb842 100644 --- a/src/x11_in_qt4.cpp +++ b/src/x11_in_qt4.cpp @@ -24,10 +24,10 @@ extern "C" { -typedef struct { +struct SuilX11InQt4Wrapper { QX11EmbedContainer* host_widget; QX11EmbedWidget* parent; -} SuilX11InQt4Wrapper; +}; class SuilQX11Container : public QX11EmbedContainer { diff --git a/src/x11_in_qt5.cpp b/src/x11_in_qt5.cpp index 642996c..41defa2 100644 --- a/src/x11_in_qt5.cpp +++ b/src/x11_in_qt5.cpp @@ -136,10 +136,10 @@ private: SuilQX11Widget::~SuilQX11Widget() = default; -typedef struct { +struct SuilX11InQt5Wrapper { QWidget* host_widget; SuilQX11Widget* parent; -} SuilX11InQt5Wrapper; +}; static void wrapper_free(SuilWrapper* wrapper) |