From 752b6aabc959eb0fd722b48619f84bc4b04999d1 Mon Sep 17 00:00:00 2001 From: espie Date: Thu, 20 May 2010 09:55:22 +0000 Subject: [PATCH] avoid lvalue cast --- .../patches/patch-src_linux_main_linux_c | 8 +++---- .../patches/patch-src_sndhrdw_nes_apu_c | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 audio/nosefart/patches/patch-src_sndhrdw_nes_apu_c diff --git a/audio/nosefart/patches/patch-src_linux_main_linux_c b/audio/nosefart/patches/patch-src_linux_main_linux_c index 1e3fbb29512..b1a4319774f 100644 --- a/audio/nosefart/patches/patch-src_linux_main_linux_c +++ b/audio/nosefart/patches/patch-src_linux_main_linux_c @@ -1,6 +1,6 @@ -$OpenBSD: patch-src_linux_main_linux_c,v 1.1.1.1 2005/03/08 14:36:26 niallo Exp $ ---- src/linux/main_linux.c.orig Fri Mar 4 10:57:15 2005 -+++ src/linux/main_linux.c Fri Mar 4 10:57:46 2005 +$OpenBSD: patch-src_linux_main_linux_c,v 1.2 2010/05/20 09:55:22 espie Exp $ +--- src/linux/main_linux.c.orig Sun May 2 01:53:54 2004 ++++ src/linux/main_linux.c Wed May 19 19:22:49 2010 @@ -17,8 +17,9 @@ UNIX systems */ #include @@ -12,7 +12,7 @@ $OpenBSD: patch-src_linux_main_linux_c,v 1.1.1.1 2005/03/08 14:36:26 niallo Exp #include "types.h" #include "nsf.h" -@@ -223,7 +224,7 @@ static void open_hardware(const char *de +@@ -223,7 +224,7 @@ static void open_hardware(const char *device) doesn't show up as a char device. The original author (Matthew Conte) seems to have thought that esddsp should work without this hack. Is doing this bad? --Matthew Strait */ diff --git a/audio/nosefart/patches/patch-src_sndhrdw_nes_apu_c b/audio/nosefart/patches/patch-src_sndhrdw_nes_apu_c new file mode 100644 index 00000000000..4ee0a794fac --- /dev/null +++ b/audio/nosefart/patches/patch-src_sndhrdw_nes_apu_c @@ -0,0 +1,21 @@ +$OpenBSD: patch-src_sndhrdw_nes_apu_c,v 1.1 2010/05/20 09:55:22 espie Exp $ +--- src/sndhrdw/nes_apu.c.orig Thu May 20 11:53:26 2010 ++++ src/sndhrdw/nes_apu.c Thu May 20 11:54:17 2010 +@@ -1034,10 +1034,13 @@ void apu_process(void *buffer, int num_samples) + accum = -0x8000; + + /* signed 16-bit output, unsigned 8-bit */ +- if (16 == apu->sample_bits) +- *((int16 *) buffer)++ = (int16) accum; +- else +- *((uint8 *) buffer)++ = (accum >> 8) ^ 0x80; ++ if (16 == apu->sample_bits) { ++ *((int16 *) buffer) = (int16) accum; ++ buffer = (int16 *)buffer + 1; ++ } else { ++ *((uint8 *) buffer) = (accum >> 8) ^ 0x80; ++ buffer = (uint8 *)buffer + 1; ++ } + } + + /* resync cycle counter */