From 8c17a6626d85efab2a08aaf7fd0e20f4b25338e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Mon, 3 Jul 2023 04:34:59 +0200 Subject: [PATCH] treewide: mark some functions `static` These were found by enabling the "missing-declarations" warning. --- spa/examples/adapter-control.c | 2 +- spa/examples/example-control.c | 2 +- spa/plugins/audioconvert/fmt-ops-avx2.c | 9 ++++----- spa/plugins/audioconvert/fmt-ops-sse2.c | 3 +-- spa/plugins/bluez5/backend-native.c | 2 +- spa/plugins/bluez5/backend-ofono.c | 2 +- spa/plugins/bluez5/iso-io.c | 2 +- spa/plugins/bluez5/midi-enum.c | 2 +- spa/plugins/support/cpu.c | 2 +- src/modules/module-avb/descriptors.h | 2 +- src/modules/module-jack-tunnel.c | 2 +- .../module-protocol-native/protocol-footer.c | 4 ++-- src/modules/module-pulse-tunnel.c | 2 +- src/modules/module-rt.c | 20 +++++++++---------- 14 files changed, 27 insertions(+), 29 deletions(-) diff --git a/spa/examples/adapter-control.c b/spa/examples/adapter-control.c index c77c8be3e..3434d2752 100644 --- a/spa/examples/adapter-control.c +++ b/spa/examples/adapter-control.c @@ -176,7 +176,7 @@ exit_cleanup: return res; } -int init_data(struct data *data) +static int init_data(struct data *data) { int res; const char *str; diff --git a/spa/examples/example-control.c b/spa/examples/example-control.c index 38c96b54e..f4755fa6b 100644 --- a/spa/examples/example-control.c +++ b/spa/examples/example-control.c @@ -457,7 +457,7 @@ static int load_handle(struct data *data, struct spa_handle **handle, const char return -EBADF; } -int init_data(struct data *data) +static int init_data(struct data *data) { int res; const char *str; diff --git a/spa/plugins/audioconvert/fmt-ops-avx2.c b/spa/plugins/audioconvert/fmt-ops-avx2.c index 3aac54fd9..5469aec5d 100644 --- a/spa/plugins/audioconvert/fmt-ops-avx2.c +++ b/spa/plugins/audioconvert/fmt-ops-avx2.c @@ -132,7 +132,7 @@ conv_s16_to_f32d_2_avx2(struct convert *conv, void * SPA_RESTRICT dst[], const v } } -void +static void conv_s24_to_f32d_1s_avx2(void *data, void * SPA_RESTRICT dst[], const void * SPA_RESTRICT src, uint32_t n_channels, uint32_t n_samples) { @@ -308,8 +308,7 @@ conv_s24_to_f32d_avx2(struct convert *conv, void * SPA_RESTRICT dst[], const voi conv_s24_to_f32d_1s_avx2(conv, &dst[i], &s[3*i], n_channels, n_samples); } - -void +static void conv_s32_to_f32d_4s_avx2(void *data, void * SPA_RESTRICT dst[], const void * SPA_RESTRICT src, uint32_t n_channels, uint32_t n_samples) { @@ -375,7 +374,7 @@ conv_s32_to_f32d_4s_avx2(void *data, void * SPA_RESTRICT dst[], const void * SPA } } -void +static void conv_s32_to_f32d_2s_avx2(void *data, void * SPA_RESTRICT dst[], const void * SPA_RESTRICT src, uint32_t n_channels, uint32_t n_samples) { @@ -423,7 +422,7 @@ conv_s32_to_f32d_2s_avx2(void *data, void * SPA_RESTRICT dst[], const void * SPA } } -void +static void conv_s32_to_f32d_1s_avx2(void *data, void * SPA_RESTRICT dst[], const void * SPA_RESTRICT src, uint32_t n_channels, uint32_t n_samples) { diff --git a/spa/plugins/audioconvert/fmt-ops-sse2.c b/spa/plugins/audioconvert/fmt-ops-sse2.c index 92217f213..eed5d2e48 100644 --- a/spa/plugins/audioconvert/fmt-ops-sse2.c +++ b/spa/plugins/audioconvert/fmt-ops-sse2.c @@ -315,8 +315,7 @@ conv_s24_to_f32d_sse2(struct convert *conv, void * SPA_RESTRICT dst[], const voi conv_s24_to_f32d_1s_sse2(conv, &dst[i], &s[3*i], n_channels, n_samples); } - -void +static void conv_s32_to_f32d_1s_sse2(void *data, void * SPA_RESTRICT dst[], const void * SPA_RESTRICT src, uint32_t n_channels, uint32_t n_samples) { diff --git a/spa/plugins/bluez5/backend-native.c b/spa/plugins/bluez5/backend-native.c index db8ba2ca1..ecd4c7761 100644 --- a/spa/plugins/bluez5/backend-native.c +++ b/spa/plugins/bluez5/backend-native.c @@ -2708,7 +2708,7 @@ static void set_call_setup(enum call_setup value, void *user_data) } } -void set_battery_level(unsigned int level, void *user_data) +static void set_battery_level(unsigned int level, void *user_data) { struct impl *backend = user_data; diff --git a/spa/plugins/bluez5/backend-ofono.c b/spa/plugins/bluez5/backend-ofono.c index e1d3c1a92..c24887517 100644 --- a/spa/plugins/bluez5/backend-ofono.c +++ b/spa/plugins/bluez5/backend-ofono.c @@ -307,7 +307,7 @@ static const struct spa_bt_transport_implementation ofono_transport_impl = { .release = ofono_audio_release, }; -bool activate_transport(struct spa_bt_transport *t, const void *data) +static bool activate_transport(struct spa_bt_transport *t, const void *data) { struct impl *backend = (void *)data; struct transport_data *td = t->user_data; diff --git a/spa/plugins/bluez5/iso-io.c b/spa/plugins/bluez5/iso-io.c index c35077db0..5e5b558ae 100644 --- a/spa/plugins/bluez5/iso-io.c +++ b/spa/plugins/bluez5/iso-io.c @@ -308,7 +308,7 @@ static void group_destroy(struct group *group) free(group); } -struct stream *stream_create(struct spa_bt_transport *t, struct group *group) +static struct stream *stream_create(struct spa_bt_transport *t, struct group *group) { struct stream *stream; void *codec_data = NULL; diff --git a/spa/plugins/bluez5/midi-enum.c b/spa/plugins/bluez5/midi-enum.c index 2f29db014..36c2231f0 100644 --- a/spa/plugins/bluez5/midi-enum.c +++ b/spa/plugins/bluez5/midi-enum.c @@ -202,7 +202,7 @@ static int read_probe(struct impl *impl, MidiEnumCharacteristicProxy *chr) return 0; } -Bluez5GattDescriptor1 *find_dsc(struct impl *impl, MidiEnumCharacteristicProxy *chr) +static Bluez5GattDescriptor1 *find_dsc(struct impl *impl, MidiEnumCharacteristicProxy *chr) { const char *path = g_dbus_proxy_get_object_path(G_DBUS_PROXY(chr)); Bluez5GattDescriptor1 *found = NULL;; diff --git a/spa/plugins/support/cpu.c b/spa/plugins/support/cpu.c index 9198f971f..2f31a0a4b 100644 --- a/spa/plugins/support/cpu.c +++ b/spa/plugins/support/cpu.c @@ -39,7 +39,7 @@ struct impl { uint32_t vm_type; }; -char *spa_cpu_read_file(const char *name, char *buffer, size_t len) +static char *spa_cpu_read_file(const char *name, char *buffer, size_t len) { int n, fd; diff --git a/src/modules/module-avb/descriptors.h b/src/modules/module-avb/descriptors.h index 87e7b74bf..6ec567851 100644 --- a/src/modules/module-avb/descriptors.h +++ b/src/modules/module-avb/descriptors.h @@ -7,7 +7,7 @@ #include "aecp-aem-descriptors.h" #include "internal.h" -void init_descriptors(struct server *server) +static inline void init_descriptors(struct server *server) { server_add_descriptor(server, AVB_AEM_DESC_STRINGS, 0, sizeof(struct avb_aem_desc_strings), diff --git a/src/modules/module-jack-tunnel.c b/src/modules/module-jack-tunnel.c index 501ac975f..51c616b35 100644 --- a/src/modules/module-jack-tunnel.c +++ b/src/modules/module-jack-tunnel.c @@ -744,7 +744,7 @@ do_schedule_destroy(struct spa_loop *loop, return 0; } -void module_schedule_destroy(struct impl *impl) +static void module_schedule_destroy(struct impl *impl) { pw_loop_invoke(impl->main_loop, do_schedule_destroy, 1, NULL, 0, false, impl); } diff --git a/src/modules/module-protocol-native/protocol-footer.c b/src/modules/module-protocol-native/protocol-footer.c index 35efe27cb..8ed1965b6 100644 --- a/src/modules/module-protocol-native/protocol-footer.c +++ b/src/modules/module-protocol-native/protocol-footer.c @@ -89,7 +89,7 @@ void marshal_client_footers(struct footer_client_global_state *state, struct pw_ end_footer(&fb); } -int demarshal_core_generation(void *object, struct spa_pod_parser *parser) +static int demarshal_core_generation(void *object, struct spa_pod_parser *parser) { struct pw_core *core = object; int64_t generation; @@ -106,7 +106,7 @@ int demarshal_core_generation(void *object, struct spa_pod_parser *parser) return 0; } -int demarshal_client_generation(void *object, struct spa_pod_parser *parser) +static int demarshal_client_generation(void *object, struct spa_pod_parser *parser) { struct pw_impl_client *client = object; int64_t generation; diff --git a/src/modules/module-pulse-tunnel.c b/src/modules/module-pulse-tunnel.c index 5d8b7d5b8..000d7c1b1 100644 --- a/src/modules/module-pulse-tunnel.c +++ b/src/modules/module-pulse-tunnel.c @@ -506,7 +506,7 @@ do_schedule_destroy(struct spa_loop *loop, return 0; } -void module_schedule_destroy(struct impl *impl) +static void module_schedule_destroy(struct impl *impl) { pw_loop_invoke(impl->main_loop, do_schedule_destroy, 1, NULL, 0, false, impl); } diff --git a/src/modules/module-rt.c b/src/modules/module-rt.c index 406e2b82d..8ddf3377b 100644 --- a/src/modules/module-rt.c +++ b/src/modules/module-rt.c @@ -207,7 +207,7 @@ static pid_t _gettid(void) } #ifdef HAVE_DBUS -struct pw_rtkit_bus *pw_rtkit_bus_get(DBusBusType bus_type) +static struct pw_rtkit_bus *pw_rtkit_bus_get(DBusBusType bus_type) { struct pw_rtkit_bus *bus; DBusError error; @@ -240,17 +240,17 @@ error: return NULL; } -struct pw_rtkit_bus *pw_rtkit_bus_get_system(void) +static struct pw_rtkit_bus *pw_rtkit_bus_get_system(void) { return pw_rtkit_bus_get(DBUS_BUS_SYSTEM); } -struct pw_rtkit_bus *pw_rtkit_bus_get_session(void) +static struct pw_rtkit_bus *pw_rtkit_bus_get_session(void) { return pw_rtkit_bus_get(DBUS_BUS_SESSION); } -bool pw_rtkit_check_xdg_portal(struct pw_rtkit_bus *system_bus) +static bool pw_rtkit_check_xdg_portal(struct pw_rtkit_bus *system_bus) { if (!dbus_bus_name_has_owner(system_bus->bus, XDG_PORTAL_SERVICE_NAME, NULL)) { pw_log_info("Can't find %s. Is xdg-desktop-portal running?", XDG_PORTAL_SERVICE_NAME); @@ -260,7 +260,7 @@ bool pw_rtkit_check_xdg_portal(struct pw_rtkit_bus *system_bus) return true; } -void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus) +static void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus) { dbus_connection_close(system_bus->bus); dbus_connection_unref(system_bus->bus); @@ -369,7 +369,7 @@ finish: return ret; } -int pw_rtkit_get_max_realtime_priority(struct impl *impl) +static int pw_rtkit_get_max_realtime_priority(struct impl *impl) { long long retval; int err; @@ -378,7 +378,7 @@ int pw_rtkit_get_max_realtime_priority(struct impl *impl) return err < 0 ? err : retval; } -int pw_rtkit_get_min_nice_level(struct impl *impl, int *min_nice_level) +static int pw_rtkit_get_min_nice_level(struct impl *impl, int *min_nice_level) { long long retval; int err; @@ -389,7 +389,7 @@ int pw_rtkit_get_min_nice_level(struct impl *impl, int *min_nice_level) return err; } -long long pw_rtkit_get_rttime_usec_max(struct impl *impl) +static long long pw_rtkit_get_rttime_usec_max(struct impl *impl) { long long retval; int err; @@ -398,7 +398,7 @@ long long pw_rtkit_get_rttime_usec_max(struct impl *impl) return err < 0 ? err : retval; } -int pw_rtkit_make_realtime(struct impl *impl, pid_t thread, int priority) +static int pw_rtkit_make_realtime(struct impl *impl, pid_t thread, int priority) { DBusMessage *m = NULL, *r = NULL; dbus_uint64_t pid; @@ -458,7 +458,7 @@ finish: return ret; } -int pw_rtkit_make_high_priority(struct impl *impl, pid_t thread, int nice_level) +static int pw_rtkit_make_high_priority(struct impl *impl, pid_t thread, int nice_level) { DBusMessage *m = NULL, *r = NULL; dbus_uint64_t pid;