From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K59vm-0007GT-Le for qemu-devel@nongnu.org; Sat, 07 Jun 2008 21:42:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K59vm-0007GB-6b for qemu-devel@nongnu.org; Sat, 07 Jun 2008 21:42:50 -0400 Received: from [199.232.76.173] (port=32930 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K59vm-0007G6-3R for qemu-devel@nongnu.org; Sat, 07 Jun 2008 21:42:50 -0400 Received: from savannah.gnu.org ([199.232.41.3]:37208 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K59vm-0005pu-CE for qemu-devel@nongnu.org; Sat, 07 Jun 2008 21:42:50 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1K59vk-0000AK-8o for qemu-devel@nongnu.org; Sun, 08 Jun 2008 01:42:48 +0000 Received: from malc by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1K59vk-0000AA-1Q for qemu-devel@nongnu.org; Sun, 08 Jun 2008 01:42:48 +0000 MIME-Version: 1.0 Errors-To: malc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: malc Message-Id: Date: Sun, 08 Jun 2008 01:42:48 +0000 Subject: [Qemu-devel] [4696] Fix some signedness issues caught by gcc 4.3 Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4696 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4696 Author: malc Date: 2008-06-08 01:42:47 +0000 (Sun, 08 Jun 2008) Log Message: ----------- Fix some signedness issues caught by gcc 4.3 Modified Paths: -------------- trunk/hw/gus.c trunk/hw/gusemu.h trunk/hw/gusemu_mixer.c Modified: trunk/hw/gus.c =================================================================== --- trunk/hw/gus.c 2008-06-08 01:09:01 UTC (rev 4695) +++ trunk/hw/gus.c 2008-06-08 01:42:47 UTC (rev 4696) @@ -58,7 +58,7 @@ QEMUSoundCard card; int freq; int pos, left, shift, irqs; - uint16_t *mixbuf; + GUSsample *mixbuf; uint8_t himem[1024 * 1024 + 32 + 4096]; int samples; SWVoiceOut *voice; @@ -198,7 +198,7 @@ int GUS_read_DMA (void *opaque, int nchan, int dma_pos, int dma_len) { GUSState *s = opaque; - int8_t tmpbuf[4096]; + char tmpbuf[4096]; int pos = dma_pos, mode, left = dma_len - dma_pos; ldebug ("read DMA %#x %d\n", dma_pos, dma_len); Modified: trunk/hw/gusemu.h =================================================================== --- trunk/hw/gusemu.h 2008-06-08 01:09:01 UTC (rev 4695) +++ trunk/hw/gusemu.h 2008-06-08 01:42:47 UTC (rev 4696) @@ -32,12 +32,14 @@ typedef unsigned short GUSword; typedef unsigned int GUSdword; typedef signed char GUSchar; + typedef signed short GUSsample; #else #include typedef int8_t GUSchar; typedef uint8_t GUSbyte; typedef uint16_t GUSword; typedef uint32_t GUSdword; + typedef int16_t GUSsample; #endif typedef struct _GUSEmuState @@ -91,7 +93,7 @@ /* If the interrupts are asynchronous, it may be needed to use a separate thread mixing into a temporary */ /* audio buffer in order to avoid quality loss caused by large numsamples and elapsed_time values. */ -void gus_mixvoices(GUSEmuState *state, unsigned int playback_freq, unsigned int numsamples, short *bufferpos); +void gus_mixvoices(GUSEmuState *state, unsigned int playback_freq, unsigned int numsamples, GUSsample *bufferpos); /* recommended range: 10 < numsamples < 100 */ /* lower values may result in increased rounding error, higher values often cause audible timing delays */ Modified: trunk/hw/gusemu_mixer.c =================================================================== --- trunk/hw/gusemu_mixer.c 2008-06-08 01:09:01 UTC (rev 4695) +++ trunk/hw/gusemu_mixer.c 2008-06-08 01:42:47 UTC (rev 4696) @@ -33,7 +33,7 @@ /* samples are always 16bit stereo (4 bytes each, first right then left interleaved) */ void gus_mixvoices(GUSEmuState * state, unsigned int playback_freq, unsigned int numsamples, - short *bufferpos) + GUSsample *bufferpos) { /* note that byte registers are stored in the upper half of each voice register! */ GUSbyte *gusptr; @@ -170,8 +170,8 @@ } /* mix samples into buffer */ - *(bufferpos + 2 * sample) += (short) ((sample1 * PanningPos) >> 4); /* right */ - *(bufferpos + 2 * sample + 1) += (short) ((sample1 * (15 - PanningPos)) >> 4); /* left */ + *(bufferpos + 2 * sample) += (GUSsample) ((sample1 * PanningPos) >> 4); /* right */ + *(bufferpos + 2 * sample + 1) += (GUSsample) ((sample1 * (15 - PanningPos)) >> 4); /* left */ } /* write back voice and volume */ GUSvoice(wVSRCurrVol) = Volume32 / 32;