Rename _const functions to use overloading instead
[deliverable/binutils-gdb.git] / gdb / findcmd.c
index 99cecb33348cd0a78d1c18fff894750c12e0fe6c..f905e701b33ffe0cac34869268fb258c5940e807 100644 (file)
@@ -1,6 +1,6 @@
 /* The find command.
 
-   Copyright (C) 2008-2015 Free Software Foundation, Inc.
+   Copyright (C) 2008-2017 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -24,6 +24,7 @@
 #include "value.h"
 #include "target.h"
 #include "cli/cli-utils.h"
+#include <algorithm>
 
 /* Copied from bfd_put_bits.  */
 
@@ -75,7 +76,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
   if (args == NULL)
     error (_("Missing search parameters."));
 
-  pattern_buf = xmalloc (pattern_buf_size);
+  pattern_buf = (gdb_byte *) xmalloc (pattern_buf_size);
   pattern_buf_end = pattern_buf;
   old_cleanups = make_cleanup (free_current_contents, &pattern_buf);
 
@@ -109,7 +110,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
            }
        }
 
-      s = skip_spaces_const (s);
+      s = skip_spaces (s);
     }
 
   /* Get the search range.  */
@@ -119,7 +120,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
 
   if (*s == ',')
     ++s;
-  s = skip_spaces_const (s);
+  s = skip_spaces (s);
 
   if (*s == '+')
     {
@@ -170,7 +171,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
       struct type *t;
       ULONGEST pattern_buf_size_need;
 
-      s = skip_spaces_const (s);
+      s = skip_spaces (s);
 
       v = parse_to_comma_and_eval (&s);
       t = value_type (v);
@@ -178,13 +179,14 @@ parse_find_args (char *args, ULONGEST *max_countp,
       /* Keep it simple and assume size == 'g' when watching for when we
         need to grow the pattern buf.  */
       pattern_buf_size_need = (pattern_buf_end - pattern_buf
-                              + max (TYPE_LENGTH (t), sizeof (int64_t)));
+                              + std::max (TYPE_LENGTH (t),
+                                          (unsigned) sizeof (int64_t)));
       if (pattern_buf_size_need > pattern_buf_size)
        {
          size_t current_offset = pattern_buf_end - pattern_buf;
 
          pattern_buf_size = pattern_buf_size_need * 2;
-         pattern_buf = xrealloc (pattern_buf, pattern_buf_size);
+         pattern_buf = (gdb_byte *) xrealloc (pattern_buf, pattern_buf_size);
          pattern_buf_end = pattern_buf + current_offset;
        }
 
@@ -218,7 +220,7 @@ parse_find_args (char *args, ULONGEST *max_countp,
 
       if (*s == ',')
        ++s;
-      s = skip_spaces_const (s);
+      s = skip_spaces (s);
     }
 
   if (pattern_buf_end == pattern_buf)
@@ -315,9 +317,6 @@ find_command (char *args, int from_tty)
   do_cleanups (old_cleanups);
 }
 
-/* Provide a prototype to silence -Wmissing-prototypes.  */
-extern initialize_file_ftype _initialize_mem_search;
-
 void
 _initialize_mem_search (void)
 {
This page took 0.025106 seconds and 4 git commands to generate.