From dbaf3454c3796cc021ef7ea928baf2c02f0019b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 Jul 2024 17:09:06 +0200 Subject: [PATCH 1/5] auth: Make async function names match the async/finish pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise we trip up gobject introspection 2.80 like ../src/auth.h:19: Warning: Phosh: Couldn't find 'authenticate_async_start_finish' for the corresponding async function: 'authenticate_async_start' and ../src/auth.h:19: Warning: Phosh: Couldn't find 'authenticate_finish' for the corresponding async function: 'authenticate_async' Signed-off-by: Guido Günther Part-of: --- src/auth.c | 16 ++++++++-------- src/auth.h | 16 ++++++++-------- src/lockscreen.c | 12 ++++++------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/auth.c b/src/auth.c index 939a9d1cb..08b184f9d 100644 --- a/src/auth.c +++ b/src/auth.c @@ -170,11 +170,11 @@ phosh_auth_new (void) void -phosh_auth_authenticate_async_start (PhoshAuth *self, - const char *number, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer callback_data) +phosh_auth_authenticate_async (PhoshAuth *self, + const char *number, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer callback_data) { GTask *task; @@ -186,9 +186,9 @@ phosh_auth_authenticate_async_start (PhoshAuth *self, gboolean -phosh_auth_authenticate_async_finish (PhoshAuth *self, - GAsyncResult *result, - GError **error) +phosh_auth_authenticate_finish (PhoshAuth *self, + GAsyncResult *result, + GError **error) { g_return_val_if_fail (g_task_is_valid (result, self), FALSE); return g_task_propagate_boolean (G_TASK (result), error); diff --git a/src/auth.h b/src/auth.h index e977c111a..b6c5cb875 100644 --- a/src/auth.h +++ b/src/auth.h @@ -16,12 +16,12 @@ G_DECLARE_FINAL_TYPE (PhoshAuth, phosh_auth, PHOSH, AUTH, GObject) GObject *phosh_auth_new (void); -void phosh_auth_authenticate_async_start (PhoshAuth *self, - const char *number, - GCancellable *cancellable, - GAsyncReadyCallback callback, - gpointer user_data); -gboolean phosh_auth_authenticate_async_finish (PhoshAuth *self, - GAsyncResult *result, - GError **error); +void phosh_auth_authenticate_async (PhoshAuth *self, + const char *number, + GCancellable *cancellable, + GAsyncReadyCallback callback, + gpointer user_data); +gboolean phosh_auth_authenticate_finish (PhoshAuth *self, + GAsyncResult *result, + GError **error); diff --git a/src/lockscreen.c b/src/lockscreen.c index fb5c1a2bd..311b8094a 100644 --- a/src/lockscreen.c +++ b/src/lockscreen.c @@ -276,7 +276,7 @@ auth_async_cb (PhoshAuth *auth, GAsyncResult *result, PhoshLockscreen *self) gboolean authenticated; priv = phosh_lockscreen_get_instance_private (self); - authenticated = phosh_auth_authenticate_async_finish (auth, result, &error); + authenticated = phosh_auth_authenticate_finish (auth, result, &error); if (error != NULL) { g_warning ("Auth failed unexpected: %s", error->message); return; @@ -394,11 +394,11 @@ submit_cb (PhoshLockscreen *self) if (priv->auth == NULL) priv->auth = PHOSH_AUTH (phosh_auth_new ()); - phosh_auth_authenticate_async_start (priv->auth, - input, - NULL, - (GAsyncReadyCallback)auth_async_cb, - g_object_ref (self)); + phosh_auth_authenticate_async (priv->auth, + input, + NULL, + (GAsyncReadyCallback)auth_async_cb, + g_object_ref (self)); } -- GitLab From e4e83accda17e53af52b3c7bfc84eef64b62b056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 Jul 2024 18:00:23 +0200 Subject: [PATCH 2/5] audio-devices: Use gpointer instead of GvcMixerControl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently don't build GObject introspection for libgvc so using its types in the header gives warnings like ../src/settings/audio-devices.h:19: Warning: Phosh: phosh_audio_devices_new: argument mixer: Unresolved type: 'GvcMixerControl*' As this is only needed for the constructor and since we have a type check for the property anyway use a gpointer to silence the warning. Signed-off-by: Guido Günther Part-of: --- src/settings/audio-devices.c | 11 +++++++++-- src/settings/audio-devices.h | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/settings/audio-devices.c b/src/settings/audio-devices.c index 7749c3af8..7f2546b63 100644 --- a/src/settings/audio-devices.c +++ b/src/settings/audio-devices.c @@ -312,9 +312,16 @@ phosh_audio_devices_init (PhoshAudioDevices *self) g_signal_connect_swapped (self->devices, "items-changed", G_CALLBACK (on_items_changed), self); } - +/** + * phosh_audio_devices_new: + * @mixer_control: A new GvcMixerControl + * @is_input: Whether this is this an input + * + * Gets a new audio devices object which exposes the currently known + * input or output devices as a list model. + */ PhoshAudioDevices * -phosh_audio_devices_new (GvcMixerControl *mixer_control, gboolean is_input) +phosh_audio_devices_new (gpointer mixer_control, gboolean is_input) { return g_object_new (PHOSH_TYPE_AUDIO_DEVICES, "mixer-control", mixer_control, diff --git a/src/settings/audio-devices.h b/src/settings/audio-devices.h index da9be099b..20b2c5d90 100644 --- a/src/settings/audio-devices.h +++ b/src/settings/audio-devices.h @@ -16,7 +16,7 @@ G_BEGIN_DECLS G_DECLARE_FINAL_TYPE (PhoshAudioDevices, phosh_audio_devices, PHOSH, AUDIO_DEVICES, GObject) -PhoshAudioDevices *phosh_audio_devices_new (GvcMixerControl *mixer, - gboolean is_input); +PhoshAudioDevices *phosh_audio_devices_new (gpointer mixer_control, + gboolean is_input); G_END_DECLS -- GitLab From 8f0cde0280d609bb1cb1deaa81aa5ed07808c576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 Jul 2024 19:31:43 +0200 Subject: [PATCH 3/5] head: Prefix struct name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Although this is nested it trips up gobject introspection in non obvious ways: src/dbus/phosh-gtk-mountoperation-dbus.h:287: Warning: Phosh: Unknown namespace for identifier 'pending' Signed-off-by: Guido Günther Part-of: --- src/monitor/head-priv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monitor/head-priv.h b/src/monitor/head-priv.h index 9d5983339..d116cdc33 100644 --- a/src/monitor/head-priv.h +++ b/src/monitor/head-priv.h @@ -51,7 +51,7 @@ struct _PhoshHead { PhoshHeadMode *mode; GPtrArray *modes; - struct pending { + struct PhoshHeadStatePending { int32_t x, y; enum wl_output_transform transform; PhoshHeadMode *mode; -- GitLab From f62cc77c4c62fbe0f6dfbb910927fe77dc1f35ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 Jul 2024 18:18:05 +0200 Subject: [PATCH 4/5] build: Make gir warnings fatal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Guido Günther Part-of: --- src/meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/src/meson.build b/src/meson.build index 07fb7cced..da7d46d83 100644 --- a/src/meson.build +++ b/src/meson.build @@ -474,6 +474,7 @@ if enable_introspection includes : ['Gcr-3', 'Gio-2.0', 'Gtk-3.0', 'GnomeDesktop-3.0', 'Handy-1', 'NM-1.0'], extra_args : phosh_gir_extra_args, dependencies : phosh_static_lib_dep, + fatal_warnings : true, ) endif -- GitLab From 1974334b047013ae491e56dcc96ead100c1d8471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Fri, 12 Jul 2024 18:19:38 +0200 Subject: [PATCH 5/5] ci: Avoid check-doc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It trips onto all kinds of things and fail on both introspection and gi-docgen warnings no. Signed-off-by: Guido Günther Part-of: --- .gitlab-ci.yml | 2 +- tools/check-doc | 15 --------------- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100755 tools/check-doc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 421534741..eeff37511 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -232,7 +232,7 @@ build-doc: - git clean -dfx - 'echo "Build opts: ${BUILD_OPTS}"' - meson setup ${BUILD_OPTS} _build - - tools/check-doc _build + - meson compile -C _build - mv _build/docs/phosh-0/ _reference/ artifacts: paths: diff --git a/tools/check-doc b/tools/check-doc deleted file mode 100755 index 33e02898c..000000000 --- a/tools/check-doc +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash -# -# Build docs and choke on gi-docgen warnings - -DIR="${1:-_build}" -LOG="${DIR}/docs/doc-build.log" - -meson compile -C "${DIR}" docs/phosh-doc |& tee "${LOG}" - -if grep -vE '('\ -'src/dbus/phosh-[a-z\-]+-dbus.h:[0-9]+: Warning: Phosh: Unknown namespace for identifier .pending.'\ -'|src/settings/audio-devices.h:[0-9]+: Warning: Phosh: phosh_audio_devices_new: argument mixer: Unresolved type: .GvcMixerControl'\ -')' "${LOG}" | grep -i 'warning:'; then - exit 1 -fi -- GitLab