Fixed some bugs revealed by GCC 7.1.0.

This commit is contained in:
OBattler
2017-07-17 13:14:30 +02:00
parent 962885b960
commit ea60b150b6
4 changed files with 11 additions and 11 deletions

View File

@@ -722,13 +722,13 @@ page0_write(nic_t *dev, uint32_t off, uint32_t val, unsigned len)
case 0x07: /* ISR */
val &= 0x7f; /* clear RST bit - status-only bit */
/* All other values are cleared iff the ISR bit is 1 */
dev->ISR.pkt_rx &= ~((int)((val & 0x01) == 0x01));
dev->ISR.pkt_tx &= ~((int)((val & 0x02) == 0x02));
dev->ISR.rx_err &= ~((int)((val & 0x04) == 0x04));
dev->ISR.tx_err &= ~((int)((val & 0x08) == 0x08));
dev->ISR.overwrite &= ~((int)((val & 0x10) == 0x10));
dev->ISR.cnt_oflow &= ~((int)((val & 0x20) == 0x20));
dev->ISR.rdma_done &= ~((int)((val & 0x40) == 0x40));
dev->ISR.pkt_rx &= !((int)((val & 0x01) == 0x01));
dev->ISR.pkt_tx &= !((int)((val & 0x02) == 0x02));
dev->ISR.rx_err &= !((int)((val & 0x04) == 0x04));
dev->ISR.tx_err &= !((int)((val & 0x08) == 0x08));
dev->ISR.overwrite &= !((int)((val & 0x10) == 0x10));
dev->ISR.cnt_oflow &= !((int)((val & 0x20) == 0x20));
dev->ISR.rdma_done &= !((int)((val & 0x40) == 0x40));
val = ((dev->ISR.rdma_done << 6) |
(dev->ISR.cnt_oflow << 5) |
(dev->ISR.overwrite << 4) |

View File

@@ -710,7 +710,7 @@ void take_screenshot()
info = localtime(&now);
memset(screenshot_fn, 0, 8192);
memset(screenshot_fn_partial, 0, 4096);
memset(screenshot_path, 0, 4096);
memset(screenshot_path, 0, 8192);
pclog("Video API is: %i\n", vid_api);
append_filename_w(screenshot_path, pcempath, L"screenshots", 4095);
if (!DirectoryExists(screenshot_path))

View File

@@ -379,7 +379,7 @@ bhtty_close(BHTTY *pp)
BHTTY *
bhtty_open(char *port, int tmo)
{
char temp[64];
char temp[84];
COMMTIMEOUTS to;
COMMCONFIG conf;
BHTTY *pp;

View File

@@ -796,7 +796,7 @@ static void ioctl_read_capacity(uint8_t id, uint8_t *b)
const UCHAR cdb[] = { 0x25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
UCHAR buf[16];
if (!cdrom_ioctl[id].capacity_read)
if (!cdrom_ioctl[id].capacity_read || (b == NULL))
{
SCSICommand(id, cdb, buf, &len, 1);
@@ -1198,7 +1198,7 @@ static int ioctl_readtoc_raw(uint8_t id, uint8_t *b, int maxlen)
static uint32_t ioctl_size(uint8_t id)
{
uint8_t capacity_buffer[8];
uint8_t capacity_buffer[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint32_t capacity = 0;
ioctl_read_capacity(id, capacity_buffer);
capacity = ((uint32_t) capacity_buffer[0]) << 24;