]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Warning fixes.
authorToni Wilen <twilen@winuae.net>
Sat, 30 Apr 2022 14:32:14 +0000 (17:32 +0300)
committerToni Wilen <twilen@winuae.net>
Sat, 30 Apr 2022 14:32:14 +0000 (17:32 +0300)
30 files changed:
hardfile.cpp
inputdevice.cpp
od-win32/ahidsound_dsonly.cpp
od-win32/ahidsound_new.cpp
od-win32/avioutput.cpp
od-win32/blkdev_win32_ioctl.cpp
od-win32/blkdev_win32_spti.cpp
od-win32/bsdsock.cpp
od-win32/clipboard_win32.cpp
od-win32/dinput.cpp
od-win32/dxwrap.cpp
od-win32/fpp_native_msvc_80bit.cpp
od-win32/hardfile_win32.cpp
od-win32/parser.cpp
od-win32/picasso96_win.cpp
od-win32/posixemu.cpp
od-win32/registry.cpp
od-win32/rp.cpp
od-win32/screenshot.cpp
od-win32/sounddep/sound.cpp
od-win32/statusline_win32.cpp
od-win32/win32.cpp
od-win32/win32_scaler.cpp
od-win32/win32gui.cpp
od-win32/win32gui_extra.cpp
qemuvga/cirrus_vga.cpp
qemuvga/es1370.cpp
qemuvga/vga.cpp
uaeipc.cpp
zfile_archive.cpp

index 2389aee26c886777f002324a4adcb4da4d4beffa..9d8432c2d9d5a32469be66951a528dbc2e1ae9bf 100644 (file)
@@ -1838,7 +1838,7 @@ int scsi_hd_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, ua
                                p += bdlen;
                        }
                        for (;;) {
-                               int rem = plen - (p - scsi_data);
+                               int rem = (int)(plen - (p - scsi_data));
                                if (!rem)
                                        break;
                                if (rem < 2)
@@ -3025,7 +3025,7 @@ static void hardfile_thread (void *devs)
                        uae_sem_post (&hfpd->sync_sem);
                        uae_sem_post (&change_sem);
                        return;
-               } else if (hardfile_do_io(ctx, get_hardfile_data_controller(hfpd - &hardfpd[0]), hfpd, iobuf, request) == 0) {
+               } else if (hardfile_do_io(ctx, get_hardfile_data_controller((int)(hfpd - &hardfpd[0])), hfpd, iobuf, request) == 0) {
                        put_byte_host(iobuf + 30, get_byte_host(iobuf + 30) & ~1);
                        trap_put_bytes(ctx, iobuf + 8, request + 8, 48 - 8);
                        release_async_request(hfpd, request);
index 344766cc991f1174fc66c2ef237a656893a5c3ad..29930858cb982efd2efb83e86cac2ebef8ec7345 100644 (file)
@@ -1406,7 +1406,7 @@ static bool read_slot (const TCHAR *parm, int num, int joystick, int button, str
        if (joystick < 0) {
                if (!(ie->allow_mask & AM_K))
                        return false;
-               id->eventid[keynum][subnum] = ie - events;
+               id->eventid[keynum][subnum] = (int)(ie - events);
                id->flags[keynum][subnum] = flags;
                id->port[keynum][subnum] = port;
                xfree (id->custom[keynum][subnum]);
@@ -1418,7 +1418,7 @@ static bool read_slot (const TCHAR *parm, int num, int joystick, int button, str
                        mask = AM_MOUSE_BUT;
                if (!(ie->allow_mask & mask))
                        return false;
-               id->eventid[num + ID_BUTTON_OFFSET][subnum] = ie - events;
+               id->eventid[num + ID_BUTTON_OFFSET][subnum] = (int)(ie - events);
                id->flags[num + ID_BUTTON_OFFSET][subnum] = flags;
                id->port[num + ID_BUTTON_OFFSET][subnum] = port;
                xfree (id->custom[num + ID_BUTTON_OFFSET][subnum]);
@@ -1430,7 +1430,7 @@ static bool read_slot (const TCHAR *parm, int num, int joystick, int button, str
                        mask = AM_MOUSE_AXIS;
                if (!(ie->allow_mask & mask))
                        return false;
-               id->eventid[num + ID_AXIS_OFFSET][subnum] = ie - events;
+               id->eventid[num + ID_AXIS_OFFSET][subnum] = (int)(ie - events);
                id->flags[num + ID_AXIS_OFFSET][subnum] = flags;
                id->port[num + ID_AXIS_OFFSET][subnum] = port;
                xfree (id->custom[num + ID_AXIS_OFFSET][subnum]);
@@ -1997,7 +1997,7 @@ void inputdevice_parse_jport_custom(struct uae_prefs *pr, int index, int port, T
                                        goto skip;
                        }
                        if (outname == NULL) {
-                               int evt = ie - &events[0];
+                               int evt = (int)(ie - &events[0]);
                                if (joystick < 0) {
                                        if (port >= 0) {
                                                // all active keyboards
@@ -3663,7 +3663,7 @@ static void inject_events (const TCHAR *str)
                        const TCHAR *s2 = s;
                        while (*s && *s != ' ')
                                s++;
-                       int s2len = s - s2;
+                       int s2len = (int)(s - s2);
                        if (!s2len)
                                break;
                        for (int i = 1; events[i].name; i++) {
@@ -8212,7 +8212,7 @@ int inputdevice_iterate (int devnum, int num, TCHAR *name, int *af)
                if (ie->allow_mask & AM_INFO) {
                        const struct inputevent *ie2 = ie + 1;
                        while (!(ie2->allow_mask & AM_INFO)) {
-                               if (is_event_used (idf, devindex, ie2 - ie, -1)) {
+                               if (is_event_used (idf, devindex, (int)(ie2 - ie), -1)) {
                                        ie2++;
                                        continue;
                                }
index 7eaf1aaa19a9a0f6101e4956b7c684b38ee795c1..55bc7ca17b24d8250a8b6286f93aeaa134ad87fd 100644 (file)
@@ -676,7 +676,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
                if (OpenClipboard (0)) {
                        clipdat = (TCHAR*)GetClipboardData (CF_UNICODETEXT);
                        if (clipdat) {
-                               clipsize = _tcslen (clipdat);
+                               clipsize = uaetcslen(clipdat);
                                clipsize++;
                                return clipsize;
                        }
@@ -710,7 +710,7 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context)
 
                        if (OpenClipboard (0)) {
                                EmptyClipboard();
-                               slen = _tcslen (s);
+                               slen = uaetcslen(s);
                                if (p)
                                        GlobalFree (p);
                                p = (LPTSTR)GlobalAlloc (GMEM_MOVEABLE, (slen + 1) * sizeof (TCHAR));
index 6cd8c2b3ffb573596e0860a17390b72b3b9ecaad..521850f20bd90925c60d6075e5c3026e64e4a743 100644 (file)
@@ -488,7 +488,7 @@ static int setchannelevent (struct DSAHI *dsahip, struct dschannel *dc)
 {
        uae_u32 audioctrl = dsahip->audioctrl;
        uae_u32 puaebase = get_long (audioctrl + ahiac_DriverData);
-       int ch = dc - &dsahip->channel[0];
+       int ch = (int)(dc - &dsahip->channel[0]);
        uae_u32 mask;
 
        if (!dsahip->playing || ahi_paused || !dc->al_source || !get_long (audioctrl + ahiac_SoundFunc))
@@ -537,7 +537,7 @@ static void setevent (struct DSAHI *dsahip)
        dsahip->evttime = t;
        if (t < 10)
                return;
-       event2_newevent2 (t, dsahip - &dsahi[0], evtfunc);
+       event2_newevent2(t, (int)(dsahip - &dsahi[0]), evtfunc);
 }
 
 static void alClear (void)
@@ -981,7 +981,7 @@ static void dorecord (struct DSAHI *dsahip)
        if (recordbuf == 0 || !valid_address (recordbuf, bytes))
                return;
        alClear ();
-       alcCaptureSamples (dsahip->al_recorddev, (void*)recordbuf, dsahip->record_samples);
+       alcCaptureSamples(dsahip->al_recorddev, (void*)recordbuf, dsahip->record_samples);
        if (alGetError () != AL_NO_ERROR)
                return;
        put_word (pbase + pub_RecordHookDone, 0);
@@ -1355,7 +1355,7 @@ static uae_u32 AHIsub_AllocAudio (TrapContext *ctx)
                write_log (_T("AHI: corrupted memory\n"));
                return AHISF_ERROR;
        }
-       put_long (pbase + pub_Index, dsahip - dsahi);
+       put_long(pbase + pub_Index, (int)(dsahip - dsahi));
        dsahip->audioctrl = audioctrl;
 
        dsahip->maxplaysamples = UAE_MAXPLAYSAMPLES;
index 33e6c50c22a0ddb59cd38e4843894aa749434aa3..49aa210437bd9e99e8ad6e013b916dc25b385f66 100644 (file)
@@ -1412,12 +1412,12 @@ static void AVIOutput_Begin2(bool fullstart, bool immediate)
        } else {
                ext1 = _T(".avi"); ext2 = _T(".wav");
        }
-       if (_tcslen (avioutput_filename_inuse) >= 4 && !_tcsicmp (avioutput_filename_inuse + _tcslen (avioutput_filename_inuse) - 4, ext2))
-               avioutput_filename_inuse[_tcslen (avioutput_filename_inuse) - 4] = 0;
-       if (_tcslen (avioutput_filename_inuse) >= 4 && _tcsicmp (avioutput_filename_inuse + _tcslen (avioutput_filename_inuse) - 4, ext1))
+       if (uaetcslen(avioutput_filename_inuse) >= 4 && !_tcsicmp (avioutput_filename_inuse + uaetcslen(avioutput_filename_inuse) - 4, ext2))
+               avioutput_filename_inuse[uaetcslen(avioutput_filename_inuse) - 4] = 0;
+       if (uaetcslen(avioutput_filename_inuse) >= 4 && _tcsicmp (avioutput_filename_inuse + uaetcslen(avioutput_filename_inuse) - 4, ext1))
                _tcscat (avioutput_filename_inuse, ext1);
        _tcscpy (avioutput_filename_tmp, avioutput_filename_inuse);
-       i = _tcslen (avioutput_filename_tmp) - 1;
+       i = uaetcslen(avioutput_filename_tmp) - 1;
        while (i > 0 && avioutput_filename_tmp[i] != '.') i--;
        if (i > 0)
                avioutput_filename_tmp[i] = 0;
index 017b0c530cffa26e77df1516f5bcbb46af0a1717..903b8fdf6becdab3c241077de07fb92f1b23f5e8 100644 (file)
@@ -78,7 +78,7 @@ static int getunitnum (struct dev_info_ioctl *ciw)
 {
        if (!ciw)
                return -1;
-       int idx = ciw - &ciw32[0];
+       int idx = (int)(ciw - &ciw32[0]);
        for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
                if (unittable[i] - 1 == idx)
                        return i;
@@ -689,7 +689,7 @@ static int ioctl_command_rawread (int unitnum, uae_u8 *data, int sector, int siz
                                        memcpy (data + blocksize, p + readblocksize, SUB_CHANNEL_SIZE);
                                        data += blocksize + SUB_CHANNEL_SIZE;
                                }
-                               ret += data - odata;
+                               ret += (int)(data - odata);
                                sector++;
                        }
                }
index 412e751b2e42f60e7924d03881a9b411876dec0f..e91c5daeca9028f8343d6bd9f2be5cba90a03d14 100644 (file)
@@ -77,7 +77,7 @@ static int getunitnum (struct dev_info_spti *di)
 {
        if (!di)
                return -1;
-       int idx = di - &dev_info[0];
+       int idx = (int)(di - &dev_info[0]);
        for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
                if (unittable[i] - 1 == idx)
                        return i;
index f942abb806b7dbd2a22f15d3fc255ddd919d0766..a5d74b4c56c681cc118519c260ad1de5f61119cd 100644 (file)
@@ -2757,11 +2757,11 @@ kludge:
                // compute total size of hostent
                size = 28;
                if (h->h_name != NULL)
-                       size += strlen(h->h_name) + 1;
+                       size += uaestrlen(h->h_name) + 1;
 
                if (h->h_aliases != NULL)
                        while (h->h_aliases[numaliases])
-                               size += strlen(h->h_aliases[numaliases++]) + 5;
+                               size += uaestrlen(h->h_aliases[numaliases++]) + 5;
 
                if (h->h_addr_list != NULL) {
                        while (h->h_addr_list[numaddr]) numaddr++;
@@ -2861,11 +2861,11 @@ void host_getprotobyname(TrapContext *ctx, SB, uae_u32 name)
                // compute total size of protoent
                size = 16;
                if (p->p_name != NULL)
-                       size += strlen(p->p_name)+1;
+                       size += uaestrlen(p->p_name)+1;
 
                if (p->p_aliases != NULL)
                        while (p->p_aliases[numaliases])
-                               size += strlen(p->p_aliases[numaliases++])+5;
+                               size += uaestrlen(p->p_aliases[numaliases++])+5;
 
                if (sb->protoent) {
                        uae_FreeMem(ctx, sb->protoent, sb->protoentsize, sb->sysbase);
@@ -2969,13 +2969,13 @@ void host_getservbynameport(TrapContext *ctx, SB, uae_u32 nameport, uae_u32 prot
                // compute total size of servent
                size = 20;
                if (s->s_name != NULL)
-                       size += strlen(s->s_name)+1;
+                       size += uaestrlen(s->s_name)+1;
                if (s->s_proto != NULL)
-                       size += strlen(s->s_proto)+1;
+                       size += uaestrlen(s->s_proto)+1;
 
                if (s->s_aliases != NULL)
                        while (s->s_aliases[numaliases])
-                               size += strlen(s->s_aliases[numaliases++])+5;
+                               size += uaestrlen(s->s_aliases[numaliases++])+5;
 
                if (sb->servent) {
                        uae_FreeMem(ctx, sb->servent, sb->serventsize, sb->sysbase);
index 6d3aad0123da4e9153e87f6db211b6f581b2cc71..1c5e388c89d0583aa9823f4a2f98a4b999556e8d 100644 (file)
@@ -99,8 +99,8 @@ static uae_char *pctoamiga (const uae_char *txt)
        uae_char *txt2;
        int i, j;
 
-       len = strlen (txt) + 1;
-       txt2 = xmalloc (uae_char, len);
+       len = uaestrlen(txt) + 1;
+       txt2 = xmalloc(uae_char, len);
        j = 0;
        for (i = 0; i < len; i++) {
                uae_char c = txt[i];
@@ -137,7 +137,7 @@ static TCHAR *amigatopc (const char *txt)
 
        pc = 0;
        cnt = 0;
-       len = strlen (txt) + 1;
+       len = uaestrlen(txt) + 1;
        for (i = 0; i < len; i++) {
                uae_char c = txt[i];
                if (c == 13)
@@ -179,7 +179,7 @@ static void to_iff_text(TrapContext *ctx, const TCHAR *pctxt)
 
        s = ua (pctxt);
        txt = pctoamiga (s);
-       txtlen = strlen (txt);
+       txtlen = uaestrlen(txt);
        xfree (to_amiga);
        size = txtlen + sizeof b + (txtlen & 1) - 8;
        b[4] = size >> 24;
@@ -415,7 +415,7 @@ static void to_iff_ilbm(TrapContext *ctx, HBITMAP hbmp)
                }
        }
 
-       tsize = p - iff - 8;
+       tsize = (int)(p - iff - 8);
        p = iff + 4;
        p[0] = tsize >> 24;
        p[1] = tsize >> 16;
index 94ea25edc1a5a6651c447810cd75c4a3b78c3123..7263c7a72333c034d1cc192ed480c74d8fb89c0b 100644 (file)
@@ -2956,8 +2956,8 @@ static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi,
 static void trimws (TCHAR *s)
 {
        /* Delete trailing whitespace.  */
-       int len = _tcslen (s);
-       while (len > 0 && _tcscspn (s + len - 1, _T("\t \r\n")) == 0)
+       int len = uaetcslen(s);
+       while (len > 0 && _tcscspn(s + len - 1, _T("\t \r\n")) == 0)
                s[--len] = '\0';
 }
 
@@ -3014,7 +3014,7 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy)
 
        cleardid (did);
        if (lpddi->tszInstanceName) {
-               len = _tcslen (lpddi->tszInstanceName) + 5 + 1;
+               len = uaetcslen(lpddi->tszInstanceName) + 5 + 1;
                did->name = xmalloc (TCHAR, len);
                _tcscpy (did->name, lpddi->tszInstanceName);
        } else {
index 10e2ddbeeffde60c6eff2ecce742dd9c20006297..0678ad28143b33b15bbd33d5d1bd36f1a582f000 100644 (file)
@@ -1208,7 +1208,7 @@ int DirectDraw_Start (void)
        guid = NULL;
        if (isfullscreen ()) {
                MultiDisplay *md = getdisplay(&currprefs, 0);
-               int disp = md - Displays;
+               int disp = (int)(md - Displays);
                if (disp < 0)
                        disp = 0;
                if (disp >= MAX_DISPLAYS)
index 11c1bc1c80000647989a29282ca000144c2786c6..bf097b75597902976bb9eebf6fb03193d8191a97 100644 (file)
@@ -918,7 +918,7 @@ static void fp_from_pack (fpdata *src, uae_u32 *wrd, int kfactor)
        strp[1] = strp[0];
        strp++;
        // add trailing zeros
-       i = strlen (strp);
+       i = uaestrlen(strp);
        cp = strp + i;
        while (i < ndigits) {
                *cp++ = '0';
index 4c2e4c373b59a94fdb3a3e1aa124111a3cb44a36..65669fd4176622b2d40b40a12f8c4be8b48cd8c8 100644 (file)
@@ -2145,7 +2145,7 @@ emptyreal:
                }
                
                hfd->handle->h = h;
-               i = _tcslen (name) - 1;
+               i = uaetcslen(name) - 1;
                while (i >= 0) {
                        if ((i > 0 && (name[i - 1] == '/' || name[i - 1] == '\\')) || i == 0) {
                                _tcsncpy (hfd->product_id, name + i, 15);
@@ -2483,7 +2483,7 @@ static int hdf_read_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, i
        if (hfd->handle_valid == HDF_HANDLE_WIN32_NORMAL) {
                ReadFile(hfd->handle->h, hfd->cache, CACHE_SIZE, &outlen, NULL);
        } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) {
-               outlen = zfile_fread(hfd->cache, 1, CACHE_SIZE, hfd->handle->zf);
+               outlen = (DWORD)zfile_fread(hfd->cache, 1, CACHE_SIZE, hfd->handle->zf);
        }
        hfd->cache_valid = 0;
        if (outlen != CACHE_SIZE)
@@ -2531,7 +2531,7 @@ int hdf_read_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int
                                ReadFile (hfd->handle->h, hfd->cache, len, &ret, NULL);
                                memcpy (buffer, hfd->cache, ret);
                        } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) {
-                               ret = zfile_fread (buffer, 1, len, hfd->handle->zf);
+                               ret = (DWORD)zfile_fread (buffer, 1, len, hfd->handle->zf);
                        }
                        maxlen = len;
                } else {
@@ -2593,7 +2593,7 @@ static int hdf_write_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset,
                        }
                }
        } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) {
-               outlen = zfile_fwrite (hfd->cache, 1, len, hfd->handle->zf);
+               outlen = (DWORD)zfile_fwrite (hfd->cache, 1, len, hfd->handle->zf);
        }
        return outlen;
 }
index 3c369aed6fe3fdd7660c8b23432f18be3ab1d786..5d6536112d6f455e64df229ea6f15b599e34a864 100644 (file)
@@ -344,7 +344,7 @@ static void DoSomeWeirdPrintingStuff (uae_char val)
                        psbuffer[0] = 0;
                        psbuffers = 0;
                        strcpy (prtbuf, "%!PS");
-                       prtbufbytes = strlen (prtbuf);
+                       prtbufbytes = uaestrlen(prtbuf);
                        flushprtbuf ();
                        write_log (_T("PostScript start detected..\n"));
                        return;
@@ -957,7 +957,7 @@ static int opentcp (const TCHAR *sername)
                write_log(_T("SERIAL_TCP: socket() failed, %s:%s: %d\n"), name, port, WSAGetLastError ());
                goto end;
        }
-       err = bind (serialsocket, socketinfo->ai_addr, socketinfo->ai_addrlen);
+       err = bind (serialsocket, socketinfo->ai_addr, (int)socketinfo->ai_addrlen);
        if (err < 0) {
                write_log(_T("SERIAL_TCP: bind() failed, %s:%s: %d\n"), name, port, WSAGetLastError ());
                goto end;
index a4b00dcd9d52fc060a9964ca5b04231228d6cccc..6b03deadb1218943324fdbf05d3e7d8d95c6e7d5 100644 (file)
@@ -2361,7 +2361,7 @@ int picasso_getwritewatch (int index, int offset, uae_u8 ***gwwbufp, uae_u8 **st
                *gwwbufp = (uae_u8**)gwwbuf[index];
        if (startp)
                *startp = start;
-       return writewatchcount[index];
+       return (int)writewatchcount[index];
 }
 bool picasso_is_vram_dirty (int index, uaecptr addr, int size)
 {
@@ -3183,7 +3183,7 @@ static uae_u32 picasso_SetSplitPosition(TrapContext *ctx)
 #ifdef CPU_64_BIT
 static void do_xor8 (uae_u8 *p, int w, uae_u32 v)
 {
-       while (ALIGN_POINTER_TO32 (p) != 7 && w) {
+       while (ALIGN_POINTER_TO32(p) != 7 && w) {
                *p ^= v;
                p++;
                w--;
@@ -3205,7 +3205,7 @@ static void do_xor8 (uae_u8 *p, int w, uae_u32 v)
 #else
 static void do_xor8 (uae_u8 *p, int w, uae_u32 v)
 {
-       while (ALIGN_POINTER_TO32 (p) != 3 && w) {
+       while (ALIGN_POINTER_TO32(p) != 3 && w) {
                *p ^= v;
                p++;
                w--;
@@ -5356,7 +5356,7 @@ static void picasso_flushpixels(int index, uae_u8 *src, int off, bool render)
 
 
                for (int split = 0; split < 2; split++) {
-                       uae_u32 regionsize = src_end[split] - src_start[split];
+                       uae_u32 regionsize = (uae_u32)(src_end[split] - src_start[split]);
                        if (src_start[split] == 0 && src_end[split] == 0) {
                                break;
                        }
@@ -5373,7 +5373,7 @@ static void picasso_flushpixels(int index, uae_u8 *src, int off, bool render)
                                        continue;
                        }
 
-                       matchcount += gwwcnt;
+                       matchcount += (int)gwwcnt;
 
                        if (gwwcnt == 0) {
                                continue;
@@ -5441,7 +5441,7 @@ static void picasso_flushpixels(int index, uae_u8 *src, int off, bool render)
                                        int y, x, realoffset;
 
                                        if (p >= src + off) {
-                                               realoffset = p - (src + off);
+                                               realoffset = (int)(p - (src + off));
                                        } else {
                                                realoffset = 0;
                                        }
index 2581fd369de12dc11e22483ff0c09d6780644ece..7b02209bf75c90b2d385286f314bdf9c4c396b25 100644 (file)
@@ -140,7 +140,7 @@ void uae_sem_destroy (uae_sem_t * event)
 
 uae_thread_id uae_thread_get_id(void)
 {
-       return (uae_thread_id)GetCurrentThreadId();
+       return (uae_thread_id)(INT_PTR)GetCurrentThreadId();
 }
 
 #ifndef _CONSOLE
index d7ef5505661741d7e48ed83413923972a733393d..b5557367a7ab860eadf5cf9599c6dcca0ac7f09e 100644 (file)
@@ -48,7 +48,7 @@ int regsetstr (UAEREG *root, const TCHAR *name, const TCHAR *str)
                HKEY rk = gr (root);
                if (!rk)
                        return 0;
-               return RegSetValueEx (rk, name, 0, REG_SZ, (CONST BYTE *)str, (_tcslen (str) + 1) * sizeof (TCHAR)) == ERROR_SUCCESS;
+               return RegSetValueEx (rk, name, 0, REG_SZ, (CONST BYTE *)str, (uaetcslen(str) + 1) * sizeof (TCHAR)) == ERROR_SUCCESS;
        }
 }
 
@@ -138,7 +138,7 @@ int regquerystr (UAEREG *root, const TCHAR *name, TCHAR *str, int *size)
                        if (_tcslen(tmp) >= *size)
                                tmp[(*size) - 1] = 0;
                        _tcscpy (str, tmp);
-                       *size = _tcslen(str);
+                       *size = uaetcslen(str);
                        ret = 1;
                }
                xfree (tmp);
@@ -195,7 +195,7 @@ int regquerydatasize (UAEREG *root, const TCHAR *name, int *size)
                int csize = 65536;
                TCHAR *tmp = xmalloc (TCHAR, csize);
                if (regquerystr (root, name, tmp, &csize)) {
-                       *size = _tcslen (tmp) / 2;
+                       *size = uaetcslen (tmp) / 2;
                        ret = 1;
                }
                xfree (tmp);
index e086b68e10715e1ab816bf61a058de1bea89d508..695164b09db70790f89fc9f0609cbc7209715df3 100644 (file)
@@ -1261,7 +1261,7 @@ static void dos_execute_callback(uae_u32 id, uae_u32 status, uae_u32 flags, cons
        if (flags & (RP_EXECUTE_RETURN_EXIT_CODE | RP_EXECUTE_RETURN_OUTPUT)) {
                int outsize = 0;
                if (outbuf) {
-                       outsize = strlen(outbuf);
+                       outsize = uaestrlen(outbuf);
                }
                size += (outsize + 1) * sizeof(TCHAR);
                er = (RPExecuteResult *)xcalloc(uae_u8, size);
@@ -1462,7 +1462,7 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM
                                savestate_initsave (NULL, 0, TRUE, true);
                                return 1;
                        }
-                       if (vpos == 0) {
+                       if (vpos == maxvpos_display_vsync) {
                                savestate_initsave (_T(""), 1, TRUE, true);
                                save_state (s, _T("AmigaForever"));
                                ret = 1;
index 08a87ebd497f8a56c8cd6513f735831d0d41dab1..47b044e52d1c183ec071534c7381f6d7ab25d017 100644 (file)
@@ -42,7 +42,7 @@ static void namesplit (TCHAR *s)
 {
        int l;
 
-       l = _tcslen (s) - 1;
+       l = uaetcslen(s) - 1;
        while (l >= 0) {
                if (s[l] == '.')
                        s[l] = 0;
@@ -53,7 +53,7 @@ static void namesplit (TCHAR *s)
                l--;
        }
        if (l > 0)
-               memmove (s, s + l, (_tcslen (s + l) + 1) * sizeof (TCHAR));
+               memmove (s, s + l, (uaetcslen(s + l) + 1) * sizeof (TCHAR));
 }
 
 static int toclipboard (BITMAPINFO *bi, void *bmp)
index 66d2bf766b34b002173c5747492a402e3f55ba69..e764b294c9d2bc9bc4531d419918ed4bd6267a35 100644 (file)
@@ -2661,7 +2661,7 @@ bool audio_is_event_frame_possible(int ms)
                return false;
        if (type == SOUND_DEVICE_WASAPI || type == SOUND_DEVICE_WASAPI_EXCLUSIVE || type == SOUND_DEVICE_PA) {
                struct sound_dp *s = sdp->data;
-               int bufsize = (uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer;
+               int bufsize = (int)((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer);
                bufsize /= sdp->samplesize;
                int todo = s->bufferFrameCount - bufsize;
                int samplesperframe = (int)(sdp->obtainedfreq / vblank_hz);
@@ -2695,7 +2695,7 @@ int audio_pull_buffer(void)
                struct sound_dp *s = sdp->data;
                if (s->pullbufferlen > 0) {
                        cnt++;
-                       int size = (uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer;
+                       int size = (int)((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer);
                        if (size > sdp->sndbufsize * 2 / 3)
                                cnt++;
                }
@@ -2770,7 +2770,7 @@ static void handle_reset(void)
 void finish_sound_buffer (void)
 {
        static unsigned long tframe;
-       int bufsize = (uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer;
+       int bufsize = (int)((uae_u8*)paula_sndbufpt - (uae_u8*)paula_sndbuffer);
 
        if (sdp->reset) {
                handle_reset();
index 96bf193a8d11ef6714965c157409de84bc5cf0b0..4ab7ad310cd9f0b16c680232bbdae08368d89cff 100644 (file)
@@ -288,7 +288,7 @@ void statusline_render(int monid, uae_u8 *buf, int bpp, int pitch, int width, in
        BitBlt(statusline_hdc, 0, 0, statusline_width, statusline_height, NULL, 0, 0, BLACKNESS);
 
        SIZE size;
-       if (GetTextExtentPoint32(statusline_hdc, text, _tcslen(text), &size)) {
+       if (GetTextExtentPoint32(statusline_hdc, text, uaetcslen(text), &size)) {
                textwidth = size.cx;
                if (isfullscreen()) {
                        if (td_numbers_pos & TD_RIGHT) {
@@ -302,7 +302,7 @@ void statusline_render(int monid, uae_u8 *buf, int bpp, int pitch, int width, in
        }
        if (x < 0)
                x = 0;
-       TextOut(statusline_hdc, x, y, text, _tcslen(text));
+       TextOut(statusline_hdc, x, y, text, uaetcslen(text));
 
        for (int y = 0; y < height && y < statusline_height; y++) {
                uae_u8 *src = (uae_u8*)statusline_bm + y * statusline_width;
index 6777fe4aff88c350dfa1b36ec05152617135c9bd..bb2bd808e24a1c4eb5b9fefd62b3368cea50ee45 100644 (file)
@@ -2879,7 +2879,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam,
                                if (txt) {
                                        SetBkMode(lpDIS->hDC, TRANSPARENT);
                                        oc = SetTextColor(lpDIS->hDC, RGB(0x00, 0x00, 0x00));
-                                       DrawText(lpDIS->hDC, txt, _tcslen(txt), &lpDIS->rcItem, flags);
+                                       DrawText(lpDIS->hDC, txt, uaetcslen(txt), &lpDIS->rcItem, flags);
                                        SetTextColor(lpDIS->hDC, oc);
                                }
                        } else if (lpDIS->itemID > 0 && lpDIS->itemID <= window_led_joy_start) {
@@ -2966,7 +2966,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam,
                                        lpDIS->rcItem.right--;
                                        lpDIS->rcItem.left += 2;
                                }
-                               DrawText (lpDIS->hDC, txt, _tcslen (txt), &lpDIS->rcItem, flags);
+                               DrawText (lpDIS->hDC, txt, uaetcslen(txt), &lpDIS->rcItem, flags);
                                SetTextColor (lpDIS->hDC, oc);
                        }
                }
@@ -3654,23 +3654,23 @@ uae_u8 *save_log(int bootlog, size_t *len)
 {
        FILE *f;
        uae_u8 *dst = NULL;
-       int size;
+       size_t size;
 
        if (!logging_started)
                return NULL;
-       f = _tfopen (bootlog ? LOG_BOOT : LOG_NORMAL, _T("rb"));
+       f = _tfopen(bootlog ? LOG_BOOT : LOG_NORMAL, _T("rb"));
        if (!f)
                return NULL;
-       fseek (f, 0, SEEK_END);
-       size = ftell (f);
-       fseek (f, 0, SEEK_SET);
+       fseek(f, 0, SEEK_END);
+       size = ftell(f);
+       fseek(f, 0, SEEK_SET);
        if (*len > 0 && size > *len)
                size = *len;
        if (size > 0) {
-               dst = xcalloc (uae_u8, size + 1);
+               dst = xcalloc(uae_u8, size + 1);
                if (dst)
-                       fread (dst, 1, size, f);
-               fclose (f);
+                       fread(dst, 1, size, f);
+               fclose(f);
                *len = size + 1;
        }
        return dst;
@@ -4091,7 +4091,7 @@ static void shellexecute (const TCHAR *command)
        TCHAR **arg;
        int i, j, k, stop;
 
-       if (_tcslen (command) == 0)
+       if (uaetcslen(command) == 0)
                return;
        i = j = 0;
        stop = 0;
@@ -4101,14 +4101,14 @@ static void shellexecute (const TCHAR *command)
                int len = 1;
                j = i;
                while (arg[i] && _tcscmp (arg[i], L";")) {
-                       len += _tcslen (arg[i]) + 3;
+                       len += uaetcslen(arg[i]) + 3;
                        i++;
                }
                exec = NULL;
                cmd = xcalloc (TCHAR, len);
                for (k = j; k < i; k++) {
                        int quote = 0;
-                       if (_tcslen (cmd) > 0)
+                       if (uaetcslen(cmd) > 0)
                                _tcscat (cmd, L" ");
                        if (_tcschr (arg[k], ' '))
                                quote = 1;
@@ -4649,8 +4649,8 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR *
                        for (i = 0; i < MAX_SOUND_DEVICES && sound_devices[i]; i++) {
                                if (!sound_devices[i]->prefix)
                                        continue;
-                               int prefixlen = _tcslen(sound_devices[i]->prefix);
-                               int tmplen = _tcslen(tmpbuf);
+                               int prefixlen = uaetcslen(sound_devices[i]->prefix);
+                               int tmplen = uaetcslen(tmpbuf);
                                if (prefixlen > 0 && tmplen >= prefixlen &&
                                        !_tcsncmp(sound_devices[i]->prefix, tmpbuf, prefixlen) &&
                                        ((tmplen > prefixlen && tmpbuf[prefixlen] == ':')
@@ -5441,7 +5441,7 @@ static void associate_init_extensions (void)
                                RegSetValueEx (key1, _T("UseUrl"), 0, REG_DWORD, (LPBYTE)&val, sizeof val);
                                _tcscpy (rpath, start_path_exe);
                                rpath[_tcslen (rpath) - 1] = 0;
-                               RegSetValueEx (key1, _T("Path"), 0, REG_SZ, (CONST BYTE *)rpath, (_tcslen (rpath) + 1) * sizeof (TCHAR));
+                               RegSetValueEx (key1, _T("Path"), 0, REG_SZ, (CONST BYTE *)rpath, (uaetcslen(rpath) + 1) * sizeof (TCHAR));
                                RegCloseKey (key1);
                                SHChangeNotify (SHCNE_ASSOCCHANGED, 0, 0, 0); 
                        }
@@ -6261,7 +6261,6 @@ static void getstartpaths (void)
        setpathmode (path_type);
 }
 
-extern void test (void);
 extern int screenshotmode, postscript_print_debugging, sound_debug, log_uaeserial, clipboard_debug;
 extern int force_direct_catweasel, sound_mode_skip, maxmem;
 extern int pngprint, log_sercon, midi_inbuflen;
@@ -7060,7 +7059,7 @@ static bool singleprocess (void)
                goto end;
        buf[0] = 0xfeff;
        _tcscpy (buf + 1, _T("IPC_QUIT"));
-       if (!WriteFile(p, (void*)buf, (_tcslen (buf) + 1) * sizeof (TCHAR), &ret, NULL))
+       if (!WriteFile(p, (void*)buf, (uaetcslen(buf) + 1) * sizeof (TCHAR), &ret, NULL))
                goto end;
        if (!PeekNamedPipe(p, NULL, 0, NULL, &avail, NULL))
                goto end;
@@ -7298,7 +7297,7 @@ static void savedump (MINIDUMPWRITEDUMP dump, HANDLE f, struct _EXCEPTION_POINTE
                musi.UserStreamCount++;
                musp->Type = LastReservedStream + musi.UserStreamCount;
                musp->Buffer = log;
-               musp->BufferSize = len;
+               musp->BufferSize = (ULONG)len;
                len = 30000;
                log = save_log (FALSE, &len);
                if (log) {
@@ -7306,7 +7305,7 @@ static void savedump (MINIDUMPWRITEDUMP dump, HANDLE f, struct _EXCEPTION_POINTE
                        musi.UserStreamCount++;
                        musp->Type = LastReservedStream + musi.UserStreamCount;
                        musp->Buffer = log;
-                       musp->BufferSize = len;
+                       musp->BufferSize = (ULONG)len;
                }
        }
 
@@ -7316,7 +7315,7 @@ static void savedump (MINIDUMPWRITEDUMP dump, HANDLE f, struct _EXCEPTION_POINTE
                musi.UserStreamCount++;
                musp->Type = LastReservedStream + musi.UserStreamCount;
                musp->Buffer = (void*)config;
-               musp->BufferSize = len;
+               musp->BufferSize = (ULONG)len;
        }
 
        if (musi.UserStreamCount > 0)
index 920343fb36f37abd10eccee3d6ff3868d3aa08ee..d2d69061d428b41f2c5345f6ce43f07aff8eef8f 100644 (file)
@@ -782,10 +782,10 @@ cont:
 
        xs = dst_width;
        if (xmult)
-               xs -= dst_width / (int)xmult;
+               xs -= (int)(dst_width / xmult);
        ys = dst_height;
        if (ymult)
-               ys -= dst_height / (int)ymult;
+               ys -= (int)(dst_height / ymult);
        sizeoffset (dr, zr, xs, ys);
 
        filterxmult = xmult;
index dd30291ef9de3b1fbdd3853bd256064d83d83381..68e402f7325183e0bd7b2c82e7951f5cf5093924 100644 (file)
@@ -150,7 +150,8 @@ void HtmlHelp(HWND a, LPCWSTR b, UINT c, const TCHAR *d)
                (*pHtmlHelp)(a, b, c, (LPDWORD)d);
        } else {
                if (gui_message_multibutton(1, _T("Help file is not installed locally, do you want to open online version? (http://www.winuae.net/help/)")) == 1) {
-                       if ((int)ShellExecute(NULL, _T("open"), _T("http://www.winuae.net/help/"), NULL, NULL, SW_SHOWNORMAL) <= 32) {
+                       HINSTANCE h = ShellExecute(NULL, _T("open"), _T("http://www.winuae.net/help/"), NULL, NULL, SW_SHOWNORMAL);
+                       if ((INT_PTR)h <= 32) {
                                TCHAR szMessage[MAX_DPATH];
                                WIN32GUI_LoadUIString(IDS_NOHELP, szMessage, MAX_DPATH);
                                gui_message(szMessage);
@@ -936,7 +937,7 @@ static void addeditmenu (HMENU menu, struct favitems *fitem)
        mii.fType = MFT_STRING;
        mii.fState = MFS_ENABLED;
        mii.dwTypeData = _T("Add New");
-       mii.cch = _tcslen (mii.dwTypeData);
+       mii.cch = uaetcslen(mii.dwTypeData);
        mii.wID = 1000;
        InsertMenuItem (emenu, -1, TRUE, &mii);
        i = 0;
@@ -948,7 +949,7 @@ static void addeditmenu (HMENU menu, struct favitems *fitem)
                        mii.wID = 1001 + i;
                        _stprintf (newpath, _T("Remove '%s'"), fitem[i].value);
                        mii.dwTypeData = newpath;
-                       mii.cch = _tcslen (mii.dwTypeData);
+                       mii.cch = uaetcslen(mii.dwTypeData);
                        InsertMenuItem (emenu, -1, TRUE, &mii);
                }
                i++;
@@ -958,7 +959,7 @@ static void addeditmenu (HMENU menu, struct favitems *fitem)
        mii.fType = MFT_STRING;
        mii.fState = MFS_ENABLED;
        mii.dwTypeData = _T("Edit");
-       mii.cch = _tcslen (mii.dwTypeData);
+       mii.cch = uaetcslen(mii.dwTypeData);
        mii.hSubMenu = emenu;
        InsertMenuItem (menu, -1, TRUE, &mii);
 }
@@ -981,7 +982,7 @@ static int popupmenu (HWND hwnd, struct favitems *items, int morefiles)
                        mii.fState = MFS_ENABLED;
                        mii.wID = items[i].type == 2 ? 1 + i : 990 - 3 + items[i].type;
                        mii.dwTypeData = items[i].value;
-                       mii.cch = _tcslen (mii.dwTypeData);
+                       mii.cch = uaetcslen(mii.dwTypeData);
                        InsertMenuItem (menu, -1, TRUE, &mii);
                        got = 1;
                }
@@ -995,7 +996,7 @@ static int popupmenu (HWND hwnd, struct favitems *items, int morefiles)
                mii.fState = MFS_ENABLED;
                mii.wID = 999;
                mii.dwTypeData = _T("[Directory scan]");
-               mii.cch = _tcslen (mii.dwTypeData);
+               mii.cch = uaetcslen(mii.dwTypeData);
                InsertMenuItem (menu, -1, TRUE, &mii);
                got = 1;
        }
@@ -1017,7 +1018,7 @@ static int popupmenu (HWND hwnd, struct favitems *items, int morefiles)
                        mii.fState = MFS_ENABLED;
                        mii.wID = 1 + i;
                        mii.dwTypeData = items[i].value;
-                       mii.cch = _tcslen (mii.dwTypeData);
+                       mii.cch = uaetcslen(mii.dwTypeData);
                        InsertMenuItem (menu, -1, TRUE, &mii);
                }
                i++;
@@ -3302,13 +3303,13 @@ static int loopmulti (const TCHAR *s, TCHAR *out)
        static int index;
 
        if (!out) {
-               index = _tcslen (s) + 1;
+               index = uaetcslen(s) + 1;
                return 1;
        }
        if (index < 0)
                return 0;
        if (!s[index]) {
-               if (s[_tcslen (s) + 1] == 0) {
+               if (s[uaetcslen(s) + 1] == 0) {
                        _tcscpy (out, s);
                        index = -1;
                        return 1;
@@ -3316,7 +3317,7 @@ static int loopmulti (const TCHAR *s, TCHAR *out)
                return 0;
        }
        _stprintf (out, _T("%s\\%s"), s, s + index);
-       index += _tcslen (s + index) + 1;
+       index += uaetcslen(s + index) + 1;
        return 1;
 }
 
@@ -5282,7 +5283,7 @@ static void InitializeListView (HWND hDlg)
                        lvstruct.iSubItem = 0;
                        result = ListView_InsertItem (list, &lvstruct);
                        _tcscpy (tmp2, workprefs.dfxlist[i]);
-                       j = _tcslen (tmp2) - 1;
+                       j = uaetcslen(tmp2) - 1;
                        if (j < 0)
                                j = 0;
                        while (j > 0) {
@@ -19151,7 +19152,7 @@ static int genericpopupmenu (HWND hwnd, TCHAR **items, int *flags, int num)
                        mii.fState |= MFS_CHECKED;
                mii.wID = i + 1;
                mii.dwTypeData = items[i];
-               mii.cch = _tcslen (mii.dwTypeData);
+               mii.cch = uaetcslen(mii.dwTypeData);
                InsertMenuItem (menu, -1, TRUE, &mii);
        }
        GetCursorPos (&pt);
index 5c4be63720488f6e1834c44c0538e669f2f3971d..3262d354a5d63ea1d4753a348556053da5fd6047 100644 (file)
@@ -1060,7 +1060,7 @@ static int scaleresource2 (struct newresource *res, HWND parent, int resize, int
        p = skiptextone (p);
        p = todword (p);
 
-       int remain = ps2 - (BYTE*)res->sourceresource;
+       size_t remain = ps2 - (BYTE*)res->sourceresource;
        memcpy (p, ps2, res->sourcesize - remain);
 
        int id2 = 0;
@@ -1603,10 +1603,10 @@ bool show_box_art(const TCHAR *path, const TCHAR *configpath)
                _tcscpy(config_path, configpath);
        }
 
-       int len = _tcslen(config_path);
+       int len = uaetcslen(config_path);
        if (len > 4 && !_tcsicmp(config_path + len - 4, _T(".uae")))
                config_path[len - 4] = 0;
-       if (_tcslen(config_path) > 0)
+       if (uaetcslen(config_path) > 0)
                SetWindowText(boxarthwnd, config_path);
 
        if (max_visible_boxart_images < 1) {
index 0aff01cadfbb5caad4d1ddba8c60dab9578cf102..ea615a2e6fcfa3bed5d5d766afc2ab0012a548f8 100644 (file)
@@ -772,7 +772,7 @@ static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
                    word alignment, so we keep them for the next line */
                 /* XXX: keep alignment to speed up transfer */
                 end_ptr = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;
-                copy_count = s->cirrus_srcptr_end - end_ptr;
+                copy_count = (int)(s->cirrus_srcptr_end - end_ptr);
                 memmove(s->cirrus_bltbuf, end_ptr, copy_count);
                 s->cirrus_srcptr = s->cirrus_bltbuf + copy_count;
                 s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;
index 5d1eeffacf35a1e95bca8d5b4255dbb56390f197..b0922a8e7ef8d32f89e1b00bd8cc2c15e9a04c0f 100644 (file)
@@ -836,7 +836,7 @@ static void es1370_transfer_audio (ES1370State *s, struct chan *d, int loop_sel,
     int left = ((size - cnt + 1) << 2) + d->leftover;
     int transferred = 0;
     int temp = audio_MIN (max, audio_MIN (left, csc_bytes));
-    int index = d - &s->chan[0];
+    int index = (int)(d - &s->chan[0]);
 
     addr += (cnt << 2) + d->leftover;
 
index 942db1760b354fedb3b99d0a240ea4bc5bf5495d..6dbae9b75eb56cb9460e751061aff1f1f5db85d0 100644 (file)
@@ -2379,7 +2379,7 @@ static void vga_update_text(void *opaque, console_ch_t *chardata)
     for (dst = chardata, i = 0; i < s->last_width * height; i ++)
         console_write_ch(dst ++, ' ');
 
-    size = strlen(msg_buffer);
+    size = (int)strlen(msg_buffer);
     width = (s->last_width - size) / 2;
     dst = chardata + s->last_width + width;
     for (i = 0; i < size; i ++)
index 8f861ae1d72972d27434f40e86e14ae4898010f2..7174214855acc5d200b87fffe17deb207c06ff97 100644 (file)
@@ -84,10 +84,10 @@ static void parsemessage(TCHAR *in, struct uae_prefs *p, TCHAR *out, int outsize
                for (;;) {
                        int ret;
                        tmpout[0] = 0;
-                       ret = cfgfile_modify (index, in, _tcslen (in), tmpout, sizeof (tmpout) / sizeof (TCHAR));
+                       ret = cfgfile_modify (index, in, uaetcslen(in), tmpout, sizeof (tmpout) / sizeof (TCHAR));
                        index++;
-                       if (_tcslen (tmpout) > 0) {
-                               if (_tcslen (out) == 0)
+                       if (uaetcslen(tmpout) > 0) {
+                               if (uaetcslen(out) == 0)
                                        _tcscat (out, _T("200 "));
                                _tcsncat (out, _T("\n"), outsize);
                                _tcsncat (out, tmpout, outsize);
@@ -261,7 +261,7 @@ int checkIPC (void *vipc, struct uae_prefs *p)
                if (ipc->binary) {
                        ok = WriteFile (ipc->hipc, &ipc->outbin[ipc->outmessages][0], ipc->outbinlen[ipc->outmessages], &ret, &ipc->ol);
                } else {
-                       ok = WriteFile (ipc->hipc, ipc->outmsg[ipc->outmessages], (_tcslen (ipc->outmsg[ipc->outmessages]) + 1) * sizeof (TCHAR), &ret, &ipc->ol);
+                       ok = WriteFile (ipc->hipc, ipc->outmsg[ipc->outmessages], (uaetcslen(ipc->outmsg[ipc->outmessages]) + 1) * sizeof (TCHAR), &ret, &ipc->ol);
                }
                xfree (ipc->outmsg[ipc->outmessages--]);
                err = GetLastError ();
@@ -338,16 +338,16 @@ int checkIPC (void *vipc, struct uae_prefs *p)
                if (type == 1) {
                        char *outp = uutf8 (out);
                        strcpy ((char*)ipc->outbuf, outp);
-                       outlen = strlen ((char*)ipc->outbuf) + sizeof (char);
+                       outlen = uaestrlen((char*)ipc->outbuf) + sizeof (char);
                        xfree (outp);
                } else if (type == 2) {
                        if (_tcslen (out) >= IPC_BUFFER_SIZE)
                                out[IPC_BUFFER_SIZE - 1] = 0;
                        _tcscpy ((TCHAR*)ipc->outbuf, out);
-                       outlen = (_tcsclen ((TCHAR*)ipc->outbuf) + 1) * sizeof (TCHAR);
+                       outlen = (uaetcslen((TCHAR*)ipc->outbuf) + 1) * sizeof (TCHAR);
                } else {
                        ua_copy ((uae_char*)ipc->outbuf, sizeof ipc->outbuf, out);
-                       outlen = strlen ((char*)ipc->outbuf) + sizeof (char);
+                       outlen = uaestrlen((char*)ipc->outbuf) + sizeof (char);
                }
                memset (&ipc->ol, 0, sizeof (OVERLAPPED));
                ipc->ol.hEvent = ipc->olevent;
index 761233bb8d7394b2f513f7fdde8bc9a4a3d9c979..4262e8e6904e3bd7d47edde5a3d97837734b728d 100644 (file)
@@ -451,7 +451,7 @@ static struct zfile *archive_do_zip (struct znode *zn, struct zfile *z, int flag
                int err = -1;
                if (!(flags & FILE_DELAYEDOPEN) || z->size <= PEEK_BYTES) {
                        unpack_log (_T("ZIP: unpacking %s, flags=%d\n"), name, flags);
-                       err = unzReadCurrentFile (uz, z->data, (size_t)z->datasize);
+                       err = unzReadCurrentFile (uz, z->data, (unsigned int)z->datasize);
                        unpack_log (_T("ZIP: unpacked, code=%d\n"), err);
                } else {
                        z->archiveparent = zfile_dup (zn->volume->archive);
@@ -460,11 +460,11 @@ static struct zfile *archive_do_zip (struct znode *zn, struct zfile *z, int flag
                                xfree (z->archiveparent->name);
                                z->archiveparent->name = my_strdup (tmp);
                                z->datasize = PEEK_BYTES;
-                               err = unzReadCurrentFile (uz, z->data, (size_t)z->datasize);
+                               err = unzReadCurrentFile (uz, z->data, (unsigned int)z->datasize);
                                unpack_log (_T("ZIP: unpacked, code=%d\n"), err);
                        } else {
                                unpack_log (_T("ZIP: unpacking %s (failed DELAYEDOPEN)\n"), name);
-                               err = unzReadCurrentFile (uz, z->data, (size_t)z->datasize);
+                               err = unzReadCurrentFile (uz, z->data, (unsigned int)z->datasize);
                                unpack_log (_T("ZIP: unpacked, code=%d\n"), err);
                        }
                }
@@ -903,7 +903,7 @@ static HRESULT __stdcall readCallback (int StreamID, uae_u64 offset, uae_u32 cou
        int ret;
 
        zfile_fseek (f, (long)offset, SEEK_SET);
-       ret = zfile_fread (buf, 1, count, f);
+       ret = (int)zfile_fread (buf, 1, count, f);
        if (processedSize)
                *processedSize = ret;
        return 0;
@@ -913,7 +913,7 @@ static HRESULT __stdcall writeCallback (int StreamID, uae_u64 offset, uae_u32 co
        struct zfile *f = arcacc_stack[StreamID];
        int ret;
 
-       ret = zfile_fwrite ((void*)buf, 1, count, f);
+       ret = (int)zfile_fwrite ((void*)buf, 1, count, f);
        if (processedSize)
                *processedSize = ret;
        if (ret != count)