qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/6] audio: s/UINT8/uint8_t


From: Juan Quintela
Subject: [Qemu-devel] [PATCH 2/6] audio: s/UINT8/uint8_t
Date: Fri, 28 Aug 2009 20:06:49 +0200

Signed-off-by: Juan Quintela <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]