From f29d6c499b3cb268be07b6d83f5806c63d50be5e Mon Sep 17 00:00:00 2001 From: Justin Seyster Date: Wed, 2 Mar 2011 19:05:26 -0500 Subject: [PATCH] Updates documentation for subtype functions. --- src/aop-type.c | 77 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/src/aop-type.c b/src/aop-type.c index 6f9c35d..b510d2c 100644 --- a/src/aop-type.c +++ b/src/aop-type.c @@ -306,6 +306,23 @@ free_type_table () type_table = NULL; } +/* Returns true if specified type is an "all signed" or "all unsigned" + type. */ +bool +is_all_integer_type (const struct aop_type *type) +{ + return ((type->kind == ATK_SIGNED_INT || type->kind == ATK_UNSIGNED_INT) + && type->pointer_levels == 0 && type->size <= 0); +} + +/* Returns true if specified type is an "all fp" type. */ +bool +is_all_fp_type (const struct aop_type *type) +{ + return ((type->kind == ATK_FP) && type->pointer_levels == 0 + && type->size <= 0); +} + /** * \defgroup type InterAspect Types * \{ @@ -675,7 +692,7 @@ aop_t_pointer_to (const struct aop_type *type) * true if and only if the specified type matches a subset of types * that aop_t_all_pointer() matches. * \param type The type to check. - * \param Non-zero if the #aop_type object matches a pointer type, + * \return Non-zero if the #aop_type object matches a pointer type, * zero otherwise. */ int @@ -716,22 +733,13 @@ const struct aop_type *aop_get_dynval_type (struct aop_dynval *dv) return dv->type; } -/* Close Doxygen defgroup block. */ /** - * \} + * Check if an #aop_type object matches one of the types that + * aop_t_all_signed() matches. + * \param type The type to check. + * \return Non-zero if the #aop_type object is standard-sized signed + * integer type. */ - -/* Returns true if specified type is an "all signed" or "all unsigned" - type. */ -bool -is_all_integer_type (const struct aop_type *type) -{ - return ((type->kind == ATK_SIGNED_INT || type->kind == ATK_UNSIGNED_INT) - && type->pointer_levels == 0 && type->size <= 0); -} - -/* Returns true if the specified type is a "signed integer" which is - NOT 128 bits integer */ int aop_is_all_signed_subtype (const struct aop_type *type) { @@ -739,8 +747,13 @@ aop_is_all_signed_subtype (const struct aop_type *type) && type->pointer_levels == 0 && type->size <= 8); } -/* Returns true if the specified type is a "unsigned integer" which is - NOT 128 bits integer */ +/** + * Check if an #aop_type object matches one of the types that + * aop_t_all_unsigned() matches. + * \param type The type to check. + * \return Non-zero if the #aop_type object is standard-sized unsigned + * integer type. + */ int aop_is_all_unsigned_subtype (const struct aop_type *type) { @@ -753,8 +766,8 @@ aop_is_all_unsigned_subtype (const struct aop_type *type) * if it were matched and captured using the aop_t_all_signed() type. * * Only use this function on dynvals whose type passes - * aop_is_all_signed_subtype(). Casting a non-signed sub type with - * this function will raise a fatal compiler error. + * aop_is_all_signed_subtype(). Casting any other type with this + * function will raise a fatal compiler error. * \param dv The #aop_dynval to cast. */ void @@ -772,8 +785,8 @@ aop_cast_to_all_signed(struct aop_dynval *dv) * type. * * Only use this function on dynvals whose type passes - * aop_is_all_unsigned_subtype(). Casting a non-unsigned sub type - * with this function will raise a fatal compiler error. + * aop_is_all_unsigned_subtype(). Casting any other type with this + * function will raise a fatal compiler error. * \param dv The #aop_dynval to cast. */ void @@ -785,16 +798,13 @@ aop_cast_to_all_unsigned(struct aop_dynval *dv) dv->type = aop_t_all_unsigned(); } -/* Returns true if specified type is an "all fp" type. */ -bool -is_all_fp_type (const struct aop_type *type) -{ - return ((type->kind == ATK_FP) && type->pointer_levels == 0 - && type->size <= 0); -} - -/* Returns true if the specified type is a "float" which is NOT 128 - bits float */ +/** + * Check if an #aop_type object matches one of the types that + * aop_t_all_fp() matches. + * \param type The type to check. + * \return Non-zero if the #aop_type object is standard-sized signed + * floating point type. + */ int aop_is_all_fp_subtype (const struct aop_type *type) { @@ -820,6 +830,11 @@ aop_cast_to_all_fp(struct aop_dynval *dv) dv->type = aop_t_all_fp(); } +/* Close Doxygen defgroup block. */ +/** + * \} + */ + /* Given a type node, get that type node's identifier. */ static tree get_type_identifier (tree gcc_type) -- 2.34.1