From patchwork Mon Jun 23 16:36:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 363024 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EE5AE14008B for ; Tue, 24 Jun 2014 02:38:17 +1000 (EST) Received: from localhost ([::1]:54786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz7G4-0005VM-4k for incoming@patchwork.ozlabs.org; Mon, 23 Jun 2014 12:38:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz7Ev-0003M5-37 for qemu-devel@nongnu.org; Mon, 23 Jun 2014 12:37:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wz7El-0003sh-PO for qemu-devel@nongnu.org; Mon, 23 Jun 2014 12:37:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18691) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wz7El-0003sa-Hg for qemu-devel@nongnu.org; Mon, 23 Jun 2014 12:36:55 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5NGanaS031721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 23 Jun 2014 12:36:49 -0400 Received: from localhost (ovpn-113-42.phx2.redhat.com [10.3.113.42]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5NGamwa004298; Mon, 23 Jun 2014 12:36:49 -0400 From: Luiz Capitulino To: peter.maydell@linaro.org Date: Mon, 23 Jun 2014 12:36:02 -0400 Message-Id: <1403541403-16468-3-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1403541403-16468-1-git-send-email-lcapitulino@redhat.com> References: <1403541403-16468-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws Subject: [Qemu-devel] [PULL 02/43] audio: fmopl: drop INLINE macro X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This commit expands all uses of the INLINE macro and drop it. The reason for this is to avoid clashes with external libraries with bad name conventions and also because renaming keywords is not a good practice. Signed-off-by: Luiz Capitulino --- hw/audio/fmopl.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 290a224..adcef2d 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -30,7 +30,6 @@ * License along with this library; if not, see . */ -#define INLINE static inline #define HAS_YM3812 1 #include @@ -247,7 +246,7 @@ static INT32 feedback2; /* connect for SLOT 2 */ /* --------------------- subroutines --------------------- */ -INLINE int Limit( int val, int max, int min ) { +static inline int Limit( int val, int max, int min ) { if ( val > max ) val = max; else if ( val < min ) @@ -257,7 +256,7 @@ INLINE int Limit( int val, int max, int min ) { } /* status set and IRQ handling */ -INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag) +static inline void OPL_STATUS_SET(FM_OPL *OPL,int flag) { /* set status flag */ OPL->status |= flag; @@ -273,7 +272,7 @@ INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag) } /* status reset and IRQ handling */ -INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag) +static inline void OPL_STATUS_RESET(FM_OPL *OPL,int flag) { /* reset status flag */ OPL->status &=~flag; @@ -289,7 +288,7 @@ INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag) } /* IRQ mask set */ -INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) +static inline void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) { OPL->statusmask = flag; /* IRQ handling check */ @@ -298,7 +297,7 @@ INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag) } /* ----- key on ----- */ -INLINE void OPL_KEYON(OPL_SLOT *SLOT) +static inline void OPL_KEYON(OPL_SLOT *SLOT) { /* sin wave restart */ SLOT->Cnt = 0; @@ -309,7 +308,7 @@ INLINE void OPL_KEYON(OPL_SLOT *SLOT) SLOT->eve = EG_AED; } /* ----- key off ----- */ -INLINE void OPL_KEYOFF(OPL_SLOT *SLOT) +static inline void OPL_KEYOFF(OPL_SLOT *SLOT) { if( SLOT->evm > ENV_MOD_RR) { @@ -325,7 +324,7 @@ INLINE void OPL_KEYOFF(OPL_SLOT *SLOT) /* ---------- calcrate Envelope Generator & Phase Generator ---------- */ /* return : envelope output */ -INLINE UINT32 OPL_CALC_SLOT( OPL_SLOT *SLOT ) +static inline UINT32 OPL_CALC_SLOT( OPL_SLOT *SLOT ) { /* calcrate envelope generator */ if( (SLOT->evc+=SLOT->evs) >= SLOT->eve ) @@ -371,7 +370,7 @@ static void set_algorithm( OPL_CH *CH) } /* ---------- frequency counter for operater update ---------- */ -INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) +static inline void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) { int ksr; @@ -391,7 +390,7 @@ INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT) } /* set multi,am,vib,EG-TYP,KSR,mul */ -INLINE void set_mul(FM_OPL *OPL,int slot,int v) +static inline void set_mul(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -405,7 +404,7 @@ INLINE void set_mul(FM_OPL *OPL,int slot,int v) } /* set ksl & tl */ -INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v) +static inline void set_ksl_tl(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -421,7 +420,7 @@ INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v) } /* set attack rate & decay rate */ -INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v) +static inline void set_ar_dr(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -438,7 +437,7 @@ INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v) } /* set sustain level & release rate */ -INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v) +static inline void set_sl_rr(FM_OPL *OPL,int slot,int v) { OPL_CH *CH = &OPL->P_CH[slot/2]; OPL_SLOT *SLOT = &CH->SLOT[slot&1]; @@ -455,7 +454,7 @@ INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v) /* operator output calcrator */ #define OP_OUT(slot,env,con) slot->wavetable[((slot->Cnt+con)/(0x1000000/SIN_ENT))&(SIN_ENT-1)][env] /* ---------- calcrate one of channel ---------- */ -INLINE void OPL_CALC_CH( OPL_CH *CH ) +static inline void OPL_CALC_CH( OPL_CH *CH ) { UINT32 env_out; OPL_SLOT *SLOT; @@ -500,7 +499,7 @@ INLINE void OPL_CALC_CH( OPL_CH *CH ) /* ---------- calcrate rhythm block ---------- */ #define WHITE_NOISE_db 6.0 -INLINE void OPL_CALC_RH( OPL_CH *CH ) +static inline void OPL_CALC_RH( OPL_CH *CH ) { UINT32 env_tam,env_sd,env_top,env_hh; int whitenoise = (rand()&1)*(WHITE_NOISE_db/EG_STEP); @@ -716,7 +715,7 @@ static void OPLCloseTable( void ) } /* CSM Key Control */ -INLINE void CSMKeyControll(OPL_CH *CH) +static inline void CSMKeyControll(OPL_CH *CH) { OPL_SLOT *slot1 = &CH->SLOT[SLOT1]; OPL_SLOT *slot2 = &CH->SLOT[SLOT2];