write_log (_T("action_replay_load () ROM already loaded.\n"));
return 0;
}
- if (_tcslen (currprefs.cartfile) == 0 || currprefs.cartfile[0] == ':')
+ if (currprefs.cartfile[0] == '\0' || currprefs.cartfile[0] == ':')
return 0;
if (currprefs.cs_cd32fmv)
return 0;
}
if (!isinternal) {
- if (_tcslen (currprefs.cartfile) == 0)
+ if (currprefs.cartfile[0] == '\0')
return 0;
f = read_rom_name (currprefs.cartfile);
if(!f) {
void my_trim(TCHAR *s)
{
int len;
- while (_tcslen(s) > 0 && _tcscspn(s, _T("\t \r\n")) == 0)
+ while (s[0] != '\0' && _tcscspn(s, _T("\t \r\n")) == 0)
memmove(s, s + 1, (_tcslen(s + 1) + 1) * sizeof(TCHAR));
len = _tcslen(s);
while (len > 0 && _tcscspn(s + len - 1, _T("\t \r\n")) == 0)
dst[12+3] = 0x48; // size of hash table
dst[312] = dst[313] = dst[314] = dst[315] = (uae_u8)0xff; // bitmap valid
dst[316+2] = (block + 1) >> 8; dst[316+3] = (block + 1) & 255; // bitmap pointer
- char *s = ua ((disk_name && _tcslen (disk_name) > 0) ? disk_name : _T("empty"));
+ char *s = ua ((disk_name && disk_name[0] != '\0') ? disk_name : _T("empty"));
dst[432] = (uae_u8)strlen (s); // name length
strcpy ((char*)dst + 433, s); // name
xfree (s);
memcpy (dostrack, rawtrack, sizeof rawtrack);
dostrack[3] = 0;
dostrack[9] = (l * 8) >> 16; dostrack[10] = (l * 8) >> 8; dostrack[11] = (l * 8) >> 0;
- bool dodos = ffs || bootable || (disk_name && _tcslen (disk_name) > 0);
+ bool dodos = ffs || bootable || (disk_name && disk_name[0] != '\0');
for (i = 0; i < tracks; i++) {
uae_u8 tmp[3 * 4];
memcpy (tmp, rawtrack, sizeof rawtrack);
return false;
}
uae_u64 flags = uid->flags[i][j];
- if (uid->custom[i][j] && _tcslen (uid->custom[i][j]) > 0) {
+ if (uid->custom[i][j] && uid->custom[i][j][0] != '\0') {
_stprintf (p, _T("'%s'.%d"), uid->custom[i][j], (int)(flags & ID_FLAG_SAVE_MASK_CONFIG));
ok = true;
} else if (uid->eventid[i][j] > 0) {
uid->flags[i][sub] = flags;
uid->port[i][sub] = port;
xfree (uid->custom[i][sub]);
- uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? stripstrdup (custom) : NULL;
+ uid->custom[i][sub] = custom && custom[0] != '\0' ? stripstrdup (custom) : NULL;
ret = i;
} else if (type == IDEV_WIDGET_AXIS) {
i = num - id->get_widget_first (devnum, type) + ID_AXIS_OFFSET;
uid->flags[i][sub] = flags;
uid->port[i][sub] = port;
xfree (uid->custom[i][sub]);
- uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? stripstrdup (custom) : NULL;
+ uid->custom[i][sub] = custom && custom[0] != '\0' ? stripstrdup (custom) : NULL;
ret = i;
} else if (type == IDEV_WIDGET_KEY) {
i = num - id->get_widget_first (devnum, type);
uid->flags[i][sub] = flags;
uid->port[i][sub] = port;
xfree (uid->custom[i][sub]);
- uid->custom[i][sub] = custom && _tcslen (custom) > 0 ? stripstrdup (custom) : NULL;
+ uid->custom[i][sub] = custom && custom[0] != '\0' ? stripstrdup (custom) : NULL;
ret = i;
}
if (ret < 0)
if (IS_ERR(inode))
goto out_no_root;
TCHAR *volname = get_joliet_name(pri->volume_id, 28, sbi->s_utf8);
- if (volname && _tcslen(volname) > 0) {
+ if (volname && volname[0] != '\0') {
xfree(volume_name);
volume_name = volname;
write_log(_T("ISOFS: Joliet Volume ID: '%s'\n"), volume_name);
}
ii->unknown_media = sb->unknown_media;
if (sb->root) {
- if (_tcslen(sb->root->name) == 0) {
+ if (sb->root->name[0] == '\0') {
uae_tcslcpy(ii->volumename, _T("NO_LABEL"), sizeof(ii->volumename));
} else {
uae_tcslcpy (ii->volumename, sb->root->name, sizeof(ii->volumename));
int size, off;
bool ret = false;
- if (_tcslen (romextfile) == 0)
+ if (romextfile[0] == '\0')
return false;
if (is_arcadia_rom (romextfile) == ARCADIA_BIOS) {
extendedkickmem_type = EXTENDED_ROM_ARCADIA;
load_extendedkickstart (currprefs.romextfile2, EXTENDED_ROM_CDTV);
kickmem_bank.mask = ROM_SIZE_512 - 1;
if (!load_kickstart ()) {
- if (_tcslen (currprefs.romfile) > 0) {
+ if (currprefs.romfile[0] != '\0') {
error_log (_T("Failed to open '%s'\n"), currprefs.romfile);
notify_user (NUMSG_NOROM);
}
static void trim (TCHAR *s)
{
- while (_tcslen (s) > 0 && s[_tcslen (s) - 1] == ' ')
+ while (s[0] != '\0' && s[_tcslen (s) - 1] == ' ')
s[_tcslen (s) - 1] = 0;
}
tmp = (TCHAR *)out;
lines_have = SendMessage(hWnd, EM_GETLINECOUNT, 0, 0);
- while (_tcslen(tmp) > 0 && (p = _tcschr(tmp, '\n'))) {
+ while (tmp[0] != '\0' && (p = _tcschr(tmp, '\n'))) {
lines_new++;
tmp = p + 1;
}
buf = xcalloc(TCHAR, pos + 2);
_tcsncpy(buf, tmp, pos - 1);
_tcscat(buf, linebreak);
- } else if (_tcslen(tmp) == 0) {
+ } else if (tmp[0] == '\0') {
leave = 1;
} else {
count = SendMessage(hOutput, EM_GETLINECOUNT, 0, 0);
GetWindowText(hedit, txt, MAX_LINEWIDTH + 1);
p = txt;
ignore_ws(&p);
- if ((GetWindowTextLength(hedit) == 0) || (_tcslen(p) == 0))
+ if ((GetWindowTextLength(hedit) == 0) || (p[0] == '\0'))
acceptinput = FALSE;
while (PeekMessage(&msg, hedit, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
double value;
errno = 0;
value = _tcstod(txt, &stopstr);
- if (_tcslen(stopstr) == 0 && errno == 0)
+ if (stopstr[0] == '\0' && errno == 0)
regs.fp[index].fp = _tcstod(txt, &stopstr);
}
else {
static void trim (TCHAR *s)
{
- while(_tcslen(s) > 0 && s[_tcslen(s) - 1] == ' ')
+ while(s[0] != '\0' && s[_tcslen(s) - 1] == ' ')
s[_tcslen(s) - 1] = 0;
}
_tcscpy (udi->device_name, udi->device_path);
}
udi->removablemedia = devDesc->RemovableMedia;
- while (_tcslen(udi->device_name) > 0 && udi->device_name[_tcslen(udi->device_name) - 1] == ':')
+ while (udi->device_name[0] != '\0' && udi->device_name[_tcslen(udi->device_name) - 1] == ':')
udi->device_name[_tcslen(udi->device_name) - 1] = 0;
for (int i = 0; i < _tcslen(udi->device_name); i++) {
if (udi->device_name[i] == ':')
inputdevice_compa_clear (&changed_prefs, inputmap_port);
- if (_tcslen (name) == 0) {
+ if (name[0] == '\0') {
inputdevice_joyport_config (&changed_prefs, _T("none"), NULL, inputmap_port, 0, 0, 0, true);
return TRUE;
}
cnt = 0;
while (max--) {
p2 = _tcschr (p1, '\n');
- if (p2 && _tcslen (p2) > 0) {
+ if (p2 && p2[0] != '\0') {
TCHAR tmp2[100];
*p2++ = 0;
memset (&desc, 0, sizeof desc);
_ftprintf (debugfile, _T("%s"), bufp);
}
lfdetected = 0;
- if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n')
+ if (bufp[0] != '\0' && bufp[_tcslen(bufp) - 1] == '\n')
lfdetected = 1;
va_end (parms);
if (bufp != buffer)
_ftprintf (debugfile, _T("%s"), bufp);
}
lfdetected = 0;
- if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n')
+ if (bufp[0] != '\0' && bufp[_tcslen (bufp) - 1] == '\n')
lfdetected = 1;
va_end (parms);
if (bufp != buffer)
#endif
lfdetected = 0;
- if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n')
+ if (bufp[0] != '\0' && bufp[_tcslen (bufp) - 1] == '\n')
lfdetected = 1;
va_end (parms);
if (bufp != buffer)
table68k[opc].mnemo = lookuptab[find].mnemo;
break;
}
- if (_tcslen (lookuptab[find].name) == 0)
+ if (lookuptab[find].name[0] == '\0')
abort();
}
}
if (parent->partnumber == NULL)
parent->partnumber = my_strdup (_T(""));
newpn = xcalloc (TCHAR, _tcslen (parent->partnumber) + 1 + _tcslen (rd->partnumber) + 1);
- if (_tcslen (parent->partnumber) > 0) {
+ if (parent->partnumber[0] != '\0') {
_tcscpy (newpn, parent->partnumber);
_tcscat (newpn, _T("/"));
}
_stprintf (name + _tcslen (name), _T(" rev %d.%d"), rd->subver, rd->subrev);
if (rd->size > 0)
_stprintf (name + _tcslen (name), _T(" (%dk)"), (rd->size + 1023) / 1024);
- if (rd->partnumber && _tcslen (rd->partnumber) > 0)
+ if (rd->partnumber && rd->partnumber[0] != '\0')
_stprintf (name + _tcslen (name), _T(" [%s]"), rd->partnumber);
}
struct romlist *rl = romlist_getrl (rd);
uae_char tmp[11];
- if (!rl || _tcslen (rl->path) == 0)
+ if (!rl || rl->path[0] == '\0')
return 0;
zf = zfile_fopen (rl->path, _T("rb"), ZFD_NORMAL);
if (!zf)
struct boardromconfig *brc = get_device_rom(p, romtype, devnum, &idx);
if (brc) {
const TCHAR *romname = brc->roms[idx].romfile;
- if (_tcslen(romname) == 0)
+ if (romname[0] == '\0')
return -1;
if (isspecialrom(romname))
return 0;
return;
}
// LF at the end = have at least one filemark
- if (_tcslen(name) > 0 && (name[_tcslen(name) - 1] == 10 || name[_tcslen(name) - 1] == 13)) {
+ if (name[0] != '\0' && (name[_tcslen(name) - 1] == 10 || name[_tcslen(name) - 1] == 13)) {
tape->last_filemark = true;
}
my_trim (name);