aboutsummaryrefslogtreecommitdiff
path: root/hw/musicpal.c
diff options
context:
space:
mode:
authorbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-06 15:01:12 +0000
committerbalrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-06 15:01:12 +0000
commit4f3cb3be18c179c69862c2a37c6c8ddcbb6f91ac (patch)
treef2e966210796666d6301a98b590fa245bb5b6752 /hw/musicpal.c
parent894efddb50a4531cbeaf2e2b0a1832133d1ef34d (diff)
downloadqemu-4f3cb3be18c179c69862c2a37c6c8ddcbb6f91ac.zip
qemu-4f3cb3be18c179c69862c2a37c6c8ddcbb6f91ac.tar.gz
qemu-4f3cb3be18c179c69862c2a37c6c8ddcbb6f91ac.tar.bz2
MusicPal: fix gcc4 build (Jan Kiszka).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4363 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/musicpal.c')
-rw-r--r--hw/musicpal.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/hw/musicpal.c b/hw/musicpal.c
index 6c68f36..2b60752 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -255,7 +255,8 @@ typedef struct musicpal_audio_state {
static void audio_callback(void *opaque, int free_out, int free_in)
{
musicpal_audio_state *s = opaque;
- int16_t *codec_buffer, *mem_buffer;
+ int16_t *codec_buffer;
+ void *mem_buffer;
int pos, block_size;
if (!(s->playback_mode & MP_AUDIO_PLAYBACK_EN))
@@ -276,8 +277,9 @@ static void audio_callback(void *opaque, int free_out, int free_in)
if (s->playback_mode & MP_AUDIO_MONO) {
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
for (pos = 0; pos < block_size; pos += 2) {
- *codec_buffer++ = *mem_buffer;
- *codec_buffer++ = *mem_buffer++;
+ *codec_buffer++ = *(uint16_t *)mem_buffer;
+ *codec_buffer++ = *(uint16_t *)mem_buffer;
+ mem_buffer += 2;
}
} else
memcpy(wm8750_dac_buffer(s->wm, block_size >> 2),
@@ -286,14 +288,14 @@ static void audio_callback(void *opaque, int free_out, int free_in)
if (s->playback_mode & MP_AUDIO_MONO) {
codec_buffer = wm8750_dac_buffer(s->wm, block_size);
for (pos = 0; pos < block_size; pos++) {
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer));
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
}
} else {
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
for (pos = 0; pos < block_size; pos += 2) {
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
- *codec_buffer++ = cpu_to_le16(256 * *((int8_t *)mem_buffer)++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
+ *codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
}
}
}