p += bdlen;
}
for (;;) {
- int rem = plen - (p - scsi_data);
+ int rem = (int)(plen - (p - scsi_data));
if (!rem)
break;
if (rem < 2)
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);
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]);
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]);
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]);
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
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++) {
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;
}
if (OpenClipboard (0)) {
clipdat = (TCHAR*)GetClipboardData (CF_UNICODETEXT);
if (clipdat) {
- clipsize = _tcslen (clipdat);
+ clipsize = uaetcslen(clipdat);
clipsize++;
return clipsize;
}
if (OpenClipboard (0)) {
EmptyClipboard();
- slen = _tcslen (s);
+ slen = uaetcslen(s);
if (p)
GlobalFree (p);
p = (LPTSTR)GlobalAlloc (GMEM_MOVEABLE, (slen + 1) * sizeof (TCHAR));
{
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))
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)
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);
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;
} 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;
{
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;
memcpy (data + blocksize, p + readblocksize, SUB_CHANNEL_SIZE);
data += blocksize + SUB_CHANNEL_SIZE;
}
- ret += data - odata;
+ ret += (int)(data - odata);
sector++;
}
}
{
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;
// 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++;
// 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);
// 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);
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];
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)
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;
}
}
- tsize = p - iff - 8;
+ tsize = (int)(p - iff - 8);
p = iff + 4;
p[0] = tsize >> 24;
p[1] = tsize >> 16;
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';
}
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 {
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)
strp[1] = strp[0];
strp++;
// add trailing zeros
- i = strlen (strp);
+ i = uaestrlen(strp);
cp = strp + i;
while (i < ndigits) {
*cp++ = '0';
}
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);
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)
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 {
}
}
} 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;
}
psbuffer[0] = 0;
psbuffers = 0;
strcpy (prtbuf, "%!PS");
- prtbufbytes = strlen (prtbuf);
+ prtbufbytes = uaestrlen(prtbuf);
flushprtbuf ();
write_log (_T("PostScript start detected..\n"));
return;
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;
*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)
{
#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--;
#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--;
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;
}
continue;
}
- matchcount += gwwcnt;
+ matchcount += (int)gwwcnt;
if (gwwcnt == 0) {
continue;
int y, x, realoffset;
if (p >= src + off) {
- realoffset = p - (src + off);
+ realoffset = (int)(p - (src + off));
} else {
realoffset = 0;
}
uae_thread_id uae_thread_get_id(void)
{
- return (uae_thread_id)GetCurrentThreadId();
+ return (uae_thread_id)(INT_PTR)GetCurrentThreadId();
}
#ifndef _CONSOLE
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;
}
}
if (_tcslen(tmp) >= *size)
tmp[(*size) - 1] = 0;
_tcscpy (str, tmp);
- *size = _tcslen(str);
+ *size = uaetcslen(str);
ret = 1;
}
xfree (tmp);
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);
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);
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;
{
int l;
- l = _tcslen (s) - 1;
+ l = uaetcslen(s) - 1;
while (l >= 0) {
if (s[l] == '.')
s[l] = 0;
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)
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);
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++;
}
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();
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) {
}
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;
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) {
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);
}
}
{
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;
TCHAR **arg;
int i, j, k, stop;
- if (_tcslen (command) == 0)
+ if (uaetcslen(command) == 0)
return;
i = j = 0;
stop = 0;
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;
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] == ':')
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);
}
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;
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;
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) {
musi.UserStreamCount++;
musp->Type = LastReservedStream + musi.UserStreamCount;
musp->Buffer = log;
- musp->BufferSize = len;
+ musp->BufferSize = (ULONG)len;
}
}
musi.UserStreamCount++;
musp->Type = LastReservedStream + musi.UserStreamCount;
musp->Buffer = (void*)config;
- musp->BufferSize = len;
+ musp->BufferSize = (ULONG)len;
}
if (musi.UserStreamCount > 0)
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;
(*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);
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;
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++;
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);
}
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;
}
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;
}
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++;
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;
return 0;
}
_stprintf (out, _T("%s\\%s"), s, s + index);
- index += _tcslen (s + index) + 1;
+ index += uaetcslen(s + index) + 1;
return 1;
}
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) {
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);
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;
_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) {
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;
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;
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 ++)
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);
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 ();
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;
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);
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);
}
}
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;
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)