qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: [Qemu-devel] [PULL 02/43] audio: fmopl: drop INLINE macro
Date: Mon, 23 Jun 2014 12:36:02 -0400	[thread overview]
Message-ID: <1403541403-16468-3-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1403541403-16468-1-git-send-email-lcapitulino@redhat.com>

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 <lcapitulino@redhat.com>
---
 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 <http://www.gnu.org/licenses/>.
  */
 
-#define INLINE		static inline
 #define HAS_YM3812	1
 
 #include <stdio.h>
@@ -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];
-- 
1.9.3

  parent reply	other threads:[~2014-06-23 16:37 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 16:36 [Qemu-devel] [PULL 00/43] QMP queue Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 01/43] fpu: softfloat: drop INLINE macro Luiz Capitulino
2014-06-23 16:36 ` Luiz Capitulino [this message]
2014-06-23 16:36 ` [Qemu-devel] [PULL 03/43] qapi: fix coding style in parameters list Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 04/43] qapi: add const prefix to 'char *' insider c_type() Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 05/43] qapi: Suppress unwanted space between type and identifier Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 06/43] json-lexer: fix escaped backslash in single-quoted string Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 07/43] os-posix: include sys/time.h Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 08/43] qapi: Add includes from qapi/ as dependencies Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 09/43] qapi: add event helper functions Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 10/43] qapi script: add event support Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 11/43] test: add test cases for qapi event Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 12/43] qapi: adjust existing defines Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 13/43] monitor: add an implemention of qapi event emit method Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 14/43] qapi: add new schema file qapi-event.json Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 15/43] qapi event: convert SHUTDOWN Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 16/43] qapi event: convert POWERDOWN Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 17/43] qapi event: convert RESET Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 18/43] qapi event: convert STOP Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 19/43] qapi event: convert RESUME Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 20/43] qapi event: convert SUSPEND Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 21/43] qapi event: convert SUSPEND_DISK Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 22/43] qapi event: convert WAKEUP Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 23/43] qapi event: convert RTC_CHANGE Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 24/43] qapi event: convert WATCHDOG Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 25/43] qapi event: convert DEVICE_DELETED Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 26/43] qapi event: convert DEVICE_TRAY_MOVED Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 27/43] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 28/43] qapi event: convert BLOCK_IMAGE_CORRUPTED Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 29/43] qapi event: convert other BLOCK_JOB events Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 30/43] qapi event: convert NIC_RX_FILTER_CHANGED Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 31/43] qapi event: convert VNC events Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 32/43] qapi event: convert SPICE events Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 33/43] qmp: convert ACPI_DEVICE_OST event Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 34/43] qapi event: convert BALLOON_CHANGE Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 35/43] qapi event: convert GUEST_PANICKED Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 36/43] qapi event: convert QUORUM events Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 37/43] qapi event: clean up Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 38/43] qemu-char: introduce qemu_chr_alloc Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 39/43] qemu-char: do not call chr_write directly Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 40/43] qemu-char: move pty_chr_update_read_handler around Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 41/43] qemu-char: make writes thread-safe Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 42/43] monitor: protect outbuf and mux_out with mutex Luiz Capitulino
2014-06-23 16:36 ` [Qemu-devel] [PULL 43/43] monitor: protect event emission Luiz Capitulino
2014-06-23 16:39 ` [Qemu-devel] [PULL 00/43] QMP queue Luiz Capitulino
2014-06-23 16:40   ` Paolo Bonzini
2014-06-23 17:15 ` Eric Blake
2014-06-24 13:15 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403541403-16468-3-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).