Change to logging - when logging is disabled, the logging functions are now #define'd to nothing, so the compiler ignores the lines that call them completely, seems to slightly speed up the emulator; note that the logging in vid_table.c has not been changed yet, because this file on my local tree currently contains other WIP changes.

This commit is contained in:
OBattler
2018-10-19 00:39:32 +02:00
parent d56df03a53
commit cfc626f111
78 changed files with 658 additions and 590 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the Iomega ZIP drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage.
*
* Version: @(#)zip.c 1.0.26 2018/10/09
* Version: @(#)zip.c 1.0.27 2018/10/17
*
* Author: Miran Grca, <mgrca8@gmail.com>
*
@@ -458,22 +458,22 @@ static void zip_callback(void *p);
#ifdef ENABLE_ZIP_LOG
int zip_do_log = ENABLE_ZIP_LOG;
#endif
static void
zip_log(const char *format, ...)
zip_log(const char *fmt, ...)
{
#ifdef ENABLE_ZIP_LOG
va_list ap;
if (zip_do_log) {
va_start(ap, format);
pclog_ex(format, ap);
va_start(ap, fmt);
pclog_ex(fmt, ap);
va_end(ap);
}
#endif
}
#else
#define zip_log(fmt, ...)
#endif
int
@@ -2347,7 +2347,9 @@ zip_irq_raise(zip_t *dev)
static int
zip_read_from_dma(zip_t *dev)
{
#ifdef ENABLE_ZIP_LOG
int32_t *BufLen = &scsi_devices[dev->drv->scsi_device_id].buffer_length;
#endif
int ret = 0;
if (dev->drv->bus_type == ZIP_BUS_SCSI)
@@ -2417,7 +2419,9 @@ zip_write_to_scsi_dma(uint8_t scsi_id)
static int
zip_write_to_dma(zip_t *dev)
{
#ifdef ENABLE_ZIP_LOG
int32_t *BufLen = &scsi_devices[dev->drv->scsi_device_id].buffer_length;
#endif
int ret = 0;
if (dev->drv->bus_type == ZIP_BUS_SCSI) {