Renamed AOP_FLOAT_CST() to AOP_DOUBLE_CST().
authorJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 20 Oct 2010 18:38:06 +0000 (14:38 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Wed, 20 Oct 2010 18:38:06 +0000 (14:38 -0400)
That's actually what it was, and naming it with FLOAT was confusing.

src/aop-header.c
src/aop-weave.c
src/aop.h

index cbb4fdadef8e37855527e83b2cbf474097fd249d..27d82649ad77bbf4febacc6b0d67336e465fdd21 100644 (file)
@@ -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;
index f03df13e2862ab0ba32cb07efa45ad364cecea4e..6a423dbd92e9fdb08ed837a295e5c6e602913242 100644 (file)
@@ -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);
index 9522ee09b333a6b8f11e3cdc88ae4608ad0f429a..fb850f1b722e9566d59a47ea334ee52b3e0c365a 100644 (file)
--- 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 *).