From f18c6e7bd1e572cb2df7e66de18fa2741907831d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 27 May 2021 09:15:29 +0200 Subject: [PATCH] core: forward declare nm_settings_plugin_get_type() at file scope in "nm-settings-storage.h" lgtm.com warns about function declarations inside blocks. *sigh*. I think it's well understood what this code means, and it is not done by accident. Still, let's make the tool happy in this case. --- src/core/settings/nm-settings-storage.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/settings/nm-settings-storage.h b/src/core/settings/nm-settings-storage.h index 970cfd771..37bf12d2a 100644 --- a/src/core/settings/nm-settings-storage.h +++ b/src/core/settings/nm-settings-storage.h @@ -48,11 +48,12 @@ GType nm_settings_storage_get_type(void); NMSettingsStorage * nm_settings_storage_new(struct _NMSettingsPlugin *plugin, const char *uuid, const char *filename); +/* forward declare so we don't have to include "nm-settings-plugin.h" here. */ +GType nm_settings_plugin_get_type(void); + static inline struct _NMSettingsPlugin * nm_settings_storage_get_plugin(const NMSettingsStorage *self) { - GType nm_settings_plugin_get_type(void); - g_return_val_if_fail(NM_IS_SETTINGS_STORAGE(self), NULL); nm_assert(G_TYPE_CHECK_INSTANCE_TYPE(self->_plugin, nm_settings_plugin_get_type()));