aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli/cli-utils.c')
-rw-r--r--gdb/cli/cli-utils.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c
index 8eac7c4..d5273b5 100644
--- a/gdb/cli/cli-utils.c
+++ b/gdb/cli/cli-utils.c
@@ -93,7 +93,7 @@ get_number_trailer (const char **pp, int trailer)
++p;
retval = 0;
}
- p = skip_spaces_const (p);
+ p = skip_spaces (p);
*pp = p;
return retval;
}
@@ -101,7 +101,7 @@ get_number_trailer (const char **pp, int trailer)
/* See documentation in cli-utils.h. */
int
-get_number_const (const char **pp)
+get_number (const char **pp)
{
return get_number_trailer (pp, '\0');
}
@@ -172,8 +172,8 @@ number_or_range_parser::get_number ()
and also remember the end of the final token. */
temp = &m_end_ptr;
- m_end_ptr = skip_spaces_const (m_cur_tok + 1);
- m_end_value = get_number_const (temp);
+ m_end_ptr = skip_spaces (m_cur_tok + 1);
+ m_end_value = ::get_number (temp);
if (m_end_value < m_last_retval)
{
error (_("inverted range"));
@@ -249,38 +249,38 @@ remove_trailing_whitespace (const char *start, const char *s)
/* See documentation in cli-utils.h. */
-char *
-extract_arg_const (const char **arg)
+std::string
+extract_arg (const char **arg)
{
const char *result;
if (!*arg)
- return NULL;
+ return std::string ();
/* Find the start of the argument. */
- *arg = skip_spaces_const (*arg);
+ *arg = skip_spaces (*arg);
if (!**arg)
- return NULL;
+ return std::string ();
result = *arg;
/* Find the end of the argument. */
- *arg = skip_to_space_const (*arg + 1);
+ *arg = skip_to_space (*arg + 1);
if (result == *arg)
- return NULL;
+ return std::string ();
- return savestring (result, *arg - result);
+ return std::string (result, *arg - result);
}
/* See documentation in cli-utils.h. */
-char *
+std::string
extract_arg (char **arg)
{
const char *arg_const = *arg;
- char *result;
+ std::string result;
- result = extract_arg_const (&arg_const);
+ result = extract_arg (&arg_const);
*arg += arg_const - *arg;
return result;
}