MSVC code analyzer warnings fixed.

This commit is contained in:
Toni Wilen 2018-06-16 22:10:07 +03:00
parent f83a3cc9aa
commit 8aee58dce1
7 changed files with 16 additions and 11 deletions

View File

@ -457,6 +457,7 @@ static void cdtvcr_play_track(uae_u32 track_start, uae_u32 track_end)
if (track_start == s->track) {
start_found++;
start = s->paddress;
end = toc.toc[toc.last_track_offset].paddress;
}
if (track_end == s->track) {
end = s->paddress;

View File

@ -245,8 +245,8 @@ static bool ks11orolder(void)
*/
/* Autoconfig address space at 0xE80000 */
static uae_u8 expamem[65536];
static uae_u8 expamem_write_space[65536];
static uae_u8 expamem[65536 + 4];
static uae_u8 expamem_write_space[65536 + 4];
#define AUTOMATIC_AUTOCONFIG_MAX_ADDRESS 0x80
static int expamem_autoconfig_mode;
static addrbank*(*expamem_map)(struct autoconfig_info*);

View File

@ -2297,7 +2297,7 @@ static unsigned int thread_get2 (void *indexp)
uae_u32 proto;
uae_u32 type;
char *proto_rp = 0;
struct servent *serv;
struct servent *serv = NULL;
nameport = args->args2;
proto = args->args3;
@ -2311,9 +2311,10 @@ static unsigned int thread_get2 (void *indexp)
if (type) {
serv = getservbyport(nameport, proto_rp);
} else {
if (addr_valid (_T("thread_get4"), nameport, 1))
name_rp = (char*)get_real_address (nameport);
serv = getservbyname(name_rp, proto_rp);
if (addr_valid(_T("thread_get4"), nameport, 1)) {
name_rp = (char*)get_real_address(nameport);
serv = getservbyname(name_rp, proto_rp);
}
}
if (bsd->threadGetargs_inuse[index] != GET_STATE_CANCEL) {
// No CTRL-C Signal

View File

@ -2224,7 +2224,7 @@ static int hdf_seek (struct hardfiledata *hfd, uae_u64 offset)
static void poscheck (struct hardfiledata *hfd, int len)
{
DWORD err;
uae_s64 pos;
uae_s64 pos = -1;
if (hfd->handle_valid == HDF_HANDLE_WIN32_NORMAL) {
LARGE_INTEGER fppos;
@ -3341,7 +3341,7 @@ TCHAR *hdf_getnameharddrive (int index, int flags, int *sectorsize, int *dangero
static int hmc (struct hardfiledata *hfd)
{
uae_u8 *buf = xmalloc (uae_u8, hfd->ci.blocksize);
DWORD ret, got, err, status;
DWORD ret = 0, got, err = 0, status = 0;
int first = 1;
while (hfd->handle_valid) {

View File

@ -1568,7 +1568,7 @@ static int open_audio_ds (struct sound_data *sd, int index)
DSBUFFERDESC sound_buffer;
DSCAPS DSCaps;
WAVEFORMATEXTENSIBLE wavfmt;
LPDIRECTSOUNDBUFFER pdsb;
LPDIRECTSOUNDBUFFER pdsb = NULL;
int freq = sd->freq;
int ch = sd->channels;
int round, i;

View File

@ -1607,7 +1607,8 @@ static int toariadne2(struct ne2000_s *ne, uaecptr addr, uae_u32 *vp, int size,
}
} else if ((addr & 0x8101) == 0x0100) {
// mac rom
*vp = ncs.ne2000state->c.macaddr.a[(addr >> 1) & 7];
int macoffset = (addr >> 1) & 7;
*vp = macoffset < 6 ? ncs.ne2000state->c.macaddr.a[macoffset] : 0;
} else if ((addr & 0x8101) == 0x0001) {
// io
addr &= (15 << 1);
@ -1642,7 +1643,8 @@ static int toariadne2(struct ne2000_s *ne, uaecptr addr, uae_u32 *vp, int size,
}
} else if ((addr & 0xffe1) == 0xffc0) {
// mac rom
*vp = ncs.ne2000state->c.macaddr.a[(addr >> 1) & 7];
int macoffset = (addr >> 1) & 7;
*vp = macoffset < 6 ? ncs.ne2000state->c.macaddr.a[macoffset] : 0;
} else if ((addr & 0xffe1) == 0xffe1) {
// io
addr &= (15 << 1);

View File

@ -1890,6 +1890,7 @@ static bool graffiti(struct vidbuffer *src, struct vidbuffer *dst)
command = true;
found = false;
hires = false;
isntsc = (beamcon0 & 0x20) ? 0 : 1;
if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS))
isntsc = currprefs.ntscmode ? 1 : 0;