From fd961f9ff979d4d5bd15b04011b266d043379cec Mon Sep 17 00:00:00 2001 From: joevt Date: Tue, 15 Aug 2023 15:25:36 -0700 Subject: [PATCH] Fix Analyzer warnings. In Xcode, type Command-Shift-B to analyze every source file or Command-Shift-Control-B to analyze the current source file. For pseudo_dma_read report FIFO underrun and init data_word in that case. --- devices/common/scsi/sc53c94.cpp | 4 ++++ devices/common/scsi/scsicdrom.cpp | 3 +-- devices/sound/awacs.cpp | 3 ++- devices/sound/burgundy.cpp | 6 ++++-- machines/machinefactory.cpp | 4 ++-- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/devices/common/scsi/sc53c94.cpp b/devices/common/scsi/sc53c94.cpp index 769fa99..02e8e2c 100644 --- a/devices/common/scsi/sc53c94.cpp +++ b/devices/common/scsi/sc53c94.cpp @@ -185,6 +185,10 @@ uint16_t Sc53C94::pseudo_dma_read() } } } + else { + LOG_F(ERROR, "SC53C94: FIFO underrun %d", data_fifo_pos); + data_word = 0; + } // see if we need to refill FIFO if (!this->data_fifo_pos && !is_done) { diff --git a/devices/common/scsi/scsicdrom.cpp b/devices/common/scsi/scsicdrom.cpp index 635c12c..1b7474a 100644 --- a/devices/common/scsi/scsicdrom.cpp +++ b/devices/common/scsi/scsicdrom.cpp @@ -28,7 +28,6 @@ along with this program. If not, see . #include #include -#include #include using namespace std; @@ -239,7 +238,7 @@ static char Apple_Copyright_Page_Data[] = "APPLE COMPUTER, INC "; void ScsiCdrom::mode_sense() { uint8_t page_code = this->cmd_buf[2] & 0x3F; - uint8_t alloc_len = this->cmd_buf[4]; + //uint8_t alloc_len = this->cmd_buf[4]; int num_blocks = this->size_blocks; diff --git a/devices/sound/awacs.cpp b/devices/sound/awacs.cpp index f169d2e..aba3113 100644 --- a/devices/sound/awacs.cpp +++ b/devices/sound/awacs.cpp @@ -82,7 +82,8 @@ void AwacsBase::dma_out_start() { if (!this->out_stream_running) { if ((err = snd_server->start_out_stream())) { - LOG_F(ERROR, "%s: could not start sound output stream", this->name.c_str()); + LOG_F(ERROR, "%s: could not start sound output stream: %d", + this->name.c_str(), err); } } } diff --git a/devices/sound/burgundy.cpp b/devices/sound/burgundy.cpp index 97be2d8..c2d8cd1 100644 --- a/devices/sound/burgundy.cpp +++ b/devices/sound/burgundy.cpp @@ -62,7 +62,9 @@ uint32_t BurgundyCodec::snd_ctrl_read(uint32_t offset, int size) { } void BurgundyCodec::snd_ctrl_write(uint32_t offset, uint32_t value, int size) { - uint8_t reg_addr, cur_byte, last_byte; + uint8_t reg_addr; + uint8_t cur_byte; + //uint8_t last_byte; value = BYTESWAP_32(value); @@ -71,7 +73,7 @@ void BurgundyCodec::snd_ctrl_write(uint32_t offset, uint32_t value, int size) { this->last_ctrl_data = value; reg_addr = (value >> 12) & 0xFF; cur_byte = (value >> 8) & 3; - last_byte = (value >> 10) & 3; + //last_byte = (value >> 10) & 3; if (value & BURGUNDY_REG_WR) { uint32_t mask = 0xFFU << (cur_byte * 8); this->reg_array[reg_addr] = (this->reg_array[reg_addr] & ~mask) | diff --git a/machines/machinefactory.cpp b/machines/machinefactory.cpp index 5c49fff..e59414e 100644 --- a/machines/machinefactory.cpp +++ b/machines/machinefactory.cpp @@ -342,7 +342,7 @@ int MachineFactory::load_boot_rom(string& rom_filepath) { size_t file_size; int result = 0; uint32_t rom_load_addr; - AddressMapEntry *rom_reg; + //AddressMapEntry *rom_reg; rom_file.open(rom_filepath, ios::in | ios::binary); if (rom_file.fail()) { @@ -373,7 +373,7 @@ int MachineFactory::load_boot_rom(string& rom_filepath) { MemCtrlBase* mem_ctrl = dynamic_cast( gMachineObj->get_comp_by_type(HWCompType::MEM_CTRL)); - if ((rom_reg = mem_ctrl->find_rom_region())) { + if ((/*rom_reg = */mem_ctrl->find_rom_region())) { mem_ctrl->set_data(rom_load_addr, sysrom_mem, (uint32_t)file_size); } else { LOG_F(ERROR, "Could not locate physical ROM region!");