summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-21 19:46:19 +0100
committerDavid Robillard <d@drobilla.net>2020-12-21 19:46:19 +0100
commit1ad76015e4d4d6c8f44833edbfb0dead35560128 (patch)
treee2d809cc6f6e1037a50b301cbf8c4c407d901f5c /src
parenta392684c178b0f4bccdec06116048213bae1b491 (diff)
downloadsuil-1ad76015e4d4d6c8f44833edbfb0dead35560128.tar.gz
suil-1ad76015e4d4d6c8f44833edbfb0dead35560128.tar.bz2
suil-1ad76015e4d4d6c8f44833edbfb0dead35560128.zip
Use "nullptr" in C++ code
Diffstat (limited to 'src')
-rw-r--r--src/gtk2_in_qt5.cpp8
-rw-r--r--src/qt5_in_gtk.cpp28
2 files changed, 18 insertions, 18 deletions
diff --git a/src/gtk2_in_qt5.cpp b/src/gtk2_in_qt5.cpp
index daf4eac..1832132 100644
--- a/src/gtk2_in_qt5.cpp
+++ b/src/gtk2_in_qt5.cpp
@@ -66,7 +66,7 @@ wrapper_free(SuilWrapper* wrapper)
SuilGtk2InQt5Wrapper* impl = (SuilGtk2InQt5Wrapper*)wrapper->impl;
if (impl->window) {
- impl->window->setParent(NULL);
+ impl->window->setParent(nullptr);
delete impl->window;
}
@@ -84,7 +84,7 @@ wrapper_wrap(SuilWrapper* wrapper,
SuilInstance* instance)
{
SuilGtk2InQt5Wrapper* const impl = (SuilGtk2InQt5Wrapper*)wrapper->impl;
- QWidget* const wrap = new QWidget(NULL, Qt::Window);
+ QWidget* const wrap = new QWidget(nullptr, Qt::Window);
GtkWidget* const plug = gtk_plug_new(0);
GtkWidget* const widget = (GtkWidget*)instance->ui_widget;
@@ -143,9 +143,9 @@ suil_wrapper_new(SuilHost* host,
if (!host->gtk_lib) {
SUIL_ERRORF("Failed to open %s (%s)\n",
SUIL_GTK2_LIB_NAME, dylib_error());
- return NULL;
+ return nullptr;
}
- gtk_init(NULL, NULL);
+ gtk_init(nullptr, nullptr);
}
/* Create wrapper implementation. */
diff --git a/src/qt5_in_gtk.cpp b/src/qt5_in_gtk.cpp
index fee583e..38f285a 100644
--- a/src/qt5_in_gtk.cpp
+++ b/src/qt5_in_gtk.cpp
@@ -78,16 +78,16 @@ suil_qt_wrapper_finalize(GObject* gobject)
if (self->instance->handle) {
self->instance->descriptor->cleanup(self->instance->handle);
- self->instance->handle = NULL;
+ self->instance->handle = nullptr;
}
if (self->qembed) {
self->qembed->deleteLater();
}
- self->qembed = NULL;
- self->idle_iface = NULL;
- self->wrapper->impl = NULL;
+ self->qembed = nullptr;
+ self->idle_iface = nullptr;
+ self->wrapper->impl = nullptr;
G_OBJECT_CLASS(suil_qt_wrapper_parent_class)->finalize(gobject);
}
@@ -103,10 +103,10 @@ suil_qt_wrapper_class_init(SuilQtWrapperClass* klass)
static void
suil_qt_wrapper_init(SuilQtWrapper* self)
{
- self->qembed = NULL;
- self->wrapper = NULL;
- self->instance = NULL;
- self->idle_iface = NULL;
+ self->qembed = nullptr;
+ self->wrapper = nullptr;
+ self->instance = nullptr;
+ self->idle_iface = nullptr;
self->idle_id = 0;
self->idle_ms = 1000 / 30; // 30 Hz default
}
@@ -167,7 +167,7 @@ wrapper_wrap(SuilWrapper* wrapper,
instance->host_widget = GTK_WIDGET(wrap);
- const LV2UI_Idle_Interface* idle_iface = NULL;
+ const LV2UI_Idle_Interface* idle_iface = nullptr;
if (instance->descriptor->extension_data) {
idle_iface = (const LV2UI_Idle_Interface*)
instance->descriptor->extension_data(LV2_UI__idleInterface);
@@ -204,20 +204,20 @@ suil_wrapper_new(SuilHost*,
wrapper->free = wrapper_free;
SuilQtWrapper* const wrap = SUIL_QT_WRAPPER(
- g_object_new(SUIL_TYPE_QT_WRAPPER, NULL));
+ g_object_new(SUIL_TYPE_QT_WRAPPER, nullptr));
- wrap->wrapper = NULL;
+ wrap->wrapper = nullptr;
wrapper->impl = wrap;
wrapper->resize.handle = wrap;
wrapper->resize.ui_resize = suil_qt_wrapper_resize;
suil_add_feature(features, &n_features, LV2_UI__resize, &wrapper->resize);
- suil_add_feature(features, &n_features, LV2_UI__idleInterface, NULL);
+ suil_add_feature(features, &n_features, LV2_UI__idleInterface, nullptr);
// Scan for URID map and options
- LV2_URID_Map* map = NULL;
- LV2_Options_Option* options = NULL;
+ LV2_URID_Map* map = nullptr;
+ LV2_Options_Option* options = nullptr;
for (LV2_Feature** f = *features; *f && (!map || !options); ++f) {
if (!strcmp((*f)->URI, LV2_OPTIONS__options)) {
options = (LV2_Options_Option*)(*f)->data;