From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn3W-00080L-Pr for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:49:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qtn3Q-0006pr-Rm for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:49:42 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:35219) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtn3Q-0006n9-NF for qemu-devel@nongnu.org; Wed, 17 Aug 2011 16:49:36 -0400 Received: by yih10 with SMTP id 10so1232200yih.4 for ; Wed, 17 Aug 2011 13:49:21 -0700 (PDT) From: Bryce Lanham Date: Wed, 17 Aug 2011 15:46:42 -0500 Message-Id: <1313614076-28878-38-git-send-email-blanham@gmail.com> In-Reply-To: <1313614076-28878-1-git-send-email-blanham@gmail.com> References: <1313614076-28878-1-git-send-email-blanham@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 037/111] Correct invalid use of "const void *" with "const uint8_t *" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Laurent Vivier From: Laurent Vivier When cpu-all.h is used with m68k-tester (an m68k testsuite), the header is compiled with g++ and reports the following errors: ../qemu-m68k/cpu-all.h: In function ‘int lduw_be_p(const void*)’: ../qemu-m68k/cpu-all.h:414: error: invalid conversion from ‘const void*’ to ‘const uint8_t*’ ../qemu-m68k/cpu-all.h: In function ‘int ldsw_be_p(const void*)’: ../qemu-m68k/cpu-all.h:429: error: invalid conversion from ‘const void*’ to ‘const uint8_t*’ This patch casts the variable to "const uint8_t*" Signed-off-by: Laurent Vivier --- bswap.h | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bswap.h b/bswap.h index f41bebe..13fd5cf 100644 --- a/bswap.h +++ b/bswap.h @@ -533,7 +533,7 @@ static inline int lduw_be_p(const void *ptr) : "m" (*(uint16_t *)ptr)); return val; #else - const uint8_t *b = ptr; + const uint8_t *b = (const uint8_t *)ptr; return ((b[0] << 8) | b[1]); #endif } @@ -548,7 +548,7 @@ static inline int ldsw_be_p(const void *ptr) : "m" (*(uint16_t *)ptr)); return (int16_t)val; #else - const uint8_t *b = ptr; + const uint8_t *b = (const uint8_t *)ptr; return (int16_t)((b[0] << 8) | b[1]); #endif } @@ -563,7 +563,7 @@ static inline int ldl_be_p(const void *ptr) : "m" (*(uint32_t *)ptr)); return val; #else - const uint8_t *b = ptr; + const uint8_t *b = (const uint8_t *)ptr; return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]; #endif } -- 1.7.2.3