All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h>
@ 2009-08-28 18:06 Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 1/6] audio: Nothing uses UINT16 Juan Quintela
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel

Remove pre C-ansi99 defines for integer types.

Later, Juan.

Juan Quintela (6):
  audio: Nothing uses UINT16
  audio: s/UINT8/uint8_t
  audio: s/UINT32/uint32_t
  audio: Nothing uses INT8
  audio: s/INT16/int16_t
  audio: s/INT32/int32_t

 hw/fmopl.c |   74 ++++++++++++++++++------------------
 hw/fmopl.h |  123 ++++++++++++++++++++++++++++--------------------------------
 2 files changed, 94 insertions(+), 103 deletions(-)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 1/6] audio: Nothing uses UINT16
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
@ 2009-08-28 18:06 ` Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 2/6] audio: s/UINT8/uint8_t Juan Quintela
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/fmopl.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/fmopl.h b/hw/fmopl.h
index a01ff90..12c78cb 100644
--- a/hw/fmopl.h
+++ b/hw/fmopl.h
@@ -14,7 +14,6 @@
 #ifndef OSD_CPU_H
 #define OSD_CPU_H
 typedef unsigned char	UINT8;   /* unsigned  8bit */
-typedef unsigned short	UINT16;  /* unsigned 16bit */
 typedef unsigned int	UINT32;  /* unsigned 32bit */
 typedef signed char		INT8;    /* signed  8bit   */
 typedef signed short	INT16;   /* signed 16bit   */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 2/6] audio: s/UINT8/uint8_t
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 1/6] audio: Nothing uses UINT16 Juan Quintela
@ 2009-08-28 18:06 ` Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 3/6] audio: s/UINT32/uint32_t Juan Quintela
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/fmopl.c |   10 +++++-----
 hw/fmopl.h |   43 ++++++++++++++++++++++---------------------
 2 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/hw/fmopl.c b/hw/fmopl.c
index d1161f8..dd8e6a4 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -791,8 +791,8 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
 			}
 			else
 			{	/* set IRQ mask ,timer enable*/
-				UINT8 st1 = v&1;
-				UINT8 st2 = (v>>1)&1;
+				uint8_t st1 = v&1;
+				uint8_t st2 = (v>>1)&1;
 				/* IRQRST,T1MSK,t2MSK,EOSMSK,BRMSK,x,ST2,ST1 */
 				OPL_STATUS_RESET(OPL,v&0x78);
 				OPL_STATUSMASK_SET(OPL,((~v)&0x78)|0x01);
@@ -891,7 +891,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
 		case 0xbd:
 			/* amsep,vibdep,r,bd,sd,tom,tc,hh */
 			{
-			UINT8 rkey = OPL->rythm^v;
+			uint8_t rkey = OPL->rythm^v;
 			OPL->ams_table = &AMS_TABLE[v&0x80 ? AMS_ENT : 0];
 			OPL->vib_table = &VIB_TABLE[v&0x40 ? VIB_ENT : 0];
 			OPL->rythm  = v&0x3f;
@@ -1045,7 +1045,7 @@ void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
 	OPLSAMPLE *buf = buffer;
 	UINT32 amsCnt  = OPL->amsCnt;
 	UINT32 vibCnt  = OPL->vibCnt;
-	UINT8 rythm = OPL->rythm&0x20;
+	uint8_t rythm = OPL->rythm&0x20;
 	OPL_CH *CH,*R_CH;

 	if( (void *)OPL != cur_chip ){
@@ -1106,7 +1106,7 @@ void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
 	OPLSAMPLE *buf = buffer;
 	UINT32 amsCnt  = OPL->amsCnt;
 	UINT32 vibCnt  = OPL->vibCnt;
-	UINT8 rythm = OPL->rythm&0x20;
+	uint8_t rythm = OPL->rythm&0x20;
 	OPL_CH *CH,*R_CH;
 	YM_DELTAT *DELTAT = OPL->deltat;

diff --git a/hw/fmopl.h b/hw/fmopl.h
index 12c78cb..f42c803 100644
--- a/hw/fmopl.h
+++ b/hw/fmopl.h
@@ -1,6 +1,8 @@
 #ifndef __FMOPL_H_
 #define __FMOPL_H_

+#include <stdint.h>
+
 /* --- select emulation chips --- */
 #define BUILD_YM3812 (HAS_YM3812)
 //#define BUILD_YM3526 (HAS_YM3526)
@@ -13,7 +15,6 @@
 /* compiler dependence */
 #ifndef OSD_CPU_H
 #define OSD_CPU_H
-typedef unsigned char	UINT8;   /* unsigned  8bit */
 typedef unsigned int	UINT32;  /* unsigned 32bit */
 typedef signed char		INT8;    /* signed  8bit   */
 typedef signed short	INT16;   /* signed 16bit   */
@@ -50,19 +51,19 @@ typedef unsigned char (*OPL_PORTHANDLER_R)(int param);
 typedef struct fm_opl_slot {
 	INT32 TL;		/* total level     :TL << 8            */
 	INT32 TLL;		/* adjusted now TL                     */
-	UINT8  KSR;		/* key scale rate  :(shift down bit)   */
+	uint8_t  KSR;		/* key scale rate  :(shift down bit)   */
 	INT32 *AR;		/* attack rate     :&AR_TABLE[AR<<2]   */
 	INT32 *DR;		/* decay rate      :&DR_TALBE[DR<<2]   */
 	INT32 SL;		/* sustin level    :SL_TALBE[SL]       */
 	INT32 *RR;		/* release rate    :&DR_TABLE[RR<<2]   */
-	UINT8 ksl;		/* keyscale level  :(shift down bits)  */
-	UINT8 ksr;		/* key scale rate  :kcode>>KSR         */
+	uint8_t ksl;		/* keyscale level  :(shift down bits)  */
+	uint8_t ksr;		/* key scale rate  :kcode>>KSR         */
 	UINT32 mul;		/* multiple        :ML_TABLE[ML]       */
 	UINT32 Cnt;		/* frequency count :                   */
 	UINT32 Incr;	/* frequency step  :                   */
 	/* envelope generator state */
-	UINT8 eg_typ;	/* envelope type flag                  */
-	UINT8 evm;		/* envelope phase                      */
+	uint8_t eg_typ;	/* envelope type flag                  */
+	uint8_t evm;		/* envelope phase                      */
 	INT32 evc;		/* envelope counter                    */
 	INT32 eve;		/* envelope counter end point          */
 	INT32 evs;		/* envelope counter step               */
@@ -70,8 +71,8 @@ typedef struct fm_opl_slot {
 	INT32 evsd;	/* envelope step for DR :DR[ksr]           */
 	INT32 evsr;	/* envelope step for RR :RR[ksr]           */
 	/* LFO */
-	UINT8 ams;		/* ams flag                            */
-	UINT8 vib;		/* vibrate flag                        */
+	uint8_t ams;		/* ams flag                            */
+	uint8_t vib;		/* vibrate flag                        */
 	/* wave selector */
 	INT32 **wavetable;
 }OPL_SLOT;
@@ -79,45 +80,45 @@ typedef struct fm_opl_slot {
 /* ---------- OPL one of channel  ---------- */
 typedef struct fm_opl_channel {
 	OPL_SLOT SLOT[2];
-	UINT8 CON;			/* connection type                     */
-	UINT8 FB;			/* feed back       :(shift down bit)   */
+	uint8_t CON;			/* connection type                     */
+	uint8_t FB;			/* feed back       :(shift down bit)   */
 	INT32 *connect1;	/* slot1 output pointer                */
 	INT32 *connect2;	/* slot2 output pointer                */
 	INT32 op1_out[2];	/* slot1 output for selfeedback        */
 	/* phase generator state */
 	UINT32  block_fnum;	/* block+fnum      :                   */
-	UINT8 kcode;		/* key code        : KeyScaleCode      */
+	uint8_t kcode;		/* key code        : KeyScaleCode      */
 	UINT32  fc;			/* Freq. Increment base                */
 	UINT32  ksl_base;	/* KeyScaleLevel Base step             */
-	UINT8 keyon;		/* key on/off flag                     */
+	uint8_t keyon;		/* key on/off flag                     */
 } OPL_CH;

 /* OPL state */
 typedef struct fm_opl_f {
-	UINT8 type;			/* chip type                         */
+	uint8_t type;			/* chip type                         */
 	int clock;			/* master clock  (Hz)                */
 	int rate;			/* sampling rate (Hz)                */
 	double freqbase;	/* frequency base                    */
 	double TimerBase;	/* Timer base time (==sampling time) */
-	UINT8 address;		/* address register                  */
-	UINT8 status;		/* status flag                       */
-	UINT8 statusmask;	/* status mask                       */
+	uint8_t address;		/* address register                  */
+	uint8_t status;		/* status flag                       */
+	uint8_t statusmask;	/* status mask                       */
 	UINT32 mode;		/* Reg.08 : CSM , notesel,etc.       */
 	/* Timer */
 	int T[2];			/* timer counter                     */
-	UINT8 st[2];		/* timer enable                      */
+	uint8_t st[2];		/* timer enable                      */
 	/* FM channel slots */
 	OPL_CH *P_CH;		/* pointer of CH                     */
 	int	max_ch;			/* maximum channel                   */
 	/* Rythm sention */
-	UINT8 rythm;		/* Rythm mode , key flag */
+	uint8_t rythm;		/* Rythm mode , key flag */
 #if BUILD_Y8950
 	/* Delta-T ADPCM unit (Y8950) */
 	YM_DELTAT *deltat;			/* DELTA-T ADPCM       */
 #endif
 	/* Keyboard / I/O interface unit (Y8950) */
-	UINT8 portDirection;
-	UINT8 portLatch;
+	uint8_t portDirection;
+	uint8_t portLatch;
 	OPL_PORTHANDLER_R porthandler_r;
 	OPL_PORTHANDLER_W porthandler_w;
 	int port_param;
@@ -136,7 +137,7 @@ typedef struct fm_opl_f {
 	INT32 vibCnt;
 	INT32 vibIncr;
 	/* wave selector enable flag */
-	UINT8 wavesel;
+	uint8_t wavesel;
 	/* external event callback handler */
 	OPL_TIMERHANDLER  TimerHandler;		/* TIMER handler   */
 	int TimerParam;						/* TIMER parameter */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 3/6] audio: s/UINT32/uint32_t
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 1/6] audio: Nothing uses UINT16 Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 2/6] audio: s/UINT8/uint8_t Juan Quintela
@ 2009-08-28 18:06 ` Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 4/6] audio: Nothing uses INT8 Juan Quintela
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/fmopl.c |   18 +++++++++---------
 hw/fmopl.h |   17 ++++++++---------
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/hw/fmopl.c b/hw/fmopl.c
index dd8e6a4..1bec9d4 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -124,7 +124,7 @@ static const int slot_array[32]=
 /* key scale level */
 /* table is 3dB/OCT , DV converts this in TL step at 6dB/OCT */
 #define DV (EG_STEP/2)
-static const UINT32 KSL_TABLE[8*16]=
+static const uint32_t KSL_TABLE[8*16]=
 {
 	/* OCT 0 */
 	 0.000/DV, 0.000/DV, 0.000/DV, 0.000/DV,
@@ -197,7 +197,7 @@ static INT32 ENV_CURVE[2*EG_ENT+1];

 /* multiple table */
 #define ML 2
-static const UINT32 MUL_TABLE[16]= {
+static const uint32_t MUL_TABLE[16]= {
 /* 1/2, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15 */
    0.50*ML, 1.00*ML, 2.00*ML, 3.00*ML, 4.00*ML, 5.00*ML, 6.00*ML, 7.00*ML,
    8.00*ML, 9.00*ML,10.00*ML,10.00*ML,12.00*ML,12.00*ML,15.00*ML,15.00*ML
@@ -321,7 +321,7 @@ INLINE void OPL_KEYOFF(OPL_SLOT *SLOT)

 /* ---------- calcrate Envelope Generator & Phase Generator ---------- */
 /* return : envelope output */
-INLINE UINT32 OPL_CALC_SLOT( OPL_SLOT *SLOT )
+INLINE uint32_t OPL_CALC_SLOT( OPL_SLOT *SLOT )
 {
 	/* calcrate envelope generator */
 	if( (SLOT->evc+=SLOT->evs) >= SLOT->eve )
@@ -453,7 +453,7 @@ INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v)
 /* ---------- calcrate one of channel ---------- */
 INLINE void OPL_CALC_CH( OPL_CH *CH )
 {
-	UINT32 env_out;
+	uint32_t env_out;
 	OPL_SLOT *SLOT;

 	feedback2 = 0;
@@ -498,7 +498,7 @@ INLINE void OPL_CALC_CH( OPL_CH *CH )
 #define WHITE_NOISE_db 6.0
 INLINE void OPL_CALC_RH( OPL_CH *CH )
 {
-	UINT32 env_tam,env_sd,env_top,env_hh;
+	uint32_t env_tam,env_sd,env_top,env_hh;
 	int whitenoise = (rand()&1)*(WHITE_NOISE_db/EG_STEP);
 	INT32 tone8;

@@ -1043,8 +1043,8 @@ void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
     int i;
 	int data;
 	OPLSAMPLE *buf = buffer;
-	UINT32 amsCnt  = OPL->amsCnt;
-	UINT32 vibCnt  = OPL->vibCnt;
+	uint32_t amsCnt  = OPL->amsCnt;
+	uint32_t vibCnt  = OPL->vibCnt;
 	uint8_t rythm = OPL->rythm&0x20;
 	OPL_CH *CH,*R_CH;

@@ -1104,8 +1104,8 @@ void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
     int i;
 	int data;
 	OPLSAMPLE *buf = buffer;
-	UINT32 amsCnt  = OPL->amsCnt;
-	UINT32 vibCnt  = OPL->vibCnt;
+	uint32_t amsCnt  = OPL->amsCnt;
+	uint32_t vibCnt  = OPL->vibCnt;
 	uint8_t rythm = OPL->rythm&0x20;
 	OPL_CH *CH,*R_CH;
 	YM_DELTAT *DELTAT = OPL->deltat;
diff --git a/hw/fmopl.h b/hw/fmopl.h
index f42c803..2945d95 100644
--- a/hw/fmopl.h
+++ b/hw/fmopl.h
@@ -15,7 +15,6 @@
 /* compiler dependence */
 #ifndef OSD_CPU_H
 #define OSD_CPU_H
-typedef unsigned int	UINT32;  /* unsigned 32bit */
 typedef signed char		INT8;    /* signed  8bit   */
 typedef signed short	INT16;   /* signed 16bit   */
 typedef signed int		INT32;   /* signed 32bit   */
@@ -58,9 +57,9 @@ typedef struct fm_opl_slot {
 	INT32 *RR;		/* release rate    :&DR_TABLE[RR<<2]   */
 	uint8_t ksl;		/* keyscale level  :(shift down bits)  */
 	uint8_t ksr;		/* key scale rate  :kcode>>KSR         */
-	UINT32 mul;		/* multiple        :ML_TABLE[ML]       */
-	UINT32 Cnt;		/* frequency count :                   */
-	UINT32 Incr;	/* frequency step  :                   */
+	uint32_t mul;		/* multiple        :ML_TABLE[ML]       */
+	uint32_t Cnt;		/* frequency count :                   */
+	uint32_t Incr;	/* frequency step  :                   */
 	/* envelope generator state */
 	uint8_t eg_typ;	/* envelope type flag                  */
 	uint8_t evm;		/* envelope phase                      */
@@ -86,10 +85,10 @@ typedef struct fm_opl_channel {
 	INT32 *connect2;	/* slot2 output pointer                */
 	INT32 op1_out[2];	/* slot1 output for selfeedback        */
 	/* phase generator state */
-	UINT32  block_fnum;	/* block+fnum      :                   */
+	uint32_t  block_fnum;	/* block+fnum      :                   */
 	uint8_t kcode;		/* key code        : KeyScaleCode      */
-	UINT32  fc;			/* Freq. Increment base                */
-	UINT32  ksl_base;	/* KeyScaleLevel Base step             */
+	uint32_t  fc;			/* Freq. Increment base                */
+	uint32_t  ksl_base;	/* KeyScaleLevel Base step             */
 	uint8_t keyon;		/* key on/off flag                     */
 } OPL_CH;

@@ -103,7 +102,7 @@ typedef struct fm_opl_f {
 	uint8_t address;		/* address register                  */
 	uint8_t status;		/* status flag                       */
 	uint8_t statusmask;	/* status mask                       */
-	UINT32 mode;		/* Reg.08 : CSM , notesel,etc.       */
+	uint32_t mode;		/* Reg.08 : CSM , notesel,etc.       */
 	/* Timer */
 	int T[2];			/* timer counter                     */
 	uint8_t st[2];		/* timer enable                      */
@@ -128,7 +127,7 @@ typedef struct fm_opl_f {
 	/* time tables */
 	INT32 AR_TABLE[75];	/* atttack rate tables */
 	INT32 DR_TABLE[75];	/* decay rate tables   */
-	UINT32 FN_TABLE[1024];  /* fnumber -> increment counter */
+	uint32_t FN_TABLE[1024];  /* fnumber -> increment counter */
 	/* LFO */
 	INT32 *ams_table;
 	INT32 *vib_table;
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 4/6] audio: Nothing uses INT8
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
                   ` (2 preceding siblings ...)
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 3/6] audio: s/UINT32/uint32_t Juan Quintela
@ 2009-08-28 18:06 ` Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 5/6] audio: s/INT16/int16_t Juan Quintela
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/fmopl.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/hw/fmopl.h b/hw/fmopl.h
index 2945d95..2e808cb 100644
--- a/hw/fmopl.h
+++ b/hw/fmopl.h
@@ -15,7 +15,6 @@
 /* compiler dependence */
 #ifndef OSD_CPU_H
 #define OSD_CPU_H
-typedef signed char		INT8;    /* signed  8bit   */
 typedef signed short	INT16;   /* signed 16bit   */
 typedef signed int		INT32;   /* signed 32bit   */
 #endif
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 5/6] audio: s/INT16/int16_t
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
                   ` (3 preceding siblings ...)
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 4/6] audio: Nothing uses INT8 Juan Quintela
@ 2009-08-28 18:06 ` Juan Quintela
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 6/6] audio: s/INT32/int32_t Juan Quintela
  2009-08-28 18:37 ` [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> malc
  6 siblings, 0 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/fmopl.c |    4 ++--
 hw/fmopl.h |    7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/hw/fmopl.c b/hw/fmopl.c
index 1bec9d4..5e37ad9 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -1038,7 +1038,7 @@ static void OPL_UnLockTable(void)
 /*******************************************************************************/

 /* ---------- update one of chip ----------- */
-void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
+void YM3812UpdateOne(FM_OPL *OPL, int16_t *buffer, int length)
 {
     int i;
 	int data;
@@ -1099,7 +1099,7 @@ void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)

 #if BUILD_Y8950

-void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
+void Y8950UpdateOne(FM_OPL *OPL, int16_t *buffer, int length)
 {
     int i;
 	int data;
diff --git a/hw/fmopl.h b/hw/fmopl.h
index 2e808cb..06a7d26 100644
--- a/hw/fmopl.h
+++ b/hw/fmopl.h
@@ -15,12 +15,11 @@
 /* compiler dependence */
 #ifndef OSD_CPU_H
 #define OSD_CPU_H
-typedef signed short	INT16;   /* signed 16bit   */
 typedef signed int		INT32;   /* signed 32bit   */
 #endif

 #if (OPL_OUTPUT_BIT==16)
-typedef INT16 OPLSAMPLE;
+typedef int16_t OPLSAMPLE;
 #endif
 #if (OPL_OUTPUT_BIT==8)
 typedef unsigned char  OPLSAMPLE;
@@ -165,8 +164,8 @@ unsigned char OPLRead(FM_OPL *OPL,int a);
 int OPLTimerOver(FM_OPL *OPL,int c);

 /* YM3626/YM3812 local section */
-void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length);
+void YM3812UpdateOne(FM_OPL *OPL, int16_t *buffer, int length);

-void Y8950UpdateOne(FM_OPL *OPL, INT16 *buffer, int length);
+void Y8950UpdateOne(FM_OPL *OPL, int16_t *buffer, int length);

 #endif
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] [PATCH 6/6] audio: s/INT32/int32_t
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
                   ` (4 preceding siblings ...)
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 5/6] audio: s/INT16/int16_t Juan Quintela
@ 2009-08-28 18:06 ` Juan Quintela
  2009-08-28 18:37 ` [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> malc
  6 siblings, 0 replies; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 18:06 UTC (permalink / raw)
  To: qemu-devel


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/fmopl.c |   42 +++++++++++++++++++++---------------------
 hw/fmopl.h |   54 ++++++++++++++++++++++++------------------------------
 2 files changed, 45 insertions(+), 51 deletions(-)

diff --git a/hw/fmopl.c b/hw/fmopl.c
index 5e37ad9..918fc66 100644
--- a/hw/fmopl.c
+++ b/hw/fmopl.c
@@ -172,7 +172,7 @@ static const uint32_t KSL_TABLE[8*16]=
 /* sustain lebel table (3db per step) */
 /* 0 - 15: 0, 3, 6, 9,12,15,18,21,24,27,30,33,36,39,42,93 (dB)*/
 #define SC(db) (db*((3/EG_STEP)*(1<<ENV_BITS)))+EG_DST
-static const INT32 SL_TABLE[16]={
+static const int32_t SL_TABLE[16]={
  SC( 0),SC( 1),SC( 2),SC(3 ),SC(4 ),SC(5 ),SC(6 ),SC( 7),
  SC( 8),SC( 9),SC(10),SC(11),SC(12),SC(13),SC(14),SC(31)
 };
@@ -182,18 +182,18 @@ static const INT32 SL_TABLE[16]={
 /* TotalLevel : 48 24 12  6  3 1.5 0.75 (dB) */
 /* TL_TABLE[ 0      to TL_MAX          ] : plus  section */
 /* TL_TABLE[ TL_MAX to TL_MAX+TL_MAX-1 ] : minus section */
-static INT32 *TL_TABLE;
+static int32_t *TL_TABLE;

 /* pointers to TL_TABLE with sinwave output offset */
-static INT32 **SIN_TABLE;
+static int32_t **SIN_TABLE;

 /* LFO table */
-static INT32 *AMS_TABLE;
-static INT32 *VIB_TABLE;
+static int32_t *AMS_TABLE;
+static int32_t *VIB_TABLE;

 /* envelope output curve table */
 /* attack + decay + OFF */
-static INT32 ENV_CURVE[2*EG_ENT+1];
+static int32_t ENV_CURVE[2*EG_ENT+1];

 /* multiple table */
 #define ML 2
@@ -205,7 +205,7 @@ static const uint32_t MUL_TABLE[16]= {
 #undef ML

 /* dummy attack / decay rate ( when rate == 0 ) */
-static INT32 RATE_0[16]=
+static int32_t RATE_0[16]=
 {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

 /* -------------------- static state --------------------- */
@@ -221,14 +221,14 @@ static OPL_CH *S_CH;
 static OPL_CH *E_CH;
 OPL_SLOT *SLOT7_1,*SLOT7_2,*SLOT8_1,*SLOT8_2;

-static INT32 outd[1];
-static INT32 ams;
-static INT32 vib;
-INT32  *ams_table;
-INT32  *vib_table;
-static INT32 amsIncr;
-static INT32 vibIncr;
-static INT32 feedback2;		/* connect for SLOT 2 */
+static int32_t outd[1];
+static int32_t ams;
+static int32_t vib;
+int32_t  *ams_table;
+int32_t  *vib_table;
+static int32_t amsIncr;
+static int32_t vibIncr;
+static int32_t feedback2;		/* connect for SLOT 2 */

 /* log output level */
 #define LOG_ERR  3      /* ERROR       */
@@ -361,7 +361,7 @@ INLINE uint32_t OPL_CALC_SLOT( OPL_SLOT *SLOT )
 /* set algorythm connection */
 static void set_algorythm( OPL_CH *CH)
 {
-	INT32 *carrier = &outd[0];
+	int32_t *carrier = &outd[0];
 	CH->connect1 = CH->CON ? carrier : &feedback2;
 	CH->connect2 = carrier;
 }
@@ -500,7 +500,7 @@ INLINE void OPL_CALC_RH( OPL_CH *CH )
 {
 	uint32_t env_tam,env_sd,env_top,env_hh;
 	int whitenoise = (rand()&1)*(WHITE_NOISE_db/EG_STEP);
-	INT32 tone8;
+	int32_t tone8;

 	OPL_SLOT *SLOT;
 	int env_out;
@@ -618,20 +618,20 @@ static int OPLOpenTable( void )
 	double pom;

 	/* allocate dynamic tables */
-	if( (TL_TABLE = malloc(TL_MAX*2*sizeof(INT32))) == NULL)
+	if( (TL_TABLE = malloc(TL_MAX*2*sizeof(int32_t))) == NULL)
 		return 0;
-	if( (SIN_TABLE = malloc(SIN_ENT*4 *sizeof(INT32 *))) == NULL)
+	if( (SIN_TABLE = malloc(SIN_ENT*4 *sizeof(int32_t *))) == NULL)
 	{
 		free(TL_TABLE);
 		return 0;
 	}
-	if( (AMS_TABLE = malloc(AMS_ENT*2 *sizeof(INT32))) == NULL)
+	if( (AMS_TABLE = malloc(AMS_ENT*2 *sizeof(int32_t))) == NULL)
 	{
 		free(TL_TABLE);
 		free(SIN_TABLE);
 		return 0;
 	}
-	if( (VIB_TABLE = malloc(VIB_ENT*2 *sizeof(INT32))) == NULL)
+	if( (VIB_TABLE = malloc(VIB_ENT*2 *sizeof(int32_t))) == NULL)
 	{
 		free(TL_TABLE);
 		free(SIN_TABLE);
diff --git a/hw/fmopl.h b/hw/fmopl.h
index 06a7d26..babdc90 100644
--- a/hw/fmopl.h
+++ b/hw/fmopl.h
@@ -12,12 +12,6 @@
 /* select bit size of output : 8 or 16 */
 #define OPL_OUTPUT_BIT 16

-/* compiler dependence */
-#ifndef OSD_CPU_H
-#define OSD_CPU_H
-typedef signed int		INT32;   /* signed 32bit   */
-#endif
-
 #if (OPL_OUTPUT_BIT==16)
 typedef int16_t OPLSAMPLE;
 #endif
@@ -46,13 +40,13 @@ typedef unsigned char (*OPL_PORTHANDLER_R)(int param);
 /* Saving is necessary for member of the 'R' mark for suspend/resume */
 /* ---------- OPL one of slot  ---------- */
 typedef struct fm_opl_slot {
-	INT32 TL;		/* total level     :TL << 8            */
-	INT32 TLL;		/* adjusted now TL                     */
+	int32_t TL;		/* total level     :TL << 8            */
+	int32_t TLL;		/* adjusted now TL                     */
 	uint8_t  KSR;		/* key scale rate  :(shift down bit)   */
-	INT32 *AR;		/* attack rate     :&AR_TABLE[AR<<2]   */
-	INT32 *DR;		/* decay rate      :&DR_TALBE[DR<<2]   */
-	INT32 SL;		/* sustin level    :SL_TALBE[SL]       */
-	INT32 *RR;		/* release rate    :&DR_TABLE[RR<<2]   */
+	int32_t *AR;		/* attack rate     :&AR_TABLE[AR<<2]   */
+	int32_t *DR;		/* decay rate      :&DR_TALBE[DR<<2]   */
+	int32_t SL;		/* sustin level    :SL_TALBE[SL]       */
+	int32_t *RR;		/* release rate    :&DR_TABLE[RR<<2]   */
 	uint8_t ksl;		/* keyscale level  :(shift down bits)  */
 	uint8_t ksr;		/* key scale rate  :kcode>>KSR         */
 	uint32_t mul;		/* multiple        :ML_TABLE[ML]       */
@@ -61,17 +55,17 @@ typedef struct fm_opl_slot {
 	/* envelope generator state */
 	uint8_t eg_typ;	/* envelope type flag                  */
 	uint8_t evm;		/* envelope phase                      */
-	INT32 evc;		/* envelope counter                    */
-	INT32 eve;		/* envelope counter end point          */
-	INT32 evs;		/* envelope counter step               */
-	INT32 evsa;	/* envelope step for AR :AR[ksr]           */
-	INT32 evsd;	/* envelope step for DR :DR[ksr]           */
-	INT32 evsr;	/* envelope step for RR :RR[ksr]           */
+	int32_t evc;		/* envelope counter                    */
+	int32_t eve;		/* envelope counter end point          */
+	int32_t evs;		/* envelope counter step               */
+	int32_t evsa;	/* envelope step for AR :AR[ksr]           */
+	int32_t evsd;	/* envelope step for DR :DR[ksr]           */
+	int32_t evsr;	/* envelope step for RR :RR[ksr]           */
 	/* LFO */
 	uint8_t ams;		/* ams flag                            */
 	uint8_t vib;		/* vibrate flag                        */
 	/* wave selector */
-	INT32 **wavetable;
+	int32_t **wavetable;
 }OPL_SLOT;

 /* ---------- OPL one of channel  ---------- */
@@ -79,9 +73,9 @@ typedef struct fm_opl_channel {
 	OPL_SLOT SLOT[2];
 	uint8_t CON;			/* connection type                     */
 	uint8_t FB;			/* feed back       :(shift down bit)   */
-	INT32 *connect1;	/* slot1 output pointer                */
-	INT32 *connect2;	/* slot2 output pointer                */
-	INT32 op1_out[2];	/* slot1 output for selfeedback        */
+	int32_t *connect1;	/* slot1 output pointer                */
+	int32_t *connect2;	/* slot2 output pointer                */
+	int32_t op1_out[2];	/* slot1 output for selfeedback        */
 	/* phase generator state */
 	uint32_t  block_fnum;	/* block+fnum      :                   */
 	uint8_t kcode;		/* key code        : KeyScaleCode      */
@@ -123,16 +117,16 @@ typedef struct fm_opl_f {
 	OPL_PORTHANDLER_W keyboardhandler_w;
 	int keyboard_param;
 	/* time tables */
-	INT32 AR_TABLE[75];	/* atttack rate tables */
-	INT32 DR_TABLE[75];	/* decay rate tables   */
+	int32_t AR_TABLE[75];	/* atttack rate tables */
+	int32_t DR_TABLE[75];	/* decay rate tables   */
 	uint32_t FN_TABLE[1024];  /* fnumber -> increment counter */
 	/* LFO */
-	INT32 *ams_table;
-	INT32 *vib_table;
-	INT32 amsCnt;
-	INT32 amsIncr;
-	INT32 vibCnt;
-	INT32 vibIncr;
+	int32_t *ams_table;
+	int32_t *vib_table;
+	int32_t amsCnt;
+	int32_t amsIncr;
+	int32_t vibCnt;
+	int32_t vibIncr;
 	/* wave selector enable flag */
 	uint8_t wavesel;
 	/* external event callback handler */
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h>
  2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
                   ` (5 preceding siblings ...)
  2009-08-28 18:06 ` [Qemu-devel] [PATCH 6/6] audio: s/INT32/int32_t Juan Quintela
@ 2009-08-28 18:37 ` malc
  2009-08-28 19:48   ` Juan Quintela
  6 siblings, 1 reply; 11+ messages in thread
From: malc @ 2009-08-28 18:37 UTC (permalink / raw)
  To: Juan Quintela; +Cc: qemu-devel

On Fri, 28 Aug 2009, Juan Quintela wrote:

> Remove pre C-ansi99 defines for integer types.

No. Take it with upstream.

[..snip..]

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h>
  2009-08-28 18:37 ` [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> malc
@ 2009-08-28 19:48   ` Juan Quintela
  2009-08-28 20:22     ` malc
  0 siblings, 1 reply; 11+ messages in thread
From: Juan Quintela @ 2009-08-28 19:48 UTC (permalink / raw)
  To: malc; +Cc: qemu-devel

malc <av1474@comtv.ru> wrote:
> On Fri, 28 Aug 2009, Juan Quintela wrote:
>
>> Remove pre C-ansi99 defines for integer types.
>
> No. Take it with upstream.
>
> [..snip..]

Who is upstream for that file?

Later, Juan.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h>
  2009-08-28 19:48   ` Juan Quintela
@ 2009-08-28 20:22     ` malc
  2009-08-29  7:38       ` Reimar Döffinger
  0 siblings, 1 reply; 11+ messages in thread
From: malc @ 2009-08-28 20:22 UTC (permalink / raw)
  To: Juan Quintela; +Cc: qemu-devel

On Fri, 28 Aug 2009, Juan Quintela wrote:

> malc <av1474@comtv.ru> wrote:
> > On Fri, 28 Aug 2009, Juan Quintela wrote:
> >
> >> Remove pre C-ansi99 defines for integer types.
> >
> > No. Take it with upstream.
> >
> > [..snip..]
> 
> Who is upstream for that file?

Tatsuyuki Satoh, it's there in qemu-doc.texi.

-- 
mailto:av1474@comtv.ru

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h>
  2009-08-28 20:22     ` malc
@ 2009-08-29  7:38       ` Reimar Döffinger
  0 siblings, 0 replies; 11+ messages in thread
From: Reimar Döffinger @ 2009-08-29  7:38 UTC (permalink / raw)
  To: qemu-devel

On Sat, Aug 29, 2009 at 12:22:20AM +0400, malc wrote:
> On Fri, 28 Aug 2009, Juan Quintela wrote:
> > malc <av1474@comtv.ru> wrote:
> > > On Fri, 28 Aug 2009, Juan Quintela wrote:
> > >
> > >> Remove pre C-ansi99 defines for integer types.
> > >
> > > No. Take it with upstream.
> > >
> > > [..snip..]
> > 
> > Who is upstream for that file?
> 
> Tatsuyuki Satoh, it's there in qemu-doc.texi.

You're hopefully not saying that it's _findable_ in here or that
submitters are supposed to read the whole thing carefully front to end
to find out.
Everywhere else that's what the MAINTAINERS file is supposed to be there
for...

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-08-29  8:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-28 18:06 [Qemu-devel] [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> Juan Quintela
2009-08-28 18:06 ` [Qemu-devel] [PATCH 1/6] audio: Nothing uses UINT16 Juan Quintela
2009-08-28 18:06 ` [Qemu-devel] [PATCH 2/6] audio: s/UINT8/uint8_t Juan Quintela
2009-08-28 18:06 ` [Qemu-devel] [PATCH 3/6] audio: s/UINT32/uint32_t Juan Quintela
2009-08-28 18:06 ` [Qemu-devel] [PATCH 4/6] audio: Nothing uses INT8 Juan Quintela
2009-08-28 18:06 ` [Qemu-devel] [PATCH 5/6] audio: s/INT16/int16_t Juan Quintela
2009-08-28 18:06 ` [Qemu-devel] [PATCH 6/6] audio: s/INT32/int32_t Juan Quintela
2009-08-28 18:37 ` [Qemu-devel] Re: [PATCH 0/6] Bring adlib to the wonderful world of <stdint.h> malc
2009-08-28 19:48   ` Juan Quintela
2009-08-28 20:22     ` malc
2009-08-29  7:38       ` Reimar Döffinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.