diff options
Diffstat (limited to 'src/analysis/type-int.h')
-rw-r--r-- | src/analysis/type-int.h | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/src/analysis/type-int.h b/src/analysis/type-int.h index 6c77954..8999b19 100644 --- a/src/analysis/type-int.h +++ b/src/analysis/type-int.h @@ -60,27 +60,34 @@ typedef bool (* type_is_reference_fc) (const GDataType *); /* Informations glissées dans la structure GObject de GBinSymbol */ -typedef union _type_obj_extra +typedef struct _type_extra_data_t { - struct - { - TypeQualifier qualifiers; /* Eventuels qualificatifs */ - char ns_sep[2]; /* Séparateur d'éléments */ - TypeFlag flags; /* Propriétés du type */ + char ns_sep[2]; /* Séparateur d'éléments */ + TypeFlag flags; /* Propriétés du type */ - }; + /** + * Afin de ne pas dépasser une taille de 31 bits, le champ de type + * TypeQualifier suivant est ramené à un champs de bits. + */ + + unsigned int qualifiers : 2; /* Eventuels qualificatifs */ + +} type_extra_data_t; + +/* Encapsulation avec un verrou d'accès */ +typedef union _type_obj_extra_t +{ + type_extra_data_t data; /* Données embarquées */ + lockable_obj_extra_t lockable; /* Gestion d'accès aux fanions */ - gint lock; /* Gestion d'accès aux fanions */ +} type_obj_extra_t; -} type_obj_extra; /* Description de type quelconque (instance) */ struct _GDataType { GObject parent; /* A laisser en premier */ - GDataType *namespace; /* Espace de noms / classe */ - #if __SIZEOF_INT__ == __SIZEOF_LONG__ /** @@ -90,29 +97,13 @@ struct _GDataType * ce dernier. */ - type_obj_extra extra; /* Externalisation embarquée */ + type_obj_extra_t extra; /* Externalisation embarquée */ #endif -}; - -/** - * Accès aux informations éventuellement déportées. - */ - -#if __SIZEOF_INT__ == __SIZEOF_LONG__ - -# define INIT_DATA_TYPE_EXTRA(tp) tp->extra.lock = 0 - -# define GET_DATA_TYPE_EXTRA(tp) &tp->extra - -#else - -# define INIT_DATA_TYPE_EXTRA(tp) INIT_GOBJECT_EXTRA(G_OBJECT(tp)) - -# define GET_DATA_TYPE_EXTRA(tp) GET_GOBJECT_EXTRA(G_OBJECT(tp), type_obj_extra) + GDataType *namespace; /* Espace de noms / classe */ -#endif +}; /* Description de type quelconque (classe) */ struct _GDataTypeClass @@ -133,5 +124,20 @@ struct _GDataTypeClass }; +/** + * Accès aux informations éventuellement déportées. + */ + +#if __SIZEOF_INT__ == __SIZEOF_LONG__ + +# define GET_DATA_TYPE_EXTRA(tp) (type_extra_data_t *)&tp->extra + +#else + +# define GET_DATA_TYPE_EXTRA(tp) GET_GOBJECT_EXTRA(G_OBJECT(tp), type_extra_data_t) + +#endif + + #endif /* _ANALYSIS_TYPE_INT_H */ |