Skip to content

Commit d33b09f

Browse files
committed
Fix CI tests
1 parent 39b99ff commit d33b09f

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ set(PLUGIN_AUTHOR "Ian Rodriguez")
1111

1212
# Replace `com.example.obs-plugin-template` with a unique Bundle ID for macOS releases (used both in
1313
# the installer and when submitting the installer for notarization)
14-
set(MACOS_BUNDLEID "com.source_defaults.${CMAKE_PROJECT_NAME}")
14+
set(MACOS_BUNDLEID "com.source-defaults.${CMAKE_PROJECT_NAME}")
1515

1616
# Replace `[email protected]` with the maintainer email address you want to put in Linux packages
1717
set(LINUX_MAINTAINER_EMAIL "[email protected]")

src/source-defaults-filter.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ with this program. If not, see <https://www.gnu.org/licenses/>
1818

1919
#include <obs-module.h>
2020
#include <util/dstr.h>
21+
#include <util/base.h>
2122

2223
#include "plugin-macros.generated.h"
2324

2425
// so that old sources don't return with an empty settings object,
2526
// thus letting us distinguish between "new" sources and recreated sources due to undo/redo
2627
#define ENCOUNTERED_KEY "com.source_defaults.encountered"
2728

28-
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
29-
3029
#define COPY_PROPERTIES 0
3130
#define COPY_FILTERS 1
3231
#define COPY_AUDIO_MONITORING 2
@@ -53,7 +52,7 @@ static const char *option_labels[] = {
5352
struct source_defaults {
5453
obs_source_t *source; // the filter itself
5554
obs_source_t *parent_source;
56-
bool options[ARRAY_SIZE(option_keys)];
55+
bool options[OBS_COUNTOF(option_keys)];
5756
};
5857

5958
static void enum_filters(obs_source_t *src, obs_source_t *filter, void *param)
@@ -74,7 +73,7 @@ static void log_changes(struct source_defaults *src, obs_source_t *dst)
7473
dstr_cat(&log, "Applied ");
7574

7675
bool first_bool = true;
77-
for (unsigned long i = 0; i < ARRAY_SIZE(option_keys); i++) {
76+
for (size_t i = 0; i < OBS_COUNTOF(option_keys); i++) {
7877
if (src->options[i]) {
7978
if (first_bool) {
8079
dstr_cat(&log, option_labels[i]);
@@ -204,7 +203,7 @@ static void source_created_cb(void *data, calldata_t *cd)
204203
static void source_defaults_update(void *data, obs_data_t *settings)
205204
{
206205
struct source_defaults *src = data;
207-
for (unsigned long i = 0; i < ARRAY_SIZE(option_keys); i++) {
206+
for (size_t i = 0; i < OBS_COUNTOF(option_keys); i++) {
208207
src->options[i] = obs_data_get_bool(settings, option_keys[i]);
209208
}
210209
}
@@ -233,7 +232,7 @@ static obs_properties_t *source_defaults_properties(void *data)
233232
src->parent_source = obs_filter_get_parent(src->source);
234233
if (obs_source_get_output_flags(src->parent_source) &
235234
OBS_SOURCE_AUDIO) {
236-
for (unsigned long i = 2; i < ARRAY_SIZE(option_keys); i++) {
235+
for (size_t i = 2; i < OBS_COUNTOF(option_keys); i++) {
237236
obs_properties_add_bool(props, option_keys[i],
238237
option_labels[i]);
239238
}
@@ -244,7 +243,7 @@ static obs_properties_t *source_defaults_properties(void *data)
244243

245244
static void source_defaults_get_defaults(obs_data_t *settings)
246245
{
247-
for (unsigned long i = 0; i < ARRAY_SIZE(option_keys); i++) {
246+
for (size_t i = 0; i < OBS_COUNTOF(option_keys); i++) {
248247
obs_data_set_default_bool(settings, option_keys[i], true);
249248
}
250249
}

0 commit comments

Comments
 (0)