From patchwork Fri Aug 28 18:06:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juan Quintela X-Patchwork-Id: 32388 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4F96CB7B60 for ; Sat, 29 Aug 2009 04:10:11 +1000 (EST) Received: from localhost ([127.0.0.1]:42346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh5to-0008Ul-Gg for incoming@patchwork.ozlabs.org; Fri, 28 Aug 2009 14:10:08 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mh5tI-0008UR-4o for qemu-devel@nongnu.org; Fri, 28 Aug 2009 14:09:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mh5tD-0008T1-Ht for qemu-devel@nongnu.org; Fri, 28 Aug 2009 14:09:35 -0400 Received: from [199.232.76.173] (port=46611 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mh5tD-0008Sy-5m for qemu-devel@nongnu.org; Fri, 28 Aug 2009 14:09:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:65127) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mh5tC-0000JA-4p for qemu-devel@nongnu.org; Fri, 28 Aug 2009 14:09:30 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7SI9SUk021627; Fri, 28 Aug 2009 14:09:28 -0400 Received: from localhost.localdomain (vpn2-8-222.ams2.redhat.com [10.36.8.222]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7SI9HOx003911; Fri, 28 Aug 2009 14:09:27 -0400 From: Juan Quintela To: qemu-devel@nongnu.org Date: Fri, 28 Aug 2009 20:06:53 +0200 Message-Id: <93f29e53f5d7589e0add6ef55ae9a80502b8c896.1251482708.git.quintela@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH 6/6] audio: s/INT32/int32_t X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Juan Quintela --- 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<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 */