From 96b894f7b827a44d81fe8efd93d3084fab139825 Mon Sep 17 00:00:00 2001 From: OBattler Date: Fri, 26 Oct 2018 04:54:04 +0200 Subject: [PATCH] Fixed some compile-breaking bugs. --- src/cdrom/cdrom.c | 10 +++++----- src/scsi/scsi_cdrom.c | 5 +---- src/sound/sound.c | 10 +++++----- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 0dab3f359..b8935e66e 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -8,7 +8,7 @@ * * Generic CD-ROM drive core. * - * Version: @(#)cdrom.c 1.0.4 2018/10/26 + * Version: @(#)cdrom.c 1.0.5 2018/10/26 * * Author: Miran Grca, * @@ -202,7 +202,7 @@ cdrom_global_init(void) static void cdrom_drive_reset(cdrom_t *dev) { - dev->p = NULL; + dev->priv = NULL; dev->insert = NULL; dev->close = NULL; dev->get_volume = NULL; @@ -262,9 +262,9 @@ cdrom_close(void) dev->ops = NULL; if (dev->close) - dev->close(dev->p); + dev->close(dev->priv); - dev->p = NULL; + dev->priv = NULL; cdrom_drive_reset(dev); } @@ -279,7 +279,7 @@ cdrom_insert(uint8_t id) if (dev->bus_type) { if (dev->insert) - dev->insert(dev->p); + dev->insert(dev->priv); } } diff --git a/src/scsi/scsi_cdrom.c b/src/scsi/scsi_cdrom.c index fc4a1bbb9..7a630e6e1 100644 --- a/src/scsi/scsi_cdrom.c +++ b/src/scsi/scsi_cdrom.c @@ -9,7 +9,7 @@ * Implementation of the CD-ROM drive with SCSI(-like) * commands, for both ATAPI and SCSI usage. * - * Version: @(#)scsi_cdrom.c 1.0.57 2018/10/26 + * Version: @(#)scsi_cdrom.c 1.0.58 2018/10/26 * * Author: Miran Grca, * @@ -372,9 +372,6 @@ scsi_cdrom_init(scsi_cdrom_t *dev) if (!dev) return; - /* Tell the scsi_cdrom_t struct what cdrom element corresponds to it. */ - dev->drv = &(cdrom[dev->id]); - /* Do a reset (which will also rezero it). */ scsi_cdrom_reset(dev); diff --git a/src/sound/sound.c b/src/sound/sound.c index c616d7bb7..d96c2cf7f 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -8,7 +8,7 @@ * * Sound emulation core. * - * Version: @(#)sound.c 1.0.23 2018/10/26 + * Version: @(#)sound.c 1.0.24 2018/10/26 * * Authors: Sarah Walker, * Miran Grca, @@ -240,8 +240,8 @@ sound_cd_thread(void *param) continue; if (cdrom[i].get_volume) { - audio_vol_l = (float) (cdrom[i].get_volume(cdrom[i].p, 0)); - audio_vol_r = (float) (cdrom[i].get_volume(cdrom[i].p, 1)); + audio_vol_l = (float) (cdrom[i].get_volume(cdrom[i].priv, 0)); + audio_vol_r = (float) (cdrom[i].get_volume(cdrom[i].priv, 1)); } else { audio_vol_l = 255.0; audio_vol_r = 255.0; @@ -251,8 +251,8 @@ sound_cd_thread(void *param) audio_vol_r /= 511.0; if (cdrom[i].get_channel) { - channel_select[0] = cdrom[i].get_channel(cdrom[i].p, 0); - channel_select[1] = cdrom[i].get_channel(cdrom[i].p, 1); + channel_select[0] = cdrom[i].get_channel(cdrom[i].priv, 0); + channel_select[1] = cdrom[i].get_channel(cdrom[i].priv, 1); } else { channel_select[0] = 1; channel_select[1] = 2;