diff options
-rw-r--r-- | sys/gnu/i386/isa/sound/awe_wave.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/sound/gus_wave.c | 4 | ||||
-rw-r--r-- | sys/i386/isa/sound/midi_synth.c | 4 |
3 files changed, 9 insertions, 3 deletions
diff --git a/sys/gnu/i386/isa/sound/awe_wave.c b/sys/gnu/i386/isa/sound/awe_wave.c index 1f3269e..c4f3cbf 100644 --- a/sys/gnu/i386/isa/sound/awe_wave.c +++ b/sys/gnu/i386/isa/sound/awe_wave.c @@ -21,6 +21,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include <stddef.h> + #ifdef __FreeBSD__ # include <gnu/i386/isa/sound/awe_config.h> #else @@ -3296,7 +3298,7 @@ awe_load_guspatch(const char *addr, int offs, int size, int pmgr_flag) int note, free_sample, free_info; int rc; - sizeof_patch = (int)((long)&patch.data[0] - (long)&patch); /* header size */ + sizeof_patch = offsetof(struct patch_info, data); /* header size */ if (size < sizeof_patch) { printk("AWE32 Error: Patch header too short\n"); return RET_ERROR(EINVAL); diff --git a/sys/i386/isa/sound/gus_wave.c b/sys/i386/isa/sound/gus_wave.c index 55463c9..9b3ab0b 100644 --- a/sys/i386/isa/sound/gus_wave.c +++ b/sys/i386/isa/sound/gus_wave.c @@ -27,6 +27,8 @@ * */ +#include <stddef.h> + #include <i386/isa/sound/sound_config.h> #include <i386/isa/sound/ultrasound.h> #include <i386/isa/sound/gus_hw.h> @@ -1569,7 +1571,7 @@ guswave_load_patch(int dev, int format, snd_rw_buf * addr, u_long blk_size, blk_end, left, src_offs, target; - sizeof_patch = (long) &patch.data[0] - (long) &patch; /* Header size */ + sizeof_patch = offsetof(struct patch_info, data); /* Header size */ if (format != GUS_PATCH) { printf("GUS Error: Invalid patch format (key) 0x%x\n", format); diff --git a/sys/i386/isa/sound/midi_synth.c b/sys/i386/isa/sound/midi_synth.c index 86032e3..e63b24a 100644 --- a/sys/i386/isa/sound/midi_synth.c +++ b/sys/i386/isa/sound/midi_synth.c @@ -30,6 +30,8 @@ #define USE_SEQ_MACROS #define USE_SIMPLE_MACROS +#include <stddef.h> + #include <i386/isa/sound/sound_config.h> #if defined(CONFIGURE_SOUNDCARD) /* && defined(CONFIG_MIDI) */ @@ -448,7 +450,7 @@ midi_synth_load_patch(int dev, int format, snd_rw_buf * addr, int i; unsigned long left, src_offs, eox_seen = 0; int first_byte = 1; - int hdr_size = (unsigned long) &sysex.data[0] - (unsigned long) &sysex; + int hdr_size = offsetof(struct sysex_info, data); leave_sysex(dev); |