From patchwork Thu Sep 8 21:20:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 15405 Received: (qmail 62092 invoked by alias); 8 Sep 2016 21:20:42 -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 62078 invoked by uid 89); 8 Sep 2016 21:20:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=no version=3.3.2 spammy=*args, acknowledge, Close, Tromey X-HELO: gproxy4-pub.mail.unifiedlayer.com Received: from gproxy4-pub.mail.unifiedlayer.com (HELO gproxy4-pub.mail.unifiedlayer.com) (69.89.23.142) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Thu, 08 Sep 2016 21:20:30 +0000 Received: (qmail 27912 invoked by uid 0); 8 Sep 2016 21:20:29 -0000 Received: from unknown (HELO cmgw3) (10.0.90.84) by gproxy4.mail.unifiedlayer.com with SMTP; 8 Sep 2016 21:20:29 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw3 with id h9LQ1t0072f2jeq019LTw1; Thu, 08 Sep 2016 15:20:29 -0600 X-Authority-Analysis: v=2.1 cv=OdYLUHjY c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=ZGwHG3QwZOEA:10 a=GW1xBdLrtEIA:10 a=zstS-IiYAAAA:8 a=20KFwNOVAAAA:8 a=4uDqD4opyJuGDrEI1FAA:9 a=4G6NA9xxw8l3yy4pmD5M:22 a=e_O65bzb51kRm2y5VmPK:22 Received: from 75-171-200-200.hlrn.qwest.net ([75.171.200.200]:56188 helo=pokyo.Home) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1bi6kB-0000VL-PS; Thu, 08 Sep 2016 15:20:23 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Remove some unneeded casts from remote.c Date: Thu, 8 Sep 2016 15:20:16 -0600 Message-Id: <1473369616-30512-1-git-send-email-tom@tromey.com> X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 75.171.200.200 authed with tom+tromey.com} X-Exim-ID: 1bi6kB-0000VL-PS X-Source-Sender: 75-171-200-200.hlrn.qwest.net (pokyo.Home) [75.171.200.200]:56188 X-Source-Auth: tom+tromey.com X-Email-Count: 0 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== I happened to notice a few unneeded casts in remote.c. In some cases these are no-ops, and in others these cast away const, but in a context where this is not needed. I'm checking this in under the obvious rule. Tested by rebuilding on x86-64 Fedora 24. 2016-09-08 Tom Tromey * remote.c (remote_notif_stop_ack, remote_wait_as) (show_remote_cmd): Remove unneeded casts. --- gdb/ChangeLog | 5 +++++ gdb/remote.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 108528d..e7cc712 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-09-08 Tom Tromey + + * remote.c (remote_notif_stop_ack, remote_wait_as) + (show_remote_cmd): Remove unneeded casts. + 2016-09-06 Pedro Alves * top.c (wait_sync_command_done): Don't assume current_ui doesn't diff --git a/gdb/remote.c b/gdb/remote.c index 910ac81..13258b9e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6029,7 +6029,7 @@ remote_notif_stop_ack (struct notif_client *self, char *buf, struct stop_reply *stop_reply = (struct stop_reply *) event; /* acknowledge */ - putpkt ((char *) self->ack_command); + putpkt (self->ack_command); if (stop_reply->ws.kind == TARGET_WAITKIND_IGNORE) /* We got an unknown stop reply. */ @@ -6979,8 +6979,8 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options) rs->last_sent_signal = GDB_SIGNAL_0; target_terminal_inferior (); - strcpy ((char *) buf, rs->last_sent_step ? "s" : "c"); - putpkt ((char *) buf); + strcpy (buf, rs->last_sent_step ? "s" : "c"); + putpkt (buf); break; } /* else fallthrough */ @@ -13395,7 +13395,7 @@ show_remote_cmd (char *args, int from_tty) ui_out_field_string (uiout, "name", list->name); ui_out_text (uiout, ": "); if (list->type == show_cmd) - do_show_command ((char *) NULL, from_tty, list); + do_show_command (NULL, from_tty, list); else cmd_func (list, NULL, from_tty); /* Close the tuple. */