From: Justin Seyster Date: Wed, 20 Oct 2010 18:38:06 +0000 (-0400) Subject: Renamed AOP_FLOAT_CST() to AOP_DOUBLE_CST(). X-Git-Tag: release-v1.0~35 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=f2ef55cf69932e2935ecd9ba61ca1053ea5d1a20;p=interaspect.git Renamed AOP_FLOAT_CST() to AOP_DOUBLE_CST(). That's actually what it was, and naming it with FLOAT was confusing. --- diff --git a/src/aop-header.c b/src/aop-header.c index cbb4fda..27d8264 100644 --- a/src/aop-header.c +++ b/src/aop-header.c @@ -173,7 +173,7 @@ get_param_types (va_list argp, int num_params, va_arg (argp, int); param_types[i] = aop_t_all_signed (); break; - case ATA_FLOAT_CST: + case ATA_DOUBLE_CST: va_arg (argp, double); param_types[i] = aop_t_all_fp (); break; diff --git a/src/aop-weave.c b/src/aop-weave.c index f03df13..6a423db 100644 --- a/src/aop-weave.c +++ b/src/aop-weave.c @@ -282,7 +282,7 @@ build_gcc_call (const char *func_name, tree return_type, new_arg = build_int_cst (integer_type_node, int_cst); VEC_safe_push (tree, heap, arg_list, new_arg); break; - case ATA_FLOAT_CST: + case ATA_DOUBLE_CST: float_cst = va_arg (argp, double); snprintf (float_buf, sizeof (float_buf), "%A", float_cst); real_from_string (&r, (const char *)float_buf); diff --git a/src/aop.h b/src/aop.h index 9522ee0..fb850f1 100644 --- a/src/aop.h +++ b/src/aop.h @@ -213,7 +213,7 @@ extern void aop_abort (const char *filename, int lineno, const char *function) enum aop_argkind { ATA_STR_CST, ATA_INT_CST, - ATA_FLOAT_CST, + ATA_DOUBLE_CST, ATA_VOIDP_CST, ATA_DYNVAL, AOP_TERM_ARG, @@ -237,12 +237,16 @@ enum aop_argkind { #define AOP_INT_CST(VAL) ATA_INT_CST, VAL /** - * \brief Mark an advice argument as a float constant (float) + * \brief Mark an advice argument as a floating-point constant + * (double). * - * Use this macro when passing a float constant (float) - * argument to aop_insert_advice(). + * Use this macro when passing a floating-point constant (double) + * argument to aop_insert_advice(). Make sure the argument actually + * has type double. The preprocessor cannot type check this input, + * and an input with the wrong type (such as float) can cause a memory + * error. */ -#define AOP_FLOAT_CST(VAL) ATA_FLOAT_CST, VAL +#define AOP_DOUBLE_CST(VAL) ATA_DOUBLE_CST, VAL /** * \brief Mark an advice argument as an void pointer constant (void *).