API cleanups. remove g_type_check_flags(), provide g_type_test_flags() as

Tue Nov 13 22:16:41 2001  Tim Janik  <timj@gtk.org>

        * gtype.[hc]: API cleanups.
        remove g_type_check_flags(), provide g_type_test_flags() as
        a *private* function.
        s/g_type_check_is_a/g_type_check_class_is_a/, private function.
        s/g_type_instance_is_a/g_type_check_instance_is_a/, also private.
This commit is contained in:
Tim Janik 2001-11-13 21:49:13 +00:00 committed by Tim Janik
parent ac0b13e47f
commit d33e3d5331
4 changed files with 30 additions and 22 deletions

View File

@ -1,3 +1,11 @@
Tue Nov 13 22:16:41 2001 Tim Janik <timj@gtk.org>
* gtype.[hc]: API cleanups.
remove g_type_check_flags(), provide g_type_test_flags() as
a *private* function.
s/g_type_check_is_a/g_type_check_class_is_a/, private function.
s/g_type_instance_is_a/g_type_check_instance_is_a/, also private.
Tue Nov 13 20:02:47 2001 Tim Janik <timj@gtk.org> Tue Nov 13 20:02:47 2001 Tim Janik <timj@gtk.org>
* gparam.h: fix standard type macros. * gparam.h: fix standard type macros.

View File

@ -124,7 +124,7 @@ gboolean g_param_value_defaults (GParamSpec *pspec,
GValue *value); GValue *value);
gboolean g_param_value_validate (GParamSpec *pspec, gboolean g_param_value_validate (GParamSpec *pspec,
GValue *value); GValue *value);
gboolean g_param_value_convert (GParamSpec *dest_value_spec, gboolean g_param_value_convert (GParamSpec *pspec,
const GValue *src_value, const GValue *src_value,
GValue *dest_value, GValue *dest_value,
gboolean strict_validation); gboolean strict_validation);

View File

@ -2510,7 +2510,7 @@ g_type_query (GType type,
/* --- implementation details --- */ /* --- implementation details --- */
gboolean gboolean
g_type_check_flags (GType type, g_type_test_flags (GType type,
guint flags) guint flags)
{ {
TypeNode *node; TypeNode *node;
@ -2603,7 +2603,7 @@ g_type_fundamental_last (void)
} }
gboolean gboolean
g_type_instance_is_a (GTypeInstance *type_instance, g_type_check_instance_is_a (GTypeInstance *type_instance,
GType iface_type) GType iface_type)
{ {
TypeNode *node, *iface; TypeNode *node, *iface;
@ -2622,7 +2622,7 @@ g_type_instance_is_a (GTypeInstance *type_instance,
} }
gboolean gboolean
g_type_class_is_a (GTypeClass *type_class, g_type_check_class_is_a (GTypeClass *type_class,
GType is_a_type) GType is_a_type)
{ {
TypeNode *node, *iface; TypeNode *node, *iface;

View File

@ -104,12 +104,12 @@ typedef enum /*< skip >*/
#define G_TYPE_IS_FUNDAMENTAL(type) (G_TYPE_BRANCH_SEQNO (type) == 0) #define G_TYPE_IS_FUNDAMENTAL(type) (G_TYPE_BRANCH_SEQNO (type) == 0)
#define G_TYPE_IS_DERIVED(type) (G_TYPE_BRANCH_SEQNO (type) > 0) #define G_TYPE_IS_DERIVED(type) (G_TYPE_BRANCH_SEQNO (type) > 0)
#define G_TYPE_IS_INTERFACE(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE) #define G_TYPE_IS_INTERFACE(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_INTERFACE)
#define G_TYPE_IS_CLASSED(type) (g_type_check_flags ((type), G_TYPE_FLAG_CLASSED)) #define G_TYPE_IS_CLASSED(type) (g_type_test_flags ((type), G_TYPE_FLAG_CLASSED))
#define G_TYPE_IS_INSTANTIATABLE(type) (g_type_check_flags ((type), G_TYPE_FLAG_INSTANTIATABLE)) #define G_TYPE_IS_INSTANTIATABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_INSTANTIATABLE))
#define G_TYPE_IS_DERIVABLE(type) (g_type_check_flags ((type), G_TYPE_FLAG_DERIVABLE)) #define G_TYPE_IS_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DERIVABLE))
#define G_TYPE_IS_DEEP_DERIVABLE(type) (g_type_check_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE)) #define G_TYPE_IS_DEEP_DERIVABLE(type) (g_type_test_flags ((type), G_TYPE_FLAG_DEEP_DERIVABLE))
#define G_TYPE_IS_ABSTRACT(type) (g_type_check_flags ((type), G_TYPE_FLAG_ABSTRACT)) #define G_TYPE_IS_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_ABSTRACT))
#define G_TYPE_IS_VALUE_ABSTRACT(type) (g_type_check_flags ((type), G_TYPE_FLAG_VALUE_ABSTRACT)) #define G_TYPE_IS_VALUE_ABSTRACT(type) (g_type_test_flags ((type), G_TYPE_FLAG_VALUE_ABSTRACT))
#define G_TYPE_IS_PARAM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM) #define G_TYPE_IS_PARAM(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_PARAM)
#define G_TYPE_IS_VALUE_TYPE(type) (g_type_check_is_value_type (type)) #define G_TYPE_IS_VALUE_TYPE(type) (g_type_check_is_value_type (type))
#define G_TYPE_HAS_VALUE_TABLE(type) (g_type_value_table_peek (type) != NULL) #define G_TYPE_HAS_VALUE_TABLE(type) (g_type_value_table_peek (type) != NULL)
@ -329,8 +329,6 @@ GTypePlugin* g_type_interface_get_plugin (GType instance_type,
GType implementation_type); GType implementation_type);
GType g_type_fundamental_last (void); GType g_type_fundamental_last (void);
gboolean g_type_check_flags (GType type,
guint flags);
GTypeInstance* g_type_create_instance (GType type); GTypeInstance* g_type_create_instance (GType type);
void g_type_free_instance (GTypeInstance *instance); void g_type_free_instance (GTypeInstance *instance);
void g_type_add_class_cache_func (gpointer cache_data, void g_type_add_class_cache_func (gpointer cache_data,
@ -338,23 +336,25 @@ void g_type_add_class_cache_func (gpointer cache_data,
void g_type_remove_class_cache_func (gpointer cache_data, void g_type_remove_class_cache_func (gpointer cache_data,
GTypeClassCacheFunc cache_func); GTypeClassCacheFunc cache_func);
void g_type_class_unref_uncached (gpointer g_class); void g_type_class_unref_uncached (gpointer g_class);
GTypeValueTable* g_type_value_table_peek (GType type);
/*< private >*/ /*< private >*/
gboolean g_type_check_instance (GTypeInstance *instance); gboolean g_type_check_instance (GTypeInstance *instance);
GTypeInstance* g_type_check_instance_cast (GTypeInstance *instance, GTypeInstance* g_type_check_instance_cast (GTypeInstance *instance,
GType iface_type); GType iface_type);
gboolean g_type_instance_is_a (GTypeInstance *instance, gboolean g_type_check_instance_is_a (GTypeInstance *instance,
GType iface_type); GType iface_type);
GTypeClass* g_type_check_class_cast (GTypeClass *g_class, GTypeClass* g_type_check_class_cast (GTypeClass *g_class,
GType is_a_type); GType is_a_type);
gboolean g_type_class_is_a (GTypeClass *g_class, gboolean g_type_check_class_is_a (GTypeClass *g_class,
GType is_a_type); GType is_a_type);
gboolean g_type_check_is_value_type (GType type); gboolean g_type_check_is_value_type (GType type);
gboolean g_type_check_value (GValue *value); gboolean g_type_check_value (GValue *value);
gboolean g_type_check_value_holds (GValue *value, gboolean g_type_check_value_holds (GValue *value,
GType type); GType type);
GTypeValueTable* g_type_value_table_peek (GType type); gboolean g_type_test_flags (GType type,
guint flags);
/* --- debugging functions --- */ /* --- debugging functions --- */
@ -383,7 +383,7 @@ G_CONST_RETURN gchar* g_type_name_from_class (GTypeClass *g_class);
if (__inst && __inst->g_class && __inst->g_class->g_type == __t) \ if (__inst && __inst->g_class && __inst->g_class->g_type == __t) \
__r = TRUE; \ __r = TRUE; \
else \ else \
__r = g_type_instance_is_a (__inst, __t); \ __r = g_type_check_instance_is_a (__inst, __t); \
__r; \ __r; \
}) })
# define _G_TYPE_CCT(cp, gt) ({ \ # define _G_TYPE_CCT(cp, gt) ({ \
@ -391,12 +391,12 @@ G_CONST_RETURN gchar* g_type_name_from_class (GTypeClass *g_class);
if (__class && __class->g_type == __t) \ if (__class && __class->g_type == __t) \
__r = TRUE; \ __r = TRUE; \
else \ else \
__r = g_type_class_is_a (__class, __t); \ __r = g_type_check_class_is_a (__class, __t); \
__r; \ __r; \
}) })
#else /* !__GNUC__ */ #else /* !__GNUC__ */
# define _G_TYPE_CIT(ip, gt) (g_type_instance_is_a ((GTypeInstance*) ip, gt)) # define _G_TYPE_CIT(ip, gt) (g_type_check_instance_is_a ((GTypeInstance*) ip, gt))
# define _G_TYPE_CCT(cp, gt) (g_type_class_is_a ((GTypeClass*) cp, gt)) # define _G_TYPE_CCT(cp, gt) (g_type_check_class_is_a ((GTypeClass*) cp, gt))
#endif /* !__GNUC__ */ #endif /* !__GNUC__ */
#define G_TYPE_FLAG_RESERVED_ID_BIT (1 << 30) #define G_TYPE_FLAG_RESERVED_ID_BIT (1 << 30)
extern GTypeDebugFlags _g_type_debug_flags; extern GTypeDebugFlags _g_type_debug_flags;