diff options
author | David Robillard <d@drobilla.net> | 2020-07-21 20:21:20 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-07-21 20:21:20 +0200 |
commit | 4bf8f5f579ba954a2311078aef4dcb94cef0153e (patch) | |
tree | 9c9129d1842bc3e03dc630862b69110ed51c125c /src | |
parent | 0361e1d502257aceec7483c9e2553bb57b51704c (diff) | |
download | jalv-4bf8f5f579ba954a2311078aef4dcb94cef0153e.tar.gz jalv-4bf8f5f579ba954a2311078aef4dcb94cef0153e.tar.bz2 jalv-4bf8f5f579ba954a2311078aef4dcb94cef0153e.zip |
Use nullptr in C++
Diffstat (limited to 'src')
-rw-r--r-- | src/jalv_gtkmm2.cpp | 4 | ||||
-rw-r--r-- | src/jalv_qt.cpp | 16 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/jalv_gtkmm2.cpp b/src/jalv_gtkmm2.cpp index 3db2157..48bbf44 100644 --- a/src/jalv_gtkmm2.cpp +++ b/src/jalv_gtkmm2.cpp @@ -24,7 +24,7 @@ LV2_DISABLE_DEPRECATION_WARNINGS #include <gtkmm/window.h> LV2_RESTORE_WARNINGS -Gtk::Main* jalv_gtk_main = NULL; +Gtk::Main* jalv_gtk_main = nullptr; int jalv_init(int* argc, char*** argv, JalvOptions* opts) @@ -70,7 +70,7 @@ jalv_open_ui(Jalv* jalv) Gtk::Window* window = new Gtk::Window(); if (jalv->ui) { - jalv_ui_instantiate(jalv, jalv_native_ui_type(), NULL); + jalv_ui_instantiate(jalv, jalv_native_ui_type(), nullptr); } if (jalv->ui_instance) { diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp index 46f9a92..647c57b 100644 --- a/src/jalv_qt.cpp +++ b/src/jalv_qt.cpp @@ -48,7 +48,7 @@ #define CONTROL_WIDTH 150 #define DIAL_STEPS 10000 -static QApplication* app = NULL; +static QApplication* app = nullptr; class FlowLayout : public QLayout { @@ -148,7 +148,7 @@ FlowLayout::takeAt(int index) if (index >= 0 && index < itemList.size()) { return itemList.takeAt(index); } else { - return 0; + return nullptr; } } @@ -249,7 +249,7 @@ FlowLayout::smartSpacing(QStyle::PixelMetric pm) const return -1; } else if (parent->isWidgetType()) { QWidget* pw = static_cast<QWidget*>(parent); - return pw->style()->pixelMetric(pm, 0, pw); + return pw->style()->pixelMetric(pm, nullptr, pw); } else { return static_cast<QLayout*>(parent)->spacing(); } @@ -288,7 +288,7 @@ class Control : public QGroupBox Q_OBJECT public: - Control(PortContainer portContainer, QWidget* parent = 0); + Control(PortContainer portContainer, QWidget* parent = nullptr); Q_SLOT void dialChanged(int value); @@ -630,8 +630,8 @@ build_control_widget(Jalv* jalv) FlowLayout* flowLayout = new FlowLayout(); QLayout* layout = flowLayout; - LilvNode* lastGroup = NULL; - QHBoxLayout* groupLayout = NULL; + LilvNode* lastGroup = nullptr; + QHBoxLayout* groupLayout = nullptr; for (int i = 0; i < portContainers.count(); ++i) { PortContainer portContainer = portContainers[i]; Port* port = portContainer.port; @@ -643,10 +643,10 @@ build_control_widget(Jalv* jalv) if (!lilv_node_equals(group, lastGroup)) { /* Group has changed */ LilvNode* groupName = lilv_world_get( - world, group, jalv->nodes.lv2_name, NULL); + world, group, jalv->nodes.lv2_name, nullptr); if (!groupName) { groupName = lilv_world_get( - world, group, jalv->nodes.rdfs_label, NULL); + world, group, jalv->nodes.rdfs_label, nullptr); } QGroupBox* groupBox = new QGroupBox(lilv_node_as_string(groupName)); |