[rhythmbox/wip/hadess/cleanups: 27/30] rhythmdb: Fix compile-time warning
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox/wip/hadess/cleanups: 27/30] rhythmdb: Fix compile-time warning
- Date: Wed, 3 Nov 2021 10:43:45 +0000 (UTC)
commit 0fc14a39fcaafa16b6acd2df3dcbf474088795cc
Author: Bastien Nocera <hadess hadess net>
Date: Wed Nov 3 11:35:15 2021 +0100
rhythmdb: Fix compile-time warning
rhythmbox/rhythmdb/rhythmdb-metadata-cache.c: In function ‘rhythmdb_metadata_cache_get’:
/usr/include/glib-2.0/gobject/gobject.h:528:28: warning: returning ‘GObject *’ {aka ‘struct _GObject *’}
from a function with incompatible return type ‘RhythmDBMetadataCache *’ {aka ‘struct _RhythmDBMetadataCache
*’} [-Wincompatible-pointer-types]
528 | #define g_object_ref(Obj) ((glib_typeof (Obj)) (g_object_ref) (Obj))
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rhythmbox/rhythmdb/rhythmdb-metadata-cache.c:133:24: note: in expansion of macro ‘g_object_ref’
133 | return g_object_ref (obj);
| ^~~~~~~~~~~~
rhythmdb/rhythmdb-metadata-cache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/rhythmdb/rhythmdb-metadata-cache.c b/rhythmdb/rhythmdb-metadata-cache.c
index bc382e33f..e41226770 100644
--- a/rhythmdb/rhythmdb-metadata-cache.c
+++ b/rhythmdb/rhythmdb-metadata-cache.c
@@ -130,7 +130,7 @@ rhythmdb_metadata_cache_get (RhythmDB *db, const char *name)
obj = g_hash_table_lookup (instances, name);
if (obj)
- return g_object_ref (obj);
+ return RHYTHMDB_METADATA_CACHE (g_object_ref (obj));
obj = g_object_new (RHYTHMDB_TYPE_METADATA_CACHE,
"db", db,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]