]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
MSVC code analyzer warnings fixed.
authorToni Wilen <twilen@winuae.net>
Sat, 16 Jun 2018 19:10:07 +0000 (22:10 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 16 Jun 2018 19:10:07 +0000 (22:10 +0300)
cdtvcr.cpp
expansion.cpp
od-win32/bsdsock.cpp
od-win32/hardfile_win32.cpp
od-win32/sounddep/sound.cpp
qemuvga/ne2000.cpp
specialmonitors.cpp

index 819d7738ddce924214d4b7c6146a21c311c7ecef..17fddad08f58a193274aa104a94c22d55a73676e 100644 (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;
index 94247f7fd781a9850dd6980f811f043762636687..036e86f232dbaa36dabcad4c3f2e3c94c9bb4fe8 100644 (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*);
index c47c681b046d840cacc1fa83de94b736c91c6a8d..58d655cde2432b740f1bb6b1aae0a622a2666eb3 100644 (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
index 0298d6ad4637509222523ef225d15de3b04f4cde..3cd75c882a8d2323c748bb4288344b4fe72eec6c 100644 (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) {
index 166fc9dde2bb824e78d59173bc3a285d0eea2cf0..2334cb0bb8cbaa22bb93ca04c4ded574db25184e 100644 (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;
index e07d281d1197e43edeb00bd9cb56e0af20c6ae01..094a201064805ffd3cb31dc375574e0261d84384 100644 (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);
index 5c715e3288748b0033a965a9b9db2975221413ff..51aa92355bd2d39f703c4b66b09d67cc5786a1c4 100755 (executable)
@@ -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;