From patchwork Thu Jun 11 11:23:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 7111 X-Patchwork-Delegate: vapier@gentoo.org Received: (qmail 42921 invoked by alias); 11 Jun 2015 11:23:19 -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 42912 invoked by uid 89); 11 Jun 2015 11:23:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org Received: from smtp.gentoo.org (HELO smtp.gentoo.org) (140.211.166.183) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 11 Jun 2015 11:23:18 +0000 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 2180A340B98 for ; Thu, 11 Jun 2015 11:23:16 +0000 (UTC) From: Mike Frysinger To: gdb-patches@sourceware.org Subject: [PATCH] sim: mn10300: use common size types Date: Thu, 11 Jun 2015 07:23:13 -0400 Message-Id: <1434021793-4479-1-git-send-email-vapier@gentoo.org> X-IsSubscribed: yes No point in open coding this logic here when we have common size types already that give the right answer. Committed. --- sim/mn10300/ChangeLog | 6 ++++++ sim/mn10300/mn10300_sim.h | 35 ++++++----------------------------- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog index af49458..1facba7 100644 --- a/sim/mn10300/ChangeLog +++ b/sim/mn10300/ChangeLog @@ -1,5 +1,11 @@ 2015-06-11 Mike Frysinger + * mn10300_sim.h (uint8, int8, uint16, int16, uint32, int32): Typedef + in terms of unsigned8, signed8, unsigned16, signed16, unsigned32, + and signed32 respectively. + +2015-06-11 Mike Frysinger + * interp.c (INLINE): Delete define. * mn10300_sim.h (INLINE): Likewise. diff --git a/sim/mn10300/mn10300_sim.h b/sim/mn10300/mn10300_sim.h index 9f0076a..5f5d5d1 100644 --- a/sim/mn10300/mn10300_sim.h +++ b/sim/mn10300/mn10300_sim.h @@ -16,35 +16,12 @@ extern SIM_DESC simulator; extern int mn10300_debug; -#if UCHAR_MAX == 255 -typedef unsigned char uint8; -typedef signed char int8; -#else -#error "Char is not an 8-bit type" -#endif - -#if SHRT_MAX == 32767 -typedef unsigned short uint16; -typedef signed short int16; -#else -#error "Short is not a 16-bit type" -#endif - -#if INT_MAX == 2147483647 - -typedef unsigned int uint32; -typedef signed int int32; - -#else -# if LONG_MAX == 2147483647 - -typedef unsigned long uint32; -typedef signed long int32; - -# else -# error "Neither int nor long is a 32-bit type" -# endif -#endif +typedef unsigned8 uint8; +typedef signed8 int8; +typedef unsigned16 uint16; +typedef signed16 int16; +typedef unsigned32 uint32; +typedef signed32 int32; typedef struct {