From patchwork Fri Jul 8 09:47:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chung-Lin Tang X-Patchwork-Id: 13700 Received: (qmail 6608 invoked by alias); 8 Jul 2016 09:47:43 -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 5350 invoked by uid 89); 8 Jul 2016 09:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1187, H*r:ip*0.0.0.0, tang, H*r:0.0.0 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Jul 2016 09:47:32 +0000 Received: from svr-orw-fem-04.mgc.mentorg.com ([147.34.97.41]) by relay1.mentorg.com with esmtp id 1bLSNe-0003ZS-3c from ChungLin_Tang@mentor.com ; Fri, 08 Jul 2016 02:47:30 -0700 Received: from [0.0.0.0] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.3.224.2; Fri, 8 Jul 2016 02:47:29 -0700 From: Chung-Lin Tang Subject: [patch, nios2] Add type casts to nios2_fill/store_gregset To: , Yao Qi Message-ID: <4269377f-c882-f3c6-0d4d-e715fc3aca58@codesourcery.com> Date: Fri, 8 Jul 2016 17:47:26 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 X-IsSubscribed: yes Hi Yao, This fixes the nios2 gdbserver build; the C++ compiler was complaining about pointer type mismatches. Is this okay to commit? Thanks, Chung-Lin 2016-07-08 Chung-Lin Tang gdbserver/ * linux-nios2-low.c (nios2_fill_gregset): Add type cast to buf parameter. (nios2_store_gregset): Likewise. diff --git a/gdb/gdbserver/linux-nios2-low.c b/gdb/gdbserver/linux-nios2-low.c index ea0ded1..a32bc1a 100644 --- a/gdb/gdbserver/linux-nios2-low.c +++ b/gdb/gdbserver/linux-nios2-low.c @@ -183,7 +183,7 @@ nios2_supply_register (struct regcache *regcache, int regno, static void nios2_fill_gregset (struct regcache *regcache, void *buf) { - union nios2_register *regset = buf; + union nios2_register *regset = (union nios2_register *) buf; int i; for (i = 1; i < nios2_num_regs; i++) @@ -193,7 +193,7 @@ nios2_fill_gregset (struct regcache *regcache, void *buf) static void nios2_store_gregset (struct regcache *regcache, const void *buf) { - const union nios2_register *regset = buf; + const union nios2_register *regset = (union nios2_register *) buf; int i; for (i = 0; i < nios2_num_regs; i++)