commit 56c106c0fd886a5d29e018807f40adb00f57fe4e
parent ce3f6c1147a82efd50107aa3ae9f4f99df6f2e53
Author: falkTX <falktx@falktx.com>
Date: Sun, 11 Feb 2024 14:14:09 +0100
Fix some compiler warnings, fix non-mac/win vst2 export
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
13 files changed, 133 insertions(+), 75 deletions(-)
diff --git a/dgl/EventHandlers.hpp b/dgl/EventHandlers.hpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -186,7 +186,7 @@ private:
struct PrivateData;
PrivateData* const pData;
- DISTRHO_LEAK_DETECTOR(SliderEventHandler)
+ DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(SliderEventHandler)
};
// --------------------------------------------------------------------------------------------------------------------
diff --git a/dgl/src/Cairo.cpp b/dgl/src/Cairo.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2019-2021 Jean Pierre Cimalando <jp-dev@inbox.ru>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
@@ -438,9 +438,9 @@ void CairoImage::loadFromMemory(const char* const rdata, const Size<uint>& s, co
for (int w = 0; w < width; ++w)
{
const uchar a = urdata[h*width*4+w*4+3];
- newdata[h*width*4+w*4+0] = (urdata[h*width*4+w*4+0] * a) >> 8;
- newdata[h*width*4+w*4+1] = (urdata[h*width*4+w*4+1] * a) >> 8;
- newdata[h*width*4+w*4+2] = (urdata[h*width*4+w*4+2] * a) >> 8;
+ newdata[h*width*4+w*4+0] = static_cast<uchar>((urdata[h*width*4+w*4+0] * a) >> 8);
+ newdata[h*width*4+w*4+1] = static_cast<uchar>((urdata[h*width*4+w*4+1] * a) >> 8);
+ newdata[h*width*4+w*4+2] = static_cast<uchar>((urdata[h*width*4+w*4+2] * a) >> 8);
newdata[h*width*4+w*4+3] = a;
}
}
@@ -465,9 +465,9 @@ void CairoImage::loadFromMemory(const char* const rdata, const Size<uint>& s, co
for (int w = 0; w < width; ++w)
{
const uchar a = urdata[h*width*4+w*4+3];
- newdata[h*width*4+w*4+0] = (urdata[h*width*4+w*4+2] * a) >> 8;
- newdata[h*width*4+w*4+1] = (urdata[h*width*4+w*4+1] * a) >> 8;
- newdata[h*width*4+w*4+2] = (urdata[h*width*4+w*4+0] * a) >> 8;
+ newdata[h*width*4+w*4+0] = static_cast<uchar>((urdata[h*width*4+w*4+2] * a) >> 8);
+ newdata[h*width*4+w*4+1] = static_cast<uchar>((urdata[h*width*4+w*4+1] * a) >> 8);
+ newdata[h*width*4+w*4+2] = static_cast<uchar>((urdata[h*width*4+w*4+0] * a) >> 8);
newdata[h*width*4+w*4+3] = a;
}
}
diff --git a/dgl/src/EventHandlers.cpp b/dgl/src/EventHandlers.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -419,7 +419,7 @@ struct KnobEventHandler::PrivateData {
if ((state & kKnobStateDragging) == 0x0)
return false;
- float movDiff;
+ double movDiff;
switch (orientation)
{
@@ -431,8 +431,8 @@ struct KnobEventHandler::PrivateData {
break;
case Both:
{
- const float movDiffX = ev.pos.getX() / scaleFactor - lastX;
- const float movDiffY = lastY - ev.pos.getY() / scaleFactor;
+ const double movDiffX = ev.pos.getX() / scaleFactor - lastX;
+ const double movDiffY = lastY - ev.pos.getY() / scaleFactor;
movDiff = std::abs(movDiffX) > std::abs(movDiffY) ? movDiffX : movDiffY;
}
break;
@@ -444,7 +444,7 @@ struct KnobEventHandler::PrivateData {
return true;
const float divisor = (ev.mod & kModifierControl) ? accel * 10.f : accel;
- valueTmp += (maximum - minimum) / divisor * movDiff;
+ valueTmp += (maximum - minimum) / divisor * static_cast<float>(movDiff);
if (usingLog)
valueTmp = logscale(valueTmp);
diff --git a/dgl/src/Layout.cpp b/dgl/src/Layout.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -35,8 +35,8 @@ uint Layout<true>::setAbsolutePos(int x, const int y, const uint padding)
SubWidgetWithSizeHint& s(*it);
maxHeight = std::max(maxHeight, s.widget->getHeight());
s.widget->setAbsolutePos(x, y);
- x += s.widget->getWidth();
- x += padding;
+ x += static_cast<int>(s.widget->getWidth());
+ x += static_cast<int>(padding);
}
return maxHeight;
@@ -52,8 +52,8 @@ uint Layout<false>::setAbsolutePos(const int x, int y, const uint padding)
SubWidgetWithSizeHint& s(*it);
maxWidth = std::max(maxWidth, s.widget->getWidth());
s.widget->setAbsolutePos(x, y);
- y += s.widget->getHeight();
- y += padding;
+ y += static_cast<int>(s.widget->getHeight());
+ y += static_cast<int>(padding);
}
return maxWidth;
@@ -78,7 +78,7 @@ void Layout<true>::setSize(const uint width, const uint padding)
}
if (const size_t numWidgets = widgets.size())
- nonFixedWidth -= padding * (numWidgets - 1);
+ nonFixedWidth -= padding * static_cast<uint>(numWidgets - 1);
const uint widthPerWidget = numDynamiclySizedWidgets != 0 ? nonFixedWidth / numDynamiclySizedWidgets : 0;
@@ -111,7 +111,7 @@ void Layout<false>::setSize(const uint height, const uint padding)
}
if (const size_t numWidgets = widgets.size())
- nonFixedHeight -= padding * (numWidgets - 1);
+ nonFixedHeight -= padding * static_cast<uint>(numWidgets - 1);
const uint heightPerWidget = numDynamiclySizedWidgets != 0 ? nonFixedHeight / numDynamiclySizedWidgets : 0;
@@ -138,8 +138,8 @@ void HorizontallyStackedVerticalLayout::setAbsolutePos(int x, const int y, const
for (VerticalLayoutIterator it=items.begin(), end=items.end(); it != end; ++it)
{
VerticalLayout* l(*it);
- x += l->setAbsolutePos(x, y, padding);
- x += padding;
+ x += static_cast<int>(l->setAbsolutePos(x, y, padding));
+ x += static_cast<int>(padding);
}
}
@@ -157,9 +157,9 @@ Size<uint> VerticallyStackedHorizontalLayout::adjustSize(const uint padding)
uint width = 0;
uint height = 0;
- for (SubWidgetWithSizeHintIterator it=l->widgets.begin(), end=l->widgets.end(); it != end; ++it)
+ for (SubWidgetWithSizeHintIterator it2=l->widgets.begin(), end2=l->widgets.end(); it2 != end2; ++it2)
{
- SubWidgetWithSizeHint& s(*it);
+ SubWidgetWithSizeHint& s(*it2);
if (width != 0)
width += padding;
@@ -191,8 +191,8 @@ void VerticallyStackedHorizontalLayout::setAbsolutePos(const int x, int y, const
for (HorizontalLayoutIterator it=items.begin(), end=items.end(); it != end; ++it)
{
HorizontalLayout* l(*it);
- y += l->setAbsolutePos(x, y, padding);
- y += padding;
+ y += static_cast<int>(l->setAbsolutePos(x, y, padding));
+ y += static_cast<int>(padding);
}
}
diff --git a/dgl/src/OpenGL.cpp b/dgl/src/OpenGL.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -691,12 +691,12 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const
const int w = static_cast<int>(self->getWidth());
const int h = static_cast<int>(self->getHeight());
- if (viewportScaleFactor != 0.0 && viewportScaleFactor != 1.0)
+ if (d_isNotZero(viewportScaleFactor) && d_isNotEqual(viewportScaleFactor, 1.0))
{
glViewport(x,
- -static_cast<int>(height * viewportScaleFactor - height + absolutePos.getY() + 0.5),
- static_cast<int>(width * viewportScaleFactor + 0.5),
- static_cast<int>(height * viewportScaleFactor + 0.5));
+ -d_roundToIntPositive(height * viewportScaleFactor - height + absolutePos.getY()),
+ d_roundToIntPositive(width * viewportScaleFactor),
+ d_roundToIntPositive(height * viewportScaleFactor));
}
else
{
@@ -712,16 +712,16 @@ void SubWidget::PrivateData::display(const uint width, const uint height, const
else
{
// set viewport pos
- glViewport(static_cast<int>(absolutePos.getX() * autoScaleFactor + 0.5),
- -static_cast<int>(absolutePos.getY() * autoScaleFactor + 0.5),
+ glViewport(d_roundToIntPositive(absolutePos.getX() * autoScaleFactor),
+ -d_roundToIntPositive(absolutePos.getY() * autoScaleFactor),
static_cast<int>(width),
static_cast<int>(height));
// then cut the outer bounds
- glScissor(static_cast<int>(absolutePos.getX() * autoScaleFactor + 0.5),
- static_cast<int>(height - (self->getHeight() + absolutePos.getY()) * autoScaleFactor + 0.5),
- static_cast<int>(self->getWidth() * autoScaleFactor + 0.5),
- static_cast<int>(self->getHeight() * autoScaleFactor + 0.5));
+ glScissor(d_roundToIntPositive(absolutePos.getX() * autoScaleFactor),
+ d_roundToIntPositive(height - (static_cast<int>(self->getHeight()) + absolutePos.getY()) * autoScaleFactor),
+ d_roundToIntPositive(self->getWidth() * autoScaleFactor),
+ d_roundToIntPositive(self->getHeight() * autoScaleFactor));
glEnable(GL_SCISSOR_TEST);
needsDisableScissor = true;
diff --git a/dgl/src/SubWidget.cpp b/dgl/src/SubWidget.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -71,7 +71,7 @@ Rectangle<uint> SubWidget::getConstrainedAbsoluteArea() const noexcept
const int y = getAbsoluteY();
if (x >= 0 && y >= 0)
- return Rectangle<uint>(x, y, getSize());
+ return Rectangle<uint>(static_cast<uint>(x), static_cast<uint>(y), getSize());
const int xOffset = std::min(0, x);
const int yOffset = std::min(0, y);
diff --git a/dgl/src/Window.cpp b/dgl/src/Window.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -269,10 +269,10 @@ void Window::setSize(uint width, uint height)
uint minWidth = pData->minWidth;
uint minHeight = pData->minHeight;
- if (pData->autoScaling && scaleFactor != 1.0)
+ if (pData->autoScaling && d_isNotEqual(scaleFactor, 1.0))
{
- minWidth *= scaleFactor;
- minHeight *= scaleFactor;
+ minWidth = d_roundToUnsignedInt(minWidth * scaleFactor);
+ minHeight = d_roundToUnsignedInt(minHeight * scaleFactor);
}
// handle geometry constraints here
@@ -293,10 +293,10 @@ void Window::setSize(uint width, uint height)
{
// fix width
if (reqRatio > ratio)
- width = static_cast<uint>(height * ratio + 0.5);
+ width = d_roundToUnsignedInt(height * ratio);
// fix height
else
- height = static_cast<uint>(static_cast<double>(width) / ratio + 0.5);
+ height = d_roundToUnsignedInt(static_cast<double>(width) / ratio);
}
}
}
@@ -430,10 +430,10 @@ void Window::repaint(const Rectangle<uint>& rect) noexcept
{
const double autoScaleFactor = pData->autoScaleFactor;
- prect.x *= autoScaleFactor;
- prect.y *= autoScaleFactor;
- prect.width *= autoScaleFactor;
- prect.height *= autoScaleFactor;
+ prect.x = static_cast<PuglCoord>(prect.x * autoScaleFactor);
+ prect.y = static_cast<PuglCoord>(prect.y * autoScaleFactor);
+ prect.width = static_cast<PuglSpan>(prect.width * autoScaleFactor + 0.5);
+ prect.height = static_cast<PuglSpan>(prect.height * autoScaleFactor + 0.5);
}
puglPostRedisplayRect(pData->view, prect);
}
@@ -479,8 +479,8 @@ void Window::setGeometryConstraints(uint minimumWidth,
if (automaticallyScale && scaleFactor != 1.0)
{
- minimumWidth *= scaleFactor;
- minimumHeight *= scaleFactor;
+ minimumWidth = d_roundToUnsignedInt(minimumWidth * scaleFactor);
+ minimumHeight = d_roundToUnsignedInt(minimumHeight * scaleFactor);
}
puglSetGeometryConstraints(pData->view, minimumWidth, minimumHeight, keepAspectRatio);
diff --git a/dgl/src/WindowPrivateData.cpp b/dgl/src/WindowPrivateData.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -270,18 +270,18 @@ void Window::PrivateData::initPre(const uint width, const uint height, const boo
puglSetViewHint(view, PUGL_RESIZABLE, resizable ? PUGL_TRUE : PUGL_FALSE);
puglSetViewHint(view, PUGL_IGNORE_KEY_REPEAT, PUGL_FALSE);
-#if DGL_USE_RGBA
+ #if defined(DGL_USE_RGBA) && DGL_USE_RGBA
puglSetViewHint(view, PUGL_DEPTH_BITS, 24);
-#else
+ #else
puglSetViewHint(view, PUGL_DEPTH_BITS, 16);
-#endif
+ #endif
puglSetViewHint(view, PUGL_STENCIL_BITS, 8);
// PUGL_SAMPLES ??
puglSetEventFunc(view, puglEventCallback);
// setting default size triggers system-level calls, do it last
- puglSetSizeHint(view, PUGL_DEFAULT_SIZE, width, height);
+ puglSetSizeHint(view, PUGL_DEFAULT_SIZE, static_cast<PuglSpan>(width), static_cast<PuglSpan>(height));
}
bool Window::PrivateData::initPost()
diff --git a/dgl/src/pugl.cpp b/dgl/src/pugl.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -181,7 +181,14 @@ START_NAMESPACE_DGL
# include "pugl-upstream/src/win_vulkan.c"
# endif
#elif defined(HAVE_X11)
+# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wsign-conversion"
+# endif
# include "pugl-upstream/src/x11.c"
+# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+# pragma GCC diagnostic pop
+# endif
# include "pugl-upstream/src/x11_stub.c"
# ifdef DGL_CAIRO
# include "pugl-upstream/src/x11_cairo.c"
@@ -277,13 +284,13 @@ void puglRaiseWindow(PuglView* const view)
PuglStatus puglSetGeometryConstraints(PuglView* const view, const uint width, const uint height, const bool aspect)
{
- view->sizeHints[PUGL_MIN_SIZE].width = width;
- view->sizeHints[PUGL_MIN_SIZE].height = height;
+ view->sizeHints[PUGL_MIN_SIZE].width = static_cast<PuglSpan>(width);
+ view->sizeHints[PUGL_MIN_SIZE].height = static_cast<PuglSpan>(height);
if (aspect)
{
- view->sizeHints[PUGL_FIXED_ASPECT].width = width;
- view->sizeHints[PUGL_FIXED_ASPECT].height = height;
+ view->sizeHints[PUGL_FIXED_ASPECT].width = static_cast<PuglSpan>(width);
+ view->sizeHints[PUGL_FIXED_ASPECT].height = static_cast<PuglSpan>(height);
}
#if defined(DISTRHO_OS_HAIKU)
diff --git a/distrho/DistrhoDetails.hpp b/distrho/DistrhoDetails.hpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -566,7 +566,7 @@ struct ParameterEnumerationValues {
When using this constructor the pointer to @values MUST have been statically declared.@n
It will not be automatically deleted later.
*/
- constexpr ParameterEnumerationValues(uint32_t c, bool r, ParameterEnumerationValue* v) noexcept
+ constexpr ParameterEnumerationValues(uint8_t c, bool r, ParameterEnumerationValue* v) noexcept
: count(c),
restrictedMode(r),
values(v),
@@ -578,6 +578,8 @@ struct ParameterEnumerationValues {
if (deleteLater)
delete[] values;
}
+
+ DISTRHO_DECLARE_NON_COPYABLE(ParameterEnumerationValues)
};
/**
@@ -669,6 +671,7 @@ struct Parameter {
shortName(),
symbol(),
unit(),
+ description(),
ranges(),
enumValues(),
designation(kParameterDesignationNull),
@@ -684,6 +687,7 @@ struct Parameter {
shortName(),
symbol(s),
unit(u),
+ description(),
ranges(def, min, max),
enumValues(),
designation(kParameterDesignationNull),
@@ -702,6 +706,7 @@ struct Parameter {
shortName(),
symbol(s),
unit(u),
+ description(),
ranges(def, min, max),
enumValues(evcount, true, ev),
designation(kParameterDesignationNull),
diff --git a/distrho/DistrhoUtils.hpp b/distrho/DistrhoUtils.hpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -310,7 +310,7 @@ uint32_t d_nextPowerOf2(uint32_t size) noexcept
}
/**
- Round a floating point number to integer.
+ Round a floating point number to an integer.
Fast operation for values known to be 0 or positive.
*/
template<typename T>
@@ -321,7 +321,18 @@ int32_t d_roundToIntPositive(const T& value)
}
/**
- Round a floating point number to integer.
+ Round a floating point number to an unsigned integer.
+ Fast operation for values known to be 0 or positive.
+ */
+template<typename T>
+static inline constexpr
+uint32_t d_roundToUnsignedInt(const T& value)
+{
+ return static_cast<uint32_t>(value + static_cast<T>(0.5));
+}
+
+/**
+ Round a floating point number to an integer.
Fast operation for values known to be 0 or negative.
*/
template<typename T>
diff --git a/distrho/extra/FileBrowserDialogImpl.cpp b/distrho/extra/FileBrowserDialogImpl.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -47,7 +47,22 @@
#ifdef HAVE_X11
# define DBLCLKTME 400
# include "sofd/libsofd.h"
+# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wcast-qual"
+# pragma GCC diagnostic ignored "-Wconversion"
+# pragma GCC diagnostic ignored "-Wfloat-conversion"
+# pragma GCC diagnostic ignored "-Wshadow"
+# pragma GCC diagnostic ignored "-Wsign-conversion"
+# pragma GCC diagnostic ignored "-Wstrict-overflow"
+# endif
# include "sofd/libsofd.c"
+# if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+# pragma GCC diagnostic pop
+# endif
+# undef HAVE_MNTENT
+# undef MAX
+# undef MIN
#endif
#ifdef FILE_BROWSER_DIALOG_DGL_NAMESPACE
@@ -329,6 +344,16 @@ struct FileBrowserData {
#else // DISTRHO_OS_WINDOWS
FileBrowserData(const bool save)
: selectedFile(nullptr)
+ #ifdef DISTRHO_OS_MAC
+ , nsBasePanel(nullptr)
+ , nsOpenPanel(nullptr)
+ #endif
+ #ifdef HAVE_DBUS
+ , dbuscon(nullptr)
+ #endif
+ #ifdef HAVE_X11
+ , x11display(nullptr)
+ #endif
{
#ifdef DISTRHO_OS_MAC
if (save)
@@ -393,6 +418,8 @@ struct FileBrowserData {
std::free(const_cast<char*>(selectedFile));
selectedFile = nullptr;
}
+
+ DISTRHO_DECLARE_NON_COPYABLE(FileBrowserData)
};
// --------------------------------------------------------------------------------------------------------------------
@@ -590,7 +617,8 @@ FileBrowserHandle fileBrowserCreate(const bool isEmbed,
dbus_message_iter_open_container(&dict, DBUS_TYPE_VARIANT, "ay", &variant);
dbus_message_iter_open_container(&variant, DBUS_TYPE_ARRAY, "y", &variantArray);
dbus_message_iter_append_fixed_array(&variantArray, DBUS_TYPE_BYTE,
- ¤t_folder_val, startDir.length()+1);
+ ¤t_folder_val,
+ static_cast<int>(startDir.length() + 1));
dbus_message_iter_close_container(&variant, &variantArray);
dbus_message_iter_close_container(&dict, &variant);
dbus_message_iter_close_container(&array, &dict);
diff --git a/distrho/src/DistrhoPluginVST2.cpp b/distrho/src/DistrhoPluginVST2.cpp
@@ -1,6 +1,6 @@
/*
* DISTRHO Plugin Framework (DPF)
- * Copyright (C) 2012-2023 Filipe Coelho <falktx@falktx.com>
+ * Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
*
* Permission to use, copy, modify, and/or distribute this software for any purpose with
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -1607,11 +1607,7 @@ static void VST_FUNCTION_INTERFACE vst_processReplacingCallback(vst_effect* cons
END_NAMESPACE_DISTRHO
DISTRHO_PLUGIN_EXPORT
-#if defined(DISTRHO_OS_MAC) || defined(DISTRHO_OS_WASM) || defined(DISTRHO_OS_WINDOWS)
-const vst_effect* VSTPluginMain(vst_host_callback audioMaster);
-#else
-const vst_effect* VSTPluginMain(vst_host_callback audioMaster) asm ("main");
-#endif
+const vst_effect* VSTPluginMain(vst_host_callback);
DISTRHO_PLUGIN_EXPORT
const vst_effect* VSTPluginMain(const vst_host_callback audioMaster)
@@ -1735,4 +1731,15 @@ const vst_effect* VSTPluginMain(const vst_host_callback audioMaster)
return effect;
}
+#if !(defined(DISTRHO_OS_MAC) || defined(DISTRHO_OS_WASM) || defined(DISTRHO_OS_WINDOWS))
+DISTRHO_PLUGIN_EXPORT
+const vst_effect* VSTPluginMainCompat(vst_host_callback) asm ("main");
+
+DISTRHO_PLUGIN_EXPORT
+const vst_effect* VSTPluginMainCompat(const vst_host_callback audioMaster)
+{
+ return VSTPluginMain(audioMaster);
+}
+#endif
+
// --------------------------------------------------------------------------------------------------------------------