Constify strings in tracepoint.c, lookup_cmd and the completers.
[platform/upstream/binutils.git] / gdb / eval.c
index 7d48d7e..58c9e15 100644 (file)
@@ -1,6 +1,6 @@
 /* Evaluate expressions for GDB.
 
-   Copyright (C) 1986-2003, 2005-2012 Free Software Foundation, Inc.
+   Copyright (C) 1986-2013 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -76,7 +76,7 @@ evaluate_subexp (struct type *expect_type, struct expression *exp,
    and return the result as a number.  */
 
 CORE_ADDR
-parse_and_eval_address (char *exp)
+parse_and_eval_address (const char *exp)
 {
   struct expression *expr = parse_expression (exp);
   CORE_ADDR addr;
@@ -104,7 +104,7 @@ parse_and_eval_long (char *exp)
 }
 
 struct value *
-parse_and_eval (char *exp)
+parse_and_eval (const char *exp)
 {
   struct expression *expr = parse_expression (exp);
   struct value *val;
@@ -121,7 +121,7 @@ parse_and_eval (char *exp)
    EXPP is advanced to point to the comma.  */
 
 struct value *
-parse_to_comma_and_eval (char **expp)
+parse_to_comma_and_eval (const char **expp)
 {
   struct expression *expr = parse_exp_1 (expp, 0, (struct block *) 0, 1);
   struct value *val;
@@ -1590,7 +1590,6 @@ evaluate_subexp_standard (struct type *expect_type,
 
           find_overload_match (&argvec[1], nargs, func_name,
                                NON_METHOD, /* not method */
-                              0,          /* strict match */
                                NULL, NULL, /* pass NULL symbol since
                                              symbol is unknown */
                                NULL, &symp, NULL, 0);
@@ -1626,7 +1625,6 @@ evaluate_subexp_standard (struct type *expect_type,
 
              (void) find_overload_match (&argvec[1], nargs, tstr,
                                          METHOD, /* method */
-                                         0,      /* strict match */
                                          &arg2,  /* the object */
                                          NULL, &valp, NULL,
                                          &static_memfuncp, 0);
@@ -1698,7 +1696,6 @@ evaluate_subexp_standard (struct type *expect_type,
              (void) find_overload_match (&argvec[1], nargs,
                                          NULL,        /* no need for name */
                                          NON_METHOD,  /* not method */
-                                         0,           /* strict match */
                                          NULL, function, /* the function */
                                          NULL, &symp, NULL, no_adl);
 
@@ -2932,12 +2929,12 @@ evaluate_subexp_for_address (struct expression *exp, int *pos,
        {
          struct type *type = check_typedef (value_type (x));
 
-         if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
-           return value_zero (lookup_pointer_type (value_type (x)),
-                              not_lval);
-         else if (TYPE_CODE (type) == TYPE_CODE_REF)
+         if (TYPE_CODE (type) == TYPE_CODE_REF)
            return value_zero (lookup_pointer_type (TYPE_TARGET_TYPE (type)),
                               not_lval);
+         else if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
+           return value_zero (lookup_pointer_type (value_type (x)),
+                              not_lval);
          else
            error (_("Attempt to take address of "
                     "value not located in memory."));