qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Juan Quintela <quintela@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 09/30] audio: Remove UINT8
Date: Thu,  4 May 2017 09:17:50 +0200	[thread overview]
Message-ID: <20170504071811.3547-10-kraxel@redhat.com> (raw)
In-Reply-To: <20170504071811.3547-1-kraxel@redhat.com>

From: Juan Quintela <quintela@redhat.com>

uint8_t has existed since ..... all this century?

Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-id: 20170425223739.6703-6-quintela@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/audio/fmopl.h | 39 ++++++++++++++++++++-------------------
 hw/audio/fmopl.c |  8 ++++----
 2 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/hw/audio/fmopl.h b/hw/audio/fmopl.h
index e476497275..3df89425ef 100644
--- a/hw/audio/fmopl.h
+++ b/hw/audio/fmopl.h
@@ -1,6 +1,8 @@
 #ifndef FMOPL_H
 #define FMOPL_H
 
+#include <stdint.h>
+
 /* --- system optimize --- */
 /* select bit size of output : 8 or 16 */
 #define OPL_OUTPUT_BIT 16
@@ -8,7 +10,6 @@
 /* compiler dependence */
 #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   */
@@ -41,19 +42,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               */
@@ -61,8 +62,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;
@@ -70,38 +71,38 @@ 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                   */
 	/* Rhythm sention */
-	UINT8 rhythm;		/* Rhythm mode , key flag */
+	uint8_t rhythm;		/* Rhythm mode , key flag */
 	OPL_PORTHANDLER_R porthandler_r;
 	OPL_PORTHANDLER_W porthandler_w;
 	int port_param;
@@ -120,7 +121,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 */
diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c
index 282662a858..3d14b455a7 100644
--- a/hw/audio/fmopl.c
+++ b/hw/audio/fmopl.c
@@ -789,8 +789,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);
@@ -838,7 +838,7 @@ static void OPLWriteReg(FM_OPL *OPL, int r, int v)
 		case 0xbd:
 			/* amsep,vibdep,r,bd,sd,tom,tc,hh */
 			{
-			UINT8 rkey = OPL->rhythm^v;
+			uint8_t rkey = OPL->rhythm^v;
 			OPL->ams_table = &AMS_TABLE[v&0x80 ? AMS_ENT : 0];
 			OPL->vib_table = &VIB_TABLE[v&0x40 ? VIB_ENT : 0];
 			OPL->rhythm  = v&0x3f;
@@ -991,7 +991,7 @@ void YM3812UpdateOne(FM_OPL *OPL, INT16 *buffer, int length)
 	OPLSAMPLE *buf = buffer;
 	UINT32 amsCnt  = OPL->amsCnt;
 	UINT32 vibCnt  = OPL->vibCnt;
-	UINT8 rhythm = OPL->rhythm&0x20;
+	uint8_t rhythm = OPL->rhythm&0x20;
 	OPL_CH *CH,*R_CH;
 
 	if( (void *)OPL != cur_chip ){
-- 
2.9.3

  parent reply	other threads:[~2017-05-04  7:18 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-04  7:17 [Qemu-devel] [PULL 00/30] audio patch queue Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 01/30] hw/audio: replace exit with unrealize in hda_codec_device_class_init Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 02/30] hw/audio: convert exit callback in HDACodecDeviceClass to void Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 03/30] audio: release capture buffers Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 04/30] audio: fix WAVState leak Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 05/30] adlib: Remove support for YMF262 Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 06/30] audio: remove Y8950 configuration Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 07/30] audio: Remove YM3526 support Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 08/30] audio: YM3812 was always defined Gerd Hoffmann
2017-05-04  7:17 ` Gerd Hoffmann [this message]
2017-05-04  7:17 ` [Qemu-devel] [PULL 10/30] audio: remove UINT16 Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 11/30] audio: remove UINT32 Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 12/30] audio: Remove INT8 Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 13/30] audio: remove INT16 Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 14/30] audio: Remove INT32 Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 15/30] audio: Unfold OPLSAMPLE Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 16/30] audio: Remove Unused OPL_TYPE_* Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 17/30] audio: Remove type field Gerd Hoffmann
2017-05-04  7:17 ` [Qemu-devel] [PULL 18/30] audio: Remove unused fields Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 19/30] audio: GUSbyte is uint8_t Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 20/30] audio: remove GUSchar Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 21/30] audio: GUSword is uint16_t Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 22/30] " Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 23/30] audio: GUSsample is int16_t Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 24/30] audio: OPLSetIRQHandler is not used anywhere Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 25/30] audio: OPLSetUpdateHandler " Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 26/30] audio: IRQHandler is not used anymore Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 27/30] audio: UpdateHandler " Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 28/30] audio: Remove unused typedefs Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 29/30] audio: un-export OPLResetChip Gerd Hoffmann
2017-05-04  7:18 ` [Qemu-devel] [PULL 30/30] audio: Use ARRAY_SIZE from qemu/osdep.h Gerd Hoffmann
2017-05-04  8:37 ` [Qemu-devel] [PULL 00/30] audio patch queue no-reply
2017-05-05 15:47 ` Stefan Hajnoczi

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=20170504071811.3547-10-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    /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).