+2017-09-27 Tom Tromey <tom@tromey.com>
+
+ * btrace.c (get_uint, get_context_size, no_chunk)
+ (maint_btrace_packet_history_cmd)
+ (maint_btrace_clear_packet_history_cmd, maint_btrace_clear_cmd)
+ (maint_info_btrace_cmd): Constify.
+
2017-09-27 Tom Tromey <tom@tromey.com>
* reverse.c (delete_bookmark_command): Constify.
/* Read a number from an argument string. */
static unsigned int
-get_uint (char **arg)
+get_uint (const char **arg)
{
- char *begin, *end, *pos;
+ const char *begin, *pos;
+ char *end;
unsigned long number;
begin = *arg;
/* Read a context size from an argument string. */
static int
-get_context_size (char **arg)
+get_context_size (const char **arg)
{
- char *pos;
- int number;
-
- pos = skip_spaces (*arg);
+ const char *pos = skip_spaces (*arg);
if (!isdigit (*pos))
error (_("Expected positive number, got: %s."), pos);
- return strtol (pos, arg, 10);
+ char *end;
+ long result = strtol (pos, &end, 10);
+ *arg = end;
+ return result;
}
/* Complain about junk at the end of an argument string. */
static void
-no_chunk (char *arg)
+no_chunk (const char *arg)
{
if (*arg != 0)
error (_("Junk after argument: %s."), arg);
/* The "maintenance btrace packet-history" command. */
static void
-maint_btrace_packet_history_cmd (char *arg, int from_tty)
+maint_btrace_packet_history_cmd (const char *arg, int from_tty)
{
struct btrace_thread_info *btinfo;
struct thread_info *tp;
/* The "maintenance btrace clear-packet-history" command. */
static void
-maint_btrace_clear_packet_history_cmd (char *args, int from_tty)
+maint_btrace_clear_packet_history_cmd (const char *args, int from_tty)
{
struct btrace_thread_info *btinfo;
struct thread_info *tp;
/* The "maintenance btrace clear" command. */
static void
-maint_btrace_clear_cmd (char *args, int from_tty)
+maint_btrace_clear_cmd (const char *args, int from_tty)
{
struct btrace_thread_info *btinfo;
struct thread_info *tp;
/* The "maintenance info btrace" command. */
static void
-maint_info_btrace_cmd (char *args, int from_tty)
+maint_info_btrace_cmd (const char *args, int from_tty)
{
struct btrace_thread_info *btinfo;
struct thread_info *tp;