From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20111 invoked by alias); 26 Oct 2015 03:49:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20086 invoked by uid 89); 26 Oct 2015 03:49:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL autolearn=no version=3.3.2 X-HELO: smtp.electronicbox.net Received: from smtp.electronicbox.net (HELO smtp.electronicbox.net) (96.127.255.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 26 Oct 2015 03:49:24 +0000 Received: from simark.lan. (cable-192.222.137.139.electronicbox.net [192.222.137.139]) by smtp.electronicbox.net (Postfix) with ESMTP id 02387440E89; Sun, 25 Oct 2015 23:49:23 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH c++ 11/12] target.c: Add a cast and change a type Date: Mon, 26 Oct 2015 10:23:00 -0000 Message-Id: <1445831362-18789-1-git-send-email-simon.marchi@polymtl.ca> X-SW-Source: 2015-10/txt/msg00541.txt.bz2 Fixes some errors in C++ build. gdb/ChangeLog: * target.c (memory_xfer_partial): Change type of buf to gdb_byte pointer. (simple_search_memory): Cast return of memmem. --- gdb/target.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/target.c b/gdb/target.c index b8b1e9b..d7653c4 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1235,7 +1235,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object, } else { - void *buf; + gdb_byte *buf; struct cleanup *old_chain; /* A large write request is likely to be partially satisfied @@ -1245,7 +1245,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object, subset of it. Cap writes to 4KB to mitigate this. */ len = min (4096, len); - buf = xmalloc (len); + buf = (gdb_byte *) xmalloc (len); old_chain = make_cleanup (xfree, buf); memcpy (buf, writebuf, len); @@ -2391,8 +2391,8 @@ simple_search_memory (struct target_ops *ops, gdb_byte *found_ptr; unsigned nr_search_bytes = min (search_space_len, search_buf_size); - found_ptr = memmem (search_buf, nr_search_bytes, - pattern, pattern_len); + found_ptr = (gdb_byte *) memmem (search_buf, nr_search_bytes, + pattern, pattern_len); if (found_ptr != NULL) { -- 2.6.2