This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA 49/67] Constify some commands in btrace.c
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Tom Tromey <tom at tromey dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 21 Sep 2017 07:02:44 +0000
- Subject: RE: [RFA 49/67] Constify some commands in btrace.c
- Authentication-results: sourceware.org; auth=none
- Dlp-product: dlpe-windows
- Dlp-reaction: no-action
- Dlp-version: 11.0.0.116
- References: <20170921051023.19023-1-tom@tromey.com> <20170921051023.19023-50-tom@tromey.com>
> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Tom Tromey
> Sent: Thursday, September 21, 2017 7:10 AM
> To: gdb-patches@sourceware.org
> Cc: Tom Tromey <tom@tromey.com>
> Subject: [RFA 49/67] Constify some commands in btrace.c
Hello Tom,
> ChangeLog
> 2017-09-20 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.
> ---
> gdb/ChangeLog | 7 +++++++
> gdb/btrace.c | 24 ++++++++++++++----------
> 2 files changed, 21 insertions(+), 10 deletions(-)
Looks good to me.
> @@ -3213,13 +3214,16 @@ get_context_size (char **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;
> }
The rest of the declarations are at the beginning. I'd prefer to keep it that way.
Thanks,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928