Skip to content

Commit

Permalink
Fix type mismatch (fixes #60).
Browse files Browse the repository at this point in the history
  • Loading branch information
rhx committed Dec 24, 2023
1 parent 87c1127 commit a1957f8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Sources/GObjectCHelpers/gobject_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

/// Get the type of a `GObject` instance.
/// @param gobject the object to get the type for
GTypeClass *glibobject_get_instance_type(GObject * const gobject)
/// @return the type of the object
GType glibobject_get_instance_type(GObject * const gobject)
{
return G_TYPE_FROM_INSTANCE(gobject);
}


/// Return whether the given receiver is a `GObject`.
/// @param gobject pointer to test
gboolean glibobject_is_object(GObject * const gobject)
/// Get the type class of a `GObject` instance.
/// @param gobject the object to get the type for
/// @return the type class of the object
GTypeClass *glibobject_get_class(GObject * const gobject)
{
return G_IS_OBJECT(gobject);
return G_OBJECT_GET_CLASS(gobject);
}


Expand Down
8 changes: 7 additions & 1 deletion Sources/GObjectCHelpers/include/gobject_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@

/// Get the type of a `GObject` instance.
/// @param gobject the object to get the type for
GTypeClass *glibobject_get_instance_type(GObject * const gobject) __attribute__((nonnull)) __attribute__((returns_nonnull));
/// @return the type of the object
GType glibobject_get_instance_type(GObject * const gobject) __attribute__((nonnull));

/// Get the type class of a `GObject` instance.
/// @param gobject the object to get the type for
/// @return the type class of the object
GTypeClass *glibobject_get_class(GObject * const gobject) __attribute__((nonnull)) __attribute__((returns_nonnull));

/// Return whether the given receiver is a `GObject`.
/// @param gobject pointer to test
Expand Down

0 comments on commit a1957f8

Please sign in to comment.