Skip to content

Commit 1e51ad1

Browse files
committed
Update to latest DPF
Signed-off-by: falkTX <falktx@falktx.com>
1 parent f42469d commit 1e51ad1

19 files changed

+1163
-315
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: build
22

33
on:
44
push:
5+
branches:
6+
- '*'
7+
pull_request:
8+
branches:
9+
- '*'
510

611
jobs:
712
linux:
@@ -10,7 +15,7 @@ jobs:
1015
target: [linux-arm64, linux-armhf, linux-i686, linux-riscv64, linux-x86_64]
1116
runs-on: ubuntu-20.04
1217
steps:
13-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1419
with:
1520
submodules: recursive
1621
- uses: distrho/dpf-makefile-action@v1
@@ -23,7 +28,7 @@ jobs:
2328
target: [macos-intel, macos-universal]
2429
runs-on: macos-11
2530
steps:
26-
- uses: actions/checkout@v3
31+
- uses: actions/checkout@v4
2732
with:
2833
submodules: recursive
2934
- uses: distrho/dpf-makefile-action@v1
@@ -36,7 +41,7 @@ jobs:
3641
target: [win32, win64]
3742
runs-on: ubuntu-20.04
3843
steps:
39-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4045
with:
4146
submodules: recursive
4247
- uses: distrho/dpf-makefile-action@v1
@@ -47,7 +52,7 @@ jobs:
4752
pluginval:
4853
runs-on: ubuntu-20.04
4954
steps:
50-
- uses: actions/checkout@v3
55+
- uses: actions/checkout@v4
5156
with:
5257
submodules: recursive
5358
- uses: distrho/dpf-makefile-action@v1

dpf/dgl/src/pugl-upstream/.clang-tidy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020-2022 David Robillard <d@drobilla.net>
1+
# Copyright 2020-2024 David Robillard <d@drobilla.net>
22
# SPDX-License-Identifier: 0BSD OR ISC
33

44
Checks: >
@@ -11,6 +11,7 @@ Checks: >
1111
-clang-diagnostic-unused-macros,
1212
-llvmlibc-*,
1313
-misc-include-cleaner,
14+
-readability-avoid-nested-conditional-operator,
1415
-readability-identifier-length,
1516
CheckOptions:
1617
- key: hicpp-uppercase-literal-suffix.NewSuffixes

dpf/dgl/src/pugl-upstream/src/.clang-tidy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Copyright 2020-2022 David Robillard <d@drobilla.net>
1+
# Copyright 2020-2024 David Robillard <d@drobilla.net>
22
# SPDX-License-Identifier: 0BSD OR ISC
33

44
Checks: >
55
-bugprone-easily-swappable-parameters,
6+
-bugprone-multi-level-implicit-pointer-conversion,
7+
-clang-analyzer-optin.core.EnumCastOutOfRange,
68
-hicpp-multiway-paths-covered,
79
-hicpp-signed-bitwise,
810
-llvm-header-guard,

dpf/dgl/src/pugl-upstream/src/mac.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,11 +633,11 @@ - (void)scrollWheel:(NSEvent*)event
633633
const NSPoint wloc = [self eventLocation:event];
634634
const NSPoint rloc = [NSEvent mouseLocation];
635635

636-
double dx = -[event scrollingDeltaX];
637-
double dy = [event scrollingDeltaY];
638-
if (![event hasPreciseScrollingDeltas]) {
639-
dx *= 10.0;
640-
dy *= 10.0;
636+
double dx = -[event scrollingDeltaX] / 2.0;
637+
double dy = [event scrollingDeltaY] / 2.0;
638+
if ([event hasPreciseScrollingDeltas]) {
639+
dx /= 10.0;
640+
dy /= 10.0;
641641
}
642642

643643
const PuglScrollDirection dir =

dpf/distrho/DistrhoUtils.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
#include "src/DistrhoDefines.h"
2121

22+
#ifndef __STDC_LIMIT_MACROS
23+
# define __STDC_LIMIT_MACROS
24+
#endif
25+
2226
#include <cstdarg>
2327
#include <cstdio>
2428
#include <cstdlib>

dpf/distrho/extra/Base64.hpp

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DISTRHO Plugin Framework (DPF)
3-
* Copyright (C) 2012-2016 Filipe Coelho <falktx@falktx.com>
3+
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
44
*
55
* Permission to use, copy, modify, and/or distribute this software for any purpose with
66
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -19,7 +19,6 @@
1919

2020
#include "../DistrhoUtils.hpp"
2121

22-
#include <cctype>
2322
#include <vector>
2423

2524
// -----------------------------------------------------------------------
@@ -55,15 +54,15 @@
5554
#ifndef DOXYGEN
5655
namespace DistrhoBase64Helpers {
5756

58-
static const char* const kBase64Chars =
57+
static constexpr const char* const kBase64Chars =
5958
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
6059
"abcdefghijklmnopqrstuvwxyz"
6160
"0123456789+/";
6261

6362
static inline
6463
uint8_t findBase64CharIndex(const char c)
6564
{
66-
static const uint8_t kBase64CharsLen(static_cast<uint8_t>(std::strlen(kBase64Chars)));
65+
static const uint8_t kBase64CharsLen = static_cast<uint8_t>(std::strlen(kBase64Chars));
6766

6867
for (uint8_t i=0; i<kBase64CharsLen; ++i)
6968
{
@@ -75,10 +74,79 @@ uint8_t findBase64CharIndex(const char c)
7574
return 0;
7675
}
7776

78-
static inline
77+
static constexpr inline
7978
bool isBase64Char(const char c)
8079
{
81-
return (std::isalnum(c) || (c == '+') || (c == '/'));
80+
switch (c)
81+
{
82+
case 'A':
83+
case 'B':
84+
case 'C':
85+
case 'D':
86+
case 'E':
87+
case 'F':
88+
case 'G':
89+
case 'H':
90+
case 'I':
91+
case 'J':
92+
case 'K':
93+
case 'L':
94+
case 'M':
95+
case 'N':
96+
case 'O':
97+
case 'P':
98+
case 'Q':
99+
case 'R':
100+
case 'S':
101+
case 'T':
102+
case 'U':
103+
case 'V':
104+
case 'W':
105+
case 'X':
106+
case 'Y':
107+
case 'Z':
108+
case 'a':
109+
case 'b':
110+
case 'c':
111+
case 'd':
112+
case 'e':
113+
case 'f':
114+
case 'g':
115+
case 'h':
116+
case 'i':
117+
case 'j':
118+
case 'k':
119+
case 'l':
120+
case 'm':
121+
case 'n':
122+
case 'o':
123+
case 'p':
124+
case 'q':
125+
case 'r':
126+
case 's':
127+
case 't':
128+
case 'u':
129+
case 'v':
130+
case 'w':
131+
case 'x':
132+
case 'y':
133+
case 'z':
134+
case '0':
135+
case '1':
136+
case '2':
137+
case '3':
138+
case '4':
139+
case '5':
140+
case '6':
141+
case '7':
142+
case '8':
143+
case '9':
144+
case '+':
145+
case '/':
146+
return true;
147+
default:
148+
return false;
149+
}
82150
}
83151

84152
} // namespace DistrhoBase64Helpers

dpf/distrho/extra/ChildProcess.hpp

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
// SPDX-FileCopyrightText: 2023-2024 MOD Audio UG
2-
// SPDX-License-Identifier: AGPL-3.0-or-later
1+
/*
2+
* DISTRHO Plugin Framework (DPF)
3+
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
4+
*
5+
* Permission to use, copy, modify, and/or distribute this software for any purpose with
6+
* or without fee is hereby granted, provided that the above copyright notice and this
7+
* permission notice appear in all copies.
8+
*
9+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
10+
* TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
11+
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
12+
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
13+
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15+
*/
316

417
#pragma once
518

@@ -24,13 +37,18 @@ START_NAMESPACE_DISTRHO
2437
class ChildProcess
2538
{
2639
#ifdef _WIN32
27-
PROCESS_INFORMATION pinfo = { INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0, 0 };
40+
PROCESS_INFORMATION pinfo;
2841
#else
29-
pid_t pid = -1;
42+
pid_t pid;
3043
#endif
3144

3245
public:
3346
ChildProcess()
47+
#ifdef _WIN32
48+
: pinfo(CPP_AGGREGATE_INIT(PROCESS_INFORMATION){ INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0, 0 })
49+
#else
50+
: pid(-1)
51+
#endif
3452
{
3553
}
3654

@@ -120,7 +138,7 @@ class ChildProcess
120138
return;
121139

122140
const PROCESS_INFORMATION opinfo = pinfo;
123-
pinfo = { INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0, 0 };
141+
pinfo = (PROCESS_INFORMATION){ INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0, 0 };
124142

125143
for (DWORD exitCode;;)
126144
{
@@ -226,7 +244,7 @@ class ChildProcess
226244
WaitForSingleObject(pinfo.hProcess, 0) != WAIT_TIMEOUT)
227245
{
228246
const PROCESS_INFORMATION opinfo = pinfo;
229-
pinfo = { INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0, 0 };
247+
pinfo = (PROCESS_INFORMATION){ INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE, 0, 0 };
230248
CloseHandle(opinfo.hThread);
231249
CloseHandle(opinfo.hProcess);
232250
return false;

dpf/distrho/extra/ExternalWindow.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DISTRHO Plugin Framework (DPF)
3-
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
3+
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
44
*
55
* Permission to use, copy, modify, and/or distribute this software for any purpose with
66
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -78,13 +78,13 @@ class ExternalWindow
7878
Constructor.
7979
*/
8080
explicit ExternalWindow()
81-
: pData() {}
81+
: pData() {}
8282

8383
/**
8484
Constructor for DPF internal use.
8585
*/
8686
explicit ExternalWindow(const PrivateData& data)
87-
: pData(data) {}
87+
: pData(data) {}
8888

8989
/**
9090
Destructor.

dpf/distrho/extra/FileBrowserDialogImpl.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,17 +691,17 @@ bool fileBrowserIdle(const FileBrowserHandle handle)
691691
while (dbus_connection_dispatch(dbuscon) == DBUS_DISPATCH_DATA_REMAINS) {}
692692
dbus_connection_read_write_dispatch(dbuscon, 0);
693693

694-
if (DBusMessage* const message = dbus_connection_pop_message(dbuscon))
694+
if (DBusMessage* const msg = dbus_connection_pop_message(dbuscon))
695695
{
696-
const char* const interface = dbus_message_get_interface(message);
697-
const char* const member = dbus_message_get_member(message);
696+
const char* const interface = dbus_message_get_interface(msg);
697+
const char* const member = dbus_message_get_member(msg);
698698

699699
if (interface != nullptr && std::strcmp(interface, "org.freedesktop.portal.Request") == 0
700700
&& member != nullptr && std::strcmp(member, "Response") == 0)
701701
{
702702
do {
703703
DBusMessageIter iter;
704-
dbus_message_iter_init(message, &iter);
704+
dbus_message_iter_init(msg, &iter);
705705

706706
// starts with uint32 for return/exit code
707707
DISTRHO_SAFE_ASSERT_BREAK(dbus_message_iter_get_arg_type(&iter) == DBUS_TYPE_UINT32);
@@ -813,6 +813,8 @@ bool fileBrowserIdle(const FileBrowserHandle handle)
813813
if (handle->selectedFile == nullptr)
814814
handle->selectedFile = kSelectedFileCancelled;
815815
}
816+
817+
dbus_message_unref(msg);
816818
}
817819
}
818820
#endif

dpf/distrho/extra/RingBuffer.hpp

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* DISTRHO Plugin Framework (DPF)
3-
* Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com>
3+
* Copyright (C) 2012-2024 Filipe Coelho <falktx@falktx.com>
44
*
55
* Permission to use, copy, modify, and/or distribute this software for any purpose with
66
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -119,14 +119,6 @@ struct HugeStackBuffer {
119119
uint8_t buf[size];
120120
};
121121

122-
#ifdef DISTRHO_PROPER_CPP11_SUPPORT
123-
# define HeapBuffer_INIT {0, 0, 0, 0, false, nullptr}
124-
# define StackBuffer_INIT {0, 0, 0, false, {0}}
125-
#else
126-
# define HeapBuffer_INIT
127-
# define StackBuffer_INIT
128-
#endif
129-
130122
// -----------------------------------------------------------------------
131123
// RingBufferControl templated class
132124

@@ -799,12 +791,7 @@ class HeapRingBuffer : public RingBufferControl<HeapBuffer>
799791
public:
800792
/** Constructor. */
801793
HeapRingBuffer() noexcept
802-
: heapBuffer(HeapBuffer_INIT)
803-
{
804-
#ifndef DISTRHO_PROPER_CPP11_SUPPORT
805-
std::memset(&heapBuffer, 0, sizeof(heapBuffer));
806-
#endif
807-
}
794+
: heapBuffer(CPP_AGGREGATE_INIT(HeapBuffer){0, 0, 0, 0, false, nullptr}) {}
808795

809796
/** Destructor. */
810797
~HeapRingBuffer() noexcept override
@@ -874,11 +861,8 @@ class SmallStackRingBuffer : public RingBufferControl<SmallStackBuffer>
874861
public:
875862
/** Constructor. */
876863
SmallStackRingBuffer() noexcept
877-
: stackBuffer(StackBuffer_INIT)
864+
: stackBuffer(CPP_AGGREGATE_INIT(SmallStackBuffer){0, 0, 0, false, {0}})
878865
{
879-
#ifndef DISTRHO_PROPER_CPP11_SUPPORT
880-
std::memset(&stackBuffer, 0, sizeof(stackBuffer));
881-
#endif
882866
setRingBuffer(&stackBuffer, true);
883867
}
884868

0 commit comments

Comments
 (0)