From patchwork Tue Jul 22 18:55:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 2138 Received: (qmail 25931 invoked by alias); 22 Jul 2014 18:55:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 25807 invoked by uid 89); 22 Jul 2014 18:55:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 22 Jul 2014 18:55:32 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6MItUPs027003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 22 Jul 2014 14:55:31 -0400 Received: from barimba.redhat.com (ovpn-113-154.phx2.redhat.com [10.3.113.154]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6MItMWV000387; Tue, 22 Jul 2014 14:55:30 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 06/13] constify remote.c Date: Tue, 22 Jul 2014 12:55:12 -0600 Message-Id: <1406055319-26380-7-git-send-email-tromey@redhat.com> In-Reply-To: <1406055319-26380-1-git-send-email-tromey@redhat.com> References: <1406055319-26380-1-git-send-email-tromey@redhat.com> This does some more constification in remote.c. 2014-07-22 Tom Tromey * remote.c (remote_serial_open, print_packet, putpkt) (putpkt_binary): Constify. * remote.h (putpkt): Update. --- gdb/ChangeLog | 6 ++++++ gdb/remote.c | 12 ++++++------ gdb/remote.h | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/gdb/remote.c b/gdb/remote.c index 29c03bc..972c0ff 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -164,7 +164,7 @@ static int hexnumnstr (char *, ULONGEST, int); static CORE_ADDR remote_address_masked (CORE_ADDR); -static void print_packet (char *); +static void print_packet (const char *); static void compare_sections_command (char *, int); @@ -176,7 +176,7 @@ static ptid_t remote_current_thread (ptid_t oldptid); static void remote_find_new_threads (void); -static int putpkt_binary (char *buf, int cnt); +static int putpkt_binary (const char *buf, int cnt); static void check_binary_download (CORE_ADDR addr); @@ -3727,7 +3727,7 @@ remote_check_symbols (void) } static struct serial * -remote_serial_open (char *name) +remote_serial_open (const char *name) { static int udp_warning = 0; @@ -7109,7 +7109,7 @@ escape_buffer (const char *buf, int n) string notation. */ static void -print_packet (char *buf) +print_packet (const char *buf) { puts_filtered ("\""); fputstr_filtered (buf, '"', gdb_stdout); @@ -7117,7 +7117,7 @@ print_packet (char *buf) } int -putpkt (char *buf) +putpkt (const char *buf) { return putpkt_binary (buf, strlen (buf)); } @@ -7129,7 +7129,7 @@ putpkt (char *buf) to print the sent packet as a string. */ static int -putpkt_binary (char *buf, int cnt) +putpkt_binary (const char *buf, int cnt) { struct remote_state *rs = get_remote_state (); int i; diff --git a/gdb/remote.h b/gdb/remote.h index 46b73d9..7006346 100644 --- a/gdb/remote.h +++ b/gdb/remote.h @@ -37,7 +37,7 @@ extern void getpkt (char **buf, long *sizeof_buf, int forever); we are debugging (remote_debug) and want to print the sent packet as a string. */ -extern int putpkt (char *buf); +extern int putpkt (const char *buf); void register_remote_g_packet_guess (struct gdbarch *gdbarch, int bytes, const struct target_desc *tdesc);