Constify strings in tracepoint.c, lookup_cmd and the completers.
[deliverable/binutils-gdb.git] / gdb / parse.c
index 4c84b2bc7afab00ee09fc03a2a879babca6f791a..095d63d15b2e6a9cfae42465e4fa31361e7a3464 100644 (file)
@@ -120,9 +120,12 @@ static void free_funcalls (void *ignore);
 static int prefixify_subexp (struct expression *, struct expression *, int,
                             int);
 
-static struct expression *parse_exp_in_context (char **, CORE_ADDR,
+static struct expression *parse_exp_in_context (const char **, CORE_ADDR,
                                                const struct block *, int, 
                                                int, int *);
+static struct expression *parse_exp_in_context_1 (char **, CORE_ADDR,
+                                                 const struct block *, int,
+                                                 int, int *);
 
 void _initialize_parse (void);
 
@@ -1127,13 +1130,22 @@ prefixify_subexp (struct expression *inexpr,
 struct expression *
 parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block,
             int comma)
+{
+  return parse_exp_in_context (stringptr, pc, block, comma, 0, NULL);
+}
+
+static struct expression *
+parse_exp_in_context (const char **stringptr, CORE_ADDR pc,
+                     const struct block *block,
+                     int comma, int void_context_p, int *out_subexp)
 {
   struct expression *expr;
   char *const_hack = *stringptr ? xstrdup (*stringptr) : NULL;
   char *orig = const_hack;
   struct cleanup *back_to = make_cleanup (xfree, const_hack);
 
-  expr = parse_exp_in_context (&const_hack, pc, block, comma, 0, NULL);
+  expr = parse_exp_in_context_1 (&const_hack, pc, block, comma,
+                                void_context_p, out_subexp);
   (*stringptr) += const_hack - orig;
   do_cleanups (back_to);
   return expr;
@@ -1147,8 +1159,9 @@ parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block,
    is left untouched.  */
 
 static struct expression *
-parse_exp_in_context (char **stringptr, CORE_ADDR pc, const struct block *block,
-                     int comma, int void_context_p, int *out_subexp)
+parse_exp_in_context_1 (char **stringptr, CORE_ADDR pc,
+                       const struct block *block,
+                       int comma, int void_context_p, int *out_subexp)
 {
   volatile struct gdb_exception except;
   struct cleanup *old_chain, *inner_chain;
@@ -1291,7 +1304,7 @@ parse_expression (const char *string)
    *NAME must be freed by the caller.  */
 
 struct type *
-parse_expression_for_completion (char *string, char **name,
+parse_expression_for_completion (const char *string, char **name,
                                 enum type_code *code)
 {
   struct expression *exp = NULL;
This page took 0.033928 seconds and 4 git commands to generate.