summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-10-22 16:37:12 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-22 16:37:12 +0200
commita6bdefec8c76e9878b634119c56438a7673b0385 (patch)
tree9b435836a12773fe5b84cf1fd04866ecd9ecc2da
parent5f3d4fb33da4304e417a0e142e82e3d292646465 (diff)
more TRUE/FALSE cleanup (nw)
-rw-r--r--src/emu/bookkeeping.cpp2
-rw-r--r--src/emu/debug/debugcmd.cpp38
-rw-r--r--src/emu/debug/debugcon.cpp19
-rw-r--r--src/emu/debug/debugcpu.cpp20
-rw-r--r--src/emu/debug/debugcpu.h20
-rw-r--r--src/emu/debug/dvmemory.cpp2
-rw-r--r--src/emu/debugger.cpp4
-rw-r--r--src/emu/divtlb.cpp8
-rw-r--r--src/emu/divtlb.h2
-rw-r--r--src/emu/emumem.cpp2
-rw-r--r--src/emu/fileio.cpp4
-rw-r--r--src/emu/input.cpp4
-rw-r--r--src/emu/ioport.cpp4
-rw-r--r--src/emu/natkeyboard.cpp8
-rw-r--r--src/emu/render.cpp2
-rw-r--r--src/emu/rendutil.cpp2
-rw-r--r--src/emu/tilemap.cpp2
-rw-r--r--src/emu/uiinput.cpp6
-rw-r--r--src/emu/uiinput.h4
-rw-r--r--src/emu/video.h8
-rw-r--r--src/frontend/mame/ui/datmenu.cpp2
-rw-r--r--src/frontend/mame/ui/menu.cpp6
-rw-r--r--src/frontend/mame/ui/selgame.cpp2
-rw-r--r--src/frontend/mame/ui/selmenu.cpp22
-rw-r--r--src/frontend/mame/ui/selsoft.cpp2
-rw-r--r--src/frontend/mame/ui/ui.cpp2
-rw-r--r--src/ldplayer/ldplayer.cpp6
-rw-r--r--src/lib/formats/ap2_dsk.cpp4
-rw-r--r--src/lib/formats/ap_dsk35.cpp12
-rw-r--r--src/lib/formats/basicdsk.cpp16
-rw-r--r--src/lib/formats/coco_cas.cpp8
-rw-r--r--src/lib/formats/cqm_dsk.cpp10
-rw-r--r--src/lib/formats/dsk_dsk.cpp18
-rw-r--r--src/lib/formats/flopimg.cpp22
-rw-r--r--src/lib/formats/imageutl.cpp10
-rw-r--r--src/lib/formats/imageutl.h2
-rw-r--r--src/lib/formats/imd_dsk.cpp12
-rw-r--r--src/lib/formats/sorc_dsk.cpp16
-rw-r--r--src/lib/formats/td0_dsk.cpp12
-rw-r--r--src/lib/formats/thom_dsk.cpp18
-rw-r--r--src/lib/formats/wavfile.cpp10
-rw-r--r--src/lib/util/png.cpp14
-rw-r--r--src/lib/util/pool.cpp24
-rw-r--r--src/lib/util/pool.h8
-rw-r--r--src/lib/util/vbiparse.cpp6
-rw-r--r--src/lib/util/vbiparse.h2
-rw-r--r--src/lib/util/xmlfile.cpp10
-rw-r--r--src/lib/util/zippath.cpp6
-rw-r--r--src/lib/util/zippath.h4
49 files changed, 224 insertions, 223 deletions
diff --git a/src/emu/bookkeeping.cpp b/src/emu/bookkeeping.cpp
index b93493db9a4..0fb4f2f9386 100644
--- a/src/emu/bookkeeping.cpp
+++ b/src/emu/bookkeeping.cpp
@@ -198,7 +198,7 @@ void bookkeeping_manager::coin_lockout_w(int num,int on)
int bookkeeping_manager::coin_lockout_get_state(int num)
{
if (num >= ARRAY_LENGTH(m_coinlockedout))
- return FALSE;
+ return false;
return m_coinlockedout[num];
}
diff --git a/src/emu/debug/debugcmd.cpp b/src/emu/debug/debugcmd.cpp
index 323a0e2c746..620f83985b5 100644
--- a/src/emu/debug/debugcmd.cpp
+++ b/src/emu/debug/debugcmd.cpp
@@ -34,7 +34,7 @@ const size_t debugger_commands::MAX_GLOBALS = 1000;
***************************************************************************/
/*-------------------------------------------------
- cheat_address_is_valid - return TRUE if the
+ cheat_address_is_valid - return true if the
given address is valid for cheating
-------------------------------------------------*/
@@ -90,7 +90,7 @@ uint64_t debugger_commands::cheat_byte_swap(const cheat_system *cheatsys, uint64
uint64_t debugger_commands::cheat_read_extended(const cheat_system *cheatsys, address_space &space, offs_t address)
{
- return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, m_cpu.read_memory(space, address, cheatsys->width, TRUE)));
+ return cheat_sign_extend(cheatsys, cheat_byte_swap(cheatsys, m_cpu.read_memory(space, address, cheatsys->width, true)));
}
debugger_commands::debugger_commands(running_machine& machine, debugger_cpu& cpu, debugger_console& console)
@@ -1630,7 +1630,7 @@ void debugger_commands::execute_save(int ref, int params, const char *param[])
/* now write the data out */
for (i = offset; i <= endoffset; i++)
{
- uint8_t byte = m_cpu.read_byte(*space, i, TRUE);
+ uint8_t byte = m_cpu.read_byte(*space, i, true);
fwrite(&byte, 1, 1, f);
}
@@ -1767,7 +1767,7 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
offs_t curaddr = i + j;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
{
- uint64_t value = m_cpu.read_memory(*space, i + j, width, TRUE);
+ uint64_t value = m_cpu.read_memory(*space, i + j, width, true);
util::stream_format(output, " %0*X", width * 2, value);
}
else
@@ -1788,7 +1788,7 @@ void debugger_commands::execute_dump(int ref, int params, const char *param[])
offs_t curaddr = i + j;
if (space->device().memory().translate(space->spacenum(), TRANSLATE_READ_DEBUG, curaddr))
{
- uint8_t byte = m_cpu.read_byte(*space, i + j, TRUE);
+ uint8_t byte = m_cpu.read_byte(*space, i + j, true);
util::stream_format(output, "%c", (byte >= 32 && byte < 127) ? byte : '.');
}
else
@@ -1832,16 +1832,16 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param
if (ref == 0)
{
m_cheat.width = 1;
- m_cheat.signed_cheat = FALSE;
- m_cheat.swapped_cheat = FALSE;
+ m_cheat.signed_cheat = false;
+ m_cheat.swapped_cheat = false;
if (params > 0)
{
char *srtpnt = (char*)param[0];
if (*srtpnt == 's')
- m_cheat.signed_cheat = TRUE;
+ m_cheat.signed_cheat = true;
else if (*srtpnt == 'u')
- m_cheat.signed_cheat = FALSE;
+ m_cheat.signed_cheat = false;
else
{
m_console.printf("Invalid sign: expected s or u\n");
@@ -1863,9 +1863,9 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param
}
if (*(++srtpnt) == 's')
- m_cheat.swapped_cheat = TRUE;
+ m_cheat.swapped_cheat = true;
else
- m_cheat.swapped_cheat = FALSE;
+ m_cheat.swapped_cheat = false;
}
}
@@ -1877,14 +1877,14 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param
cheat_region[region_count].offset = space->address_to_byte(entry.m_addrstart) & space->bytemask();
cheat_region[region_count].endoffset = space->address_to_byte(entry.m_addrend) & space->bytemask();
cheat_region[region_count].share = entry.m_share;
- cheat_region[region_count].disabled = (entry.m_write.m_type == AMH_RAM) ? FALSE : TRUE;
+ cheat_region[region_count].disabled = (entry.m_write.m_type == AMH_RAM) ? false : true;
/* disable double share regions */
if (entry.m_share != nullptr)
for (i = 0; i < region_count; i++)
if (cheat_region[i].share != nullptr)
if (strcmp(cheat_region[i].share, entry.m_share) == 0)
- cheat_region[region_count].disabled = TRUE;
+ cheat_region[region_count].disabled = true;
region_count++;
}
@@ -1901,7 +1901,7 @@ void debugger_commands::execute_cheatinit(int ref, int params, const char *param
cheat_region[region_count].offset = space->address_to_byte(offset) & space->bytemask();
cheat_region[region_count].endoffset = space->address_to_byte(offset + length - 1) & space->bytemask();
cheat_region[region_count].share = nullptr;
- cheat_region[region_count].disabled = FALSE;
+ cheat_region[region_count].disabled = false;
region_count++;
}
@@ -2040,7 +2040,7 @@ void debugger_commands::execute_cheatnext(int ref, int params, const char *param
{
uint64_t cheat_value = cheat_read_extended(&m_cheat, *space, m_cheat.cheatmap[cheatindex].offset);
uint64_t comp_byte = (ref == 0) ? m_cheat.cheatmap[cheatindex].previous_value : m_cheat.cheatmap[cheatindex].first_value;
- uint8_t disable_byte = FALSE;
+ uint8_t disable_byte = false;
switch (condition)
{
@@ -2326,10 +2326,10 @@ void debugger_commands::execute_find(int ref, int params, const char *param[])
{
switch (data_size[j])
{
- case 1: match = ((uint8_t)m_cpu.read_byte(*space, i + suboffset, TRUE) == (uint8_t)data_to_find[j]); break;
- case 2: match = ((uint16_t)m_cpu.read_word(*space, i + suboffset, TRUE) == (uint16_t)data_to_find[j]); break;
- case 4: match = ((uint32_t)m_cpu.read_dword(*space, i + suboffset, TRUE) == (uint32_t)data_to_find[j]); break;
- case 8: match = ((uint64_t)m_cpu.read_qword(*space, i + suboffset, TRUE) == (uint64_t)data_to_find[j]); break;
+ case 1: match = ((uint8_t)m_cpu.read_byte(*space, i + suboffset, true) == (uint8_t)data_to_find[j]); break;
+ case 2: match = ((uint16_t)m_cpu.read_word(*space, i + suboffset, true) == (uint16_t)data_to_find[j]); break;
+ case 4: match = ((uint32_t)m_cpu.read_dword(*space, i + suboffset, true) == (uint32_t)data_to_find[j]); break;
+ case 8: match = ((uint64_t)m_cpu.read_qword(*space, i + suboffset, true) == (uint64_t)data_to_find[j]); break;
default: /* all other cases are wildcards */ break;
}
suboffset += data_size[j] & 0x0f;
diff --git a/src/emu/debug/debugcon.cpp b/src/emu/debug/debugcon.cpp
index 8d40bf6c449..c9762bf927d 100644
--- a/src/emu/debug/debugcon.cpp
+++ b/src/emu/debug/debugcon.cpp
@@ -242,7 +242,8 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
/* loop over all semicolon-separated stuff */
for (p = command; *p != 0; )
{
- int paramcount = 0, foundend = FALSE, instring = FALSE, isexpr = FALSE, parendex = 0;
+ int paramcount = 0, parendex = 0;
+ bool foundend = false, instring = false, isexpr = false;
/* find a semicolon or the end */
for (params[paramcount++] = p; !foundend; p++)
@@ -251,13 +252,13 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
if (instring)
{
if (c == '"' && p[-1] != '\\')
- instring = FALSE;
+ instring = false;
}
else
{
switch (c)
{
- case '"': instring = TRUE; break;
+ case '"': instring = true; break;
case '(':
case '[':
case '{': parens[parendex++] = c; break;
@@ -265,11 +266,11 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
case ']': if (parendex == 0 || parens[--parendex] != '[') return MAKE_CMDERR_UNBALANCED_PARENS(p - command); break;
case '}': if (parendex == 0 || parens[--parendex] != '{') return MAKE_CMDERR_UNBALANCED_PARENS(p - command); break;
case ',': if (parendex == 0) params[paramcount++] = p; break;
- case ';': if (parendex == 0) foundend = TRUE; break;
- case '-': if (parendex == 0 && paramcount == 1 && p[1] == '-') isexpr = TRUE; *p = c; break;
- case '+': if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = TRUE; *p = c; break;
- case '=': if (parendex == 0 && paramcount == 1) isexpr = TRUE; *p = c; break;
- case 0: foundend = TRUE; break;
+ case ';': if (parendex == 0) foundend = true; break;
+ case '-': if (parendex == 0 && paramcount == 1 && p[1] == '-') isexpr = true; *p = c; break;
+ case '+': if (parendex == 0 && paramcount == 1 && p[1] == '+') isexpr = true; *p = c; break;
+ case '=': if (parendex == 0 && paramcount == 1) isexpr = true; *p = c; break;
+ case 0: foundend = true; break;
default: *p = tolower((uint8_t)c); break;
}
}
@@ -291,7 +292,7 @@ CMDERR debugger_console::internal_parse_command(const char *original_command, bo
/* allow for "do" commands */
if (tolower((uint8_t)command_start[0] == 'd') && tolower((uint8_t)command_start[1] == 'o') && isspace((uint8_t)command_start[2]))
{
- isexpr = TRUE;
+ isexpr = true;
command_start += 3;
}
diff --git a/src/emu/debug/debugcpu.cpp b/src/emu/debug/debugcpu.cpp
index 45cf761fe1a..4690298e9a3 100644
--- a/src/emu/debug/debugcpu.cpp
+++ b/src/emu/debug/debugcpu.cpp
@@ -357,7 +357,7 @@ bool debugger_cpu::comment_load(bool is_inline)
memory space
-------------------------------------------------*/
-uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, int apply_translation)
+uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, bool apply_translation)
{
device_memory_interface &memory = space.device().memory();
@@ -396,7 +396,7 @@ uint8_t debugger_cpu::read_byte(address_space &space, offs_t address, int apply_
memory space
-------------------------------------------------*/
-uint16_t debugger_cpu::read_word(address_space &space, offs_t address, int apply_translation)
+uint16_t debugger_cpu::read_word(address_space &space, offs_t address, bool apply_translation)
{
/* mask against the logical byte mask */
address &= space.logbytemask();
@@ -450,7 +450,7 @@ uint16_t debugger_cpu::read_word(address_space &space, offs_t address, int apply
memory space
-------------------------------------------------*/
-uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, int apply_translation)
+uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, bool apply_translation)
{
/* mask against the logical byte mask */
address &= space.logbytemask();
@@ -503,7 +503,7 @@ uint32_t debugger_cpu::read_dword(address_space &space, offs_t address, int appl
memory space
-------------------------------------------------*/
-uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, int apply_translation)
+uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, bool apply_translation)
{
/* mask against the logical byte mask */
address &= space.logbytemask();
@@ -557,7 +557,7 @@ uint64_t debugger_cpu::read_qword(address_space &space, offs_t address, int appl
from the specified memory space
-------------------------------------------------*/
-uint64_t debugger_cpu::read_memory(address_space &space, offs_t address, int size, int apply_translation)
+uint64_t debugger_cpu::read_memory(address_space &space, offs_t address, int size, bool apply_translation)
{
uint64_t result = ~(uint64_t)0 >> (64 - 8*size);
switch (size)
@@ -576,7 +576,7 @@ uint64_t debugger_cpu::read_memory(address_space &space, offs_t address, int siz
memory space
-------------------------------------------------*/
-void debugger_cpu::write_byte(address_space &space, offs_t address, uint8_t data, int apply_translation)
+void debugger_cpu::write_byte(address_space &space, offs_t address, uint8_t data, bool apply_translation)
{
device_memory_interface &memory = space.device().memory();
@@ -612,7 +612,7 @@ void debugger_cpu::write_byte(address_space &space, offs_t address, uint8_t data
memory space
-------------------------------------------------*/
-void debugger_cpu::write_word(address_space &space, offs_t address, uint16_t data, int apply_translation)
+void debugger_cpu::write_word(address_space &space, offs_t address, uint16_t data, bool apply_translation)
{
/* mask against the logical byte mask */
address &= space.logbytemask();
@@ -667,7 +667,7 @@ void debugger_cpu::write_word(address_space &space, offs_t address, uint16_t dat
memory space
-------------------------------------------------*/
-void debugger_cpu::write_dword(address_space &space, offs_t address, uint32_t data, int apply_translation)
+void debugger_cpu::write_dword(address_space &space, offs_t address, uint32_t data, bool apply_translation)
{
/* mask against the logical byte mask */
address &= space.logbytemask();
@@ -721,7 +721,7 @@ void debugger_cpu::write_dword(address_space &space, offs_t address, uint32_t da
memory space
-------------------------------------------------*/
-void debugger_cpu::write_qword(address_space &space, offs_t address, uint64_t data, int apply_translation)
+void debugger_cpu::write_qword(address_space &space, offs_t address, uint64_t data, bool apply_translation)
{
/* mask against the logical byte mask */
address &= space.logbytemask();
@@ -776,7 +776,7 @@ void debugger_cpu::write_qword(address_space &space, offs_t address, uint64_t da
specified memory space
-------------------------------------------------*/
-void debugger_cpu::write_memory(address_space &space, offs_t address, uint64_t data, int size, int apply_translation)
+void debugger_cpu::write_memory(address_space &space, offs_t address, uint64_t data, int size, bool apply_translation)
{
switch (size)
{
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index fd403c17a74..931824ca3f1 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -510,34 +510,34 @@ public:
/* ----- debugger memory accessors ----- */
/* return a byte from the specified memory space */
- uint8_t read_byte(address_space &space, offs_t address, int apply_translation);
+ uint8_t read_byte(address_space &space, offs_t address, bool apply_translation);
/* return a word from the specified memory space */
- uint16_t read_word(address_space &space, offs_t address, int apply_translation);
+ uint16_t read_word(address_space &space, offs_t address, bool apply_translation);
/* return a dword from the specified memory space */
- uint32_t read_dword(address_space &space, offs_t address, int apply_translation);
+ uint32_t read_dword(address_space &space, offs_t address, bool apply_translation);
/* return a qword from the specified memory space */
- uint64_t read_qword(address_space &space, offs_t address, int apply_translation);
+ uint64_t read_qword(address_space &space, offs_t address, bool apply_translation);
/* return 1,2,4 or 8 bytes from the specified memory space */
- uint64_t read_memory(address_space &space, offs_t address, int size, int apply_translation);
+ uint64_t read_memory(address_space &space, offs_t address, int size, bool apply_translation);
/* write a byte to the specified memory space */
- void write_byte(address_space &space, offs_t address, uint8_t data, int apply_translation);
+ void write_byte(address_space &space, offs_t address, uint8_t data, bool apply_translation);
/* write a word to the specified memory space */
- void write_word(address_space &space, offs_t address, uint16_t data, int apply_translation);
+ void write_word(address_space &space, offs_t address, uint16_t data, bool apply_translation);
/* write a dword to the specified memory space */
- void write_dword(address_space &space, offs_t address, uint32_t data, int apply_translation);
+ void write_dword(address_space &space, offs_t address, uint32_t data, bool apply_translation);
/* write a qword to the specified memory space */
- void write_qword(address_space &space, offs_t address, uint64_t data, int apply_translation);
+ void write_qword(address_space &space, offs_t address, uint64_t data, bool apply_translation);
/* write 1,2,4 or 8 bytes to the specified memory space */
- void write_memory(address_space &space, offs_t address, uint64_t data, int size, int apply_translation);
+ void write_memory(address_space &space, offs_t address, uint64_t data, int size, bool apply_translation);
/* read 1,2,4 or 8 bytes at the given offset from opcode space */
uint64_t read_opcode(address_space &space, offs_t offset, int size);
diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp
index 84c0c911a1a..8a6b1db1ee9 100644
--- a/src/emu/debug/dvmemory.cpp
+++ b/src/emu/debug/dvmemory.cpp
@@ -972,7 +972,7 @@ void debug_view_memory::set_reverse(bool reverse)
//-------------------------------------------------
-// set_ascii - specify TRUE if the memory view
+// set_ascii - specify true if the memory view
// should display an ASCII representation
//-------------------------------------------------
diff --git a/src/emu/debugger.cpp b/src/emu/debugger.cpp
index b2e5bfd3fd6..188b74cb3b7 100644
--- a/src/emu/debugger.cpp
+++ b/src/emu/debugger.cpp
@@ -21,7 +21,7 @@
***************************************************************************/
static running_machine *g_machine = nullptr;
-static int g_atexit_registered = FALSE;
+static bool g_atexit_registered = false;
/*-------------------------------------------------
debugger_instruction_hook - CPU cores call
@@ -132,7 +132,7 @@ debugger_manager::debugger_manager(running_machine &machine)
/* register an atexit handler if we haven't yet */
if (!g_atexit_registered)
atexit(debugger_flush_all_traces_on_abnormal_exit);
- g_atexit_registered = TRUE;
+ g_atexit_registered = true;
/* initialize osd debugger features */
machine.osd().init_debugger();
diff --git a/src/emu/divtlb.cpp b/src/emu/divtlb.cpp
index 942202afc35..2a3cad48bf3 100644
--- a/src/emu/divtlb.cpp
+++ b/src/emu/divtlb.cpp
@@ -139,7 +139,7 @@ void device_vtlb_interface::interface_pre_reset()
// response to an unmapped access
//-------------------------------------------------
-int device_vtlb_interface::vtlb_fill(offs_t address, int intention)
+bool device_vtlb_interface::vtlb_fill(offs_t address, int intention)
{
offs_t tableindex = address >> m_pageshift;
vtlb_entry entry = m_table[tableindex];
@@ -158,7 +158,7 @@ int device_vtlb_interface::vtlb_fill(offs_t address, int intention)
#if PRINTF_TLB
osd_printf_debug("failed: no dynamic entries\n");
#endif
- return FALSE;
+ return false;
}
// ask the CPU core to translate for us
@@ -168,7 +168,7 @@ int device_vtlb_interface::vtlb_fill(offs_t address, int intention)
#if PRINTF_TLB
osd_printf_debug("failed: no translation\n");
#endif
- return FALSE;
+ return false;
}
// if this is the first successful translation for this address, allocate a new entry
@@ -206,7 +206,7 @@ int device_vtlb_interface::vtlb_fill(offs_t address, int intention)
// add the intention to the list of valid intentions and store
entry |= 1 << (intention & (TRANSLATE_TYPE_MASK | TRANSLATE_USER_MASK));
m_table[tableindex] = entry;
- return TRUE;
+ return true;
}
diff --git a/src/emu/divtlb.h b/src/emu/divtlb.h
index 31439d97db9..46746f91d60 100644
--- a/src/emu/divtlb.h
+++ b/src/emu/divtlb.h
@@ -54,7 +54,7 @@ public:
void set_vtlb_fixed_entries(int entries) { m_fixed = entries; }
// filling
- int vtlb_fill(offs_t address, int intention);
+ bool vtlb_fill(offs_t address, int intention);
void vtlb_load(int entrynum, int numpages, offs_t address, vtlb_entry value);
void vtlb_dynload(uint32_t index, offs_t address, vtlb_entry value);
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp
index 729386bfcb5..fac6d1cca27 100644
--- a/src/emu/emumem.cpp
+++ b/src/emu/emumem.cpp
@@ -3925,7 +3925,7 @@ bool direct_read_data::set_direct_region(offs_t &byteaddress)
// find or allocate a matching range
direct_range *range = find_range(overrideaddress, m_entry);
- // if we don't map to a bank, return FALSE
+ // if we don't map to a bank, return false
if (m_entry < STATIC_BANK1 || m_entry > STATIC_BANKMAX)
{
// ensure future updates to land here as well until we get back into a bank
diff --git a/src/emu/fileio.cpp b/src/emu/fileio.cpp
index 45b0dc98d53..4670fd2b789 100644
--- a/src/emu/fileio.cpp
+++ b/src/emu/fileio.cpp
@@ -81,7 +81,7 @@ path_iterator &path_iterator::operator=(path_iterator const &that)
bool path_iterator::next(std::string &buffer, const char *name)
{
- // if none left, return FALSE to indicate we are done
+ // if none left, return false to indicate we are done
if (!m_is_first && (m_searchpath.cend() == m_current))
return false;
@@ -101,7 +101,7 @@ bool path_iterator::next(std::string &buffer, const char *name)
buffer.append(name);
}
- // bump the index and return TRUE
+ // bump the index and return true
m_is_first = false;
return true;
}
diff --git a/src/emu/input.cpp b/src/emu/input.cpp
index abcf8c0592e..2abcfd9dac7 100644
--- a/src/emu/input.cpp
+++ b/src/emu/input.cpp
@@ -621,7 +621,7 @@ input_code::input_code(input_device &device, input_item_id itemid)
input_seq &input_seq::operator+=(input_code code)
{
- // if not enough room, return FALSE
+ // if not enough room, return false
int curlength = length();
if (curlength < ARRAY_LENGTH(m_code) - 1)
{
@@ -2439,7 +2439,7 @@ int32_t input_device_absolute_item::read_as_switch(input_item_modifier modifier)
}
}
- // positive/negative: TRUE if past the deadzone in either direction
+ // positive/negative: true if past the deadzone in either direction
if (modifier == ITEM_MODIFIER_POS || modifier == ITEM_MODIFIER_RIGHT || modifier == ITEM_MODIFIER_DOWN)
return (result > 0);
else if (modifier == ITEM_MODIFIER_NEG || modifier == ITEM_MODIFIER_LEFT || modifier == ITEM_MODIFIER_UP)
diff --git a/src/emu/ioport.cpp b/src/emu/ioport.cpp
index dfd444cd1af..b87dff6931a 100644
--- a/src/emu/ioport.cpp
+++ b/src/emu/ioport.cpp
@@ -1143,7 +1143,7 @@ void ioport_field::frame_update(ioport_value &result)
}
// for toggle switches, the current value is folded into the port's default value
- // so we always return FALSE here
+ // so we always return false here
if (m_live->toggle)
curstate = false;
@@ -2974,7 +2974,7 @@ const char *ioport_configurer::string_from_token(const char *string)
if (uintptr_t(string) >= INPUT_STRING_COUNT)
return string;
-#if FALSE // Set TRUE, If you want to take care missing-token or wrong-sorting
+#if false // Set true, If you want to take care missing-token or wrong-sorting
// otherwise, scan the list for a matching string and return it
{
diff --git a/src/emu/natkeyboard.cpp b/src/emu/natkeyboard.cpp
index 0ecf260353a..fd39bc7b5e0 100644
--- a/src/emu/natkeyboard.cpp
+++ b/src/emu/natkeyboard.cpp
@@ -857,10 +857,10 @@ const char_info *char_info::find(char32_t target)
//-------------------------------------------------
/*
-int validate_natural_keyboard_statics(void)
+bool validate_natural_keyboard_statics(void)
{
int i;
- int error = FALSE;
+ bool error = false;
char32_t last_char = 0;
const char_info *ci;
@@ -870,7 +870,7 @@ int validate_natural_keyboard_statics(void)
if (last_char >= charinfo[i].ch)
{
osd_printf_error("inputx: charinfo is out of order; 0x%08x should be higher than 0x%08x\n", charinfo[i].ch, last_char);
- error = TRUE;
+ error = true;
}
last_char = charinfo[i].ch;
}
@@ -882,7 +882,7 @@ int validate_natural_keyboard_statics(void)
if (ci != &charinfo[i])
{
osd_printf_error("ioport: expected char_info::find(0x%08x) to work properly\n", charinfo[i].ch);
- error = TRUE;
+ error = true;
}
}
return error;
diff --git a/src/emu/render.cpp b/src/emu/render.cpp
index 66fb5e0541e..2626d882c8d 100644
--- a/src/emu/render.cpp
+++ b/src/emu/render.cpp
@@ -545,7 +545,7 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
return container.bcg_lookup_table(m_format);
default:
- assert(FALSE);
+ assert(false);
}
return nullptr;
diff --git a/src/emu/rendutil.cpp b/src/emu/rendutil.cpp
index 956f20ad5b7..be1eed481d2 100644
--- a/src/emu/rendutil.cpp
+++ b/src/emu/rendutil.cpp
@@ -577,7 +577,7 @@ void render_load_jpeg(bitmap_argb32 &bitmap, emu_file &file, const char *dirname
jpeg_mem_src(&cinfo, jpg_buffer.get(), jpg_size);
// read JPEG header and start decompression
- jpeg_read_header(&cinfo, TRUE);
+ jpeg_read_header(&cinfo, true);
jpeg_start_decompress(&cinfo);
// allocates the destination bitmap
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index b910f30c177..d8e5d1b0ea0 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -72,7 +72,7 @@ inline int32_t tilemap_t::effective_colscroll(int index, uint32_t screen_height)
//-------------------------------------------------
-// gfx_tiles_changed - return TRUE if any
+// gfx_tiles_changed - return true if any
// gfx_elements used by this tilemap have
// changed
//-------------------------------------------------
diff --git a/src/emu/uiinput.cpp b/src/emu/uiinput.cpp
index a52df97679d..3094df31ce8 100644
--- a/src/emu/uiinput.cpp
+++ b/src/emu/uiinput.cpp
@@ -20,7 +20,7 @@ enum
{
SEQ_PRESSED_FALSE = 0, /* not pressed */
SEQ_PRESSED_TRUE, /* pressed */
- SEQ_PRESSED_RESET /* reset -- converted to FALSE once detected as not pressed */
+ SEQ_PRESSED_RESET /* reset -- converted to false once detected as not pressed */
};
@@ -224,7 +224,7 @@ ioport_field *ui_input_manager::find_mouse_field() const
***************************************************************************/
/*-------------------------------------------------
- pressed - return TRUE if a key down
+ pressed - return true if a key down
for the given user interface sequence is
detected
-------------------------------------------------*/
@@ -236,7 +236,7 @@ bool ui_input_manager::pressed(int code)
/*-------------------------------------------------
- pressed_repeat - return TRUE if a key
+ pressed_repeat - return true if a key
down for the given user interface sequence is
detected, or if autorepeat at the given speed
is triggered
diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h
index 669e195a0ba..861ca07c632 100644
--- a/src/emu/uiinput.h
+++ b/src/emu/uiinput.h
@@ -74,10 +74,10 @@ public:
render_target *find_mouse(int32_t *x, int32_t *y, bool *button) const;
ioport_field *find_mouse_field() const;
- /* return TRUE if a key down for the given user interface sequence is detected */
+ /* return true if a key down for the given user interface sequence is detected */
bool pressed(int code);
- /* return TRUE if a key down for the given user interface sequence is detected, or if
+ /* return true if a key down for the given user interface sequence is detected, or if
autorepeat at the given speed is triggered */
bool pressed_repeat(int code, int speed);
diff --git a/src/emu/video.h b/src/emu/video.h
index 3df073e9451..bd4ae3b0437 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -157,11 +157,11 @@ private:
uint32_t m_overall_valid_counter; // number of consecutive valid time periods
// configuration
- bool m_throttled; // flag: TRUE if we're currently throttled
+ bool m_throttled; // flag: true if we're currently throttled
float m_throttle_rate; // target rate for throttling
- bool m_fastforward; // flag: TRUE if we're currently fast-forwarding
+ bool m_fastforward; // flag: true if we're currently fast-forwarding
uint32_t m_seconds_to_run; // number of seconds to run before quitting
- bool m_auto_frameskip; // flag: TRUE if we're automatically frameskipping
+ bool m_auto_frameskip; // flag: true if we're automatically frameskipping
uint32_t m_speed; // overall speed (*1000)
// frameskipping
@@ -169,7 +169,7 @@ private:
uint8_t m_frameskip_level; // current frameskip level
uint8_t m_frameskip_counter; // counter that counts through the frameskip steps
int8_t m_frameskip_adjust;
- bool m_skipping_this_frame; // flag: TRUE if we are skipping the current frame
+ bool m_skipping_this_frame; // flag: true if we are skipping the current frame
osd_ticks_t m_average_oversleep; // average number of ticks the OSD oversleeps
// snapshot stuff
diff --git a/src/frontend/mame/ui/datmenu.cpp b/src/frontend/mame/ui/datmenu.cpp
index b4982064cdd..9efcde655b4 100644
--- a/src/frontend/mame/ui/datmenu.cpp
+++ b/src/frontend/mame/ui/datmenu.cpp
@@ -350,7 +350,7 @@ void menu_dats_view::custom_render(void *selectedref, float top, float bottom, f
if (bcolor != UI_TEXT_BG_COLOR)
ui().draw_textured_box(container(), x1 - (space / 2), y1, x1 + width + (space / 2), y2, bcolor, rgb_t(255, 43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
ui().draw_text_full(container(), elem.label.c_str(), x1, y1, 1.0f, ui::text_layout::LEFT, ui::text_layout::NEVER, mame_ui_manager::NORMAL, fcolor, bcolor, &width, nullptr);
x1 += width + space;
diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp
index 7f0f0df8d50..ceb30eeea9d 100644
--- a/src/frontend/mame/ui/menu.cpp
+++ b/src/frontend/mame/ui/menu.cpp
@@ -56,7 +56,7 @@ menu::global_state_ptr menu::get_global_state(running_machine &machine)
}
//-------------------------------------------------
-// exclusive_input_pressed - return TRUE if the
+// exclusive_input_pressed - return true if the
// given key is pressed and we haven't already
// reported a key
//-------------------------------------------------
@@ -976,7 +976,7 @@ void menu::handle_keys(uint32_t flags, int &iptkey)
if (item.empty())
return;
- // if we hit select, return TRUE or pop the stack, depending on the item
+ // if we hit select, return true or pop the stack, depending on the item
if (exclusive_input_pressed(iptkey, IPT_UI_SELECT, 0))
{
if (is_last_selected())
@@ -1181,7 +1181,7 @@ uint32_t menu::ui_handler(render_container &container, mame_ui_manager &mui)
void menu::highlight(float x0, float y0, float x1, float y1, rgb_t bgcolor)
{
- container().add_quad(x0, y0, x1, y1, bgcolor, m_global_state->hilight_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE) | PRIMFLAG_PACKABLE);
+ container().add_quad(x0, y0, x1, y1, bgcolor, m_global_state->hilight_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1) | PRIMFLAG_PACKABLE);
}
diff --git a/src/frontend/mame/ui/selgame.cpp b/src/frontend/mame/ui/selgame.cpp
index f3b42810bef..b23d333ba4b 100644
--- a/src/frontend/mame/ui/selgame.cpp
+++ b/src/frontend/mame/ui/selgame.cpp
@@ -1572,7 +1572,7 @@ float menu_select_game::draw_left_panel(float x1, float y1, float x2, float y2)
fgcolor = rgb_t(0xff, 0xff, 0xff, 0x00);
bgcolor = rgb_t(0xff, 0xff, 0xff, 0xff);
ui().draw_textured_box(container(), x1, y1, x2, y1 + line_height_max, bgcolor, rgb_t(255, 43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
float x1t = x1 + text_sign;
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index 34b39137504..7dde5a96669 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -485,14 +485,14 @@ void menu_select_launch::draw_common_arrow(float origx1, float origy1, float ori
if (mouse_hit && ar_x0 <= mouse_x && ar_x1 > mouse_x && ar_y0 <= mouse_y && ar_y1 > mouse_y && current != dmax)
{
ui().draw_textured_box(container(), ar_x0 + 0.01f, ar_y0, ar_x1 - 0.01f, ar_y1, UI_MOUSEOVER_BG_COLOR, rgb_t(43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
hover = HOVER_UI_RIGHT;
fgcolor_right = UI_MOUSEOVER_COLOR;
}
else if (mouse_hit && al_x0 <= mouse_x && al_x1 > mouse_x && al_y0 <= mouse_y && al_y1 > mouse_y && current != dmin)
{
ui().draw_textured_box(container(), al_x0 + 0.01f, al_y0, al_x1 - 0.01f, al_y1, UI_MOUSEOVER_BG_COLOR, rgb_t(43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
hover = HOVER_UI_LEFT;
fgcolor_left = UI_MOUSEOVER_COLOR;
}
@@ -524,7 +524,7 @@ void menu_select_launch::draw_info_arrow(int ub, float origx1, float origx2, flo
if (mouse_hit && origx1 <= mouse_x && origx2 > mouse_x && oy1 <= mouse_y && oy1 + (line_height * text_size) > mouse_y)
{
ui().draw_textured_box(container(), origx1 + 0.01f, oy1, origx2 - 0.01f, oy1 + (line_height * text_size), UI_MOUSEOVER_BG_COLOR,
- rgb_t(43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ rgb_t(43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
hover = (!ub) ? HOVER_DAT_UP : HOVER_DAT_DOWN;
fgcolor = UI_MOUSEOVER_COLOR;
}
@@ -770,7 +770,7 @@ void menu_select_launch::handle_keys(uint32_t flags, int &iptkey)
if (item.size() == 0)
return;
- // if we hit select, return TRUE or pop the stack, depending on the item
+ // if we hit select, return true or pop the stack, depending on the item
if (exclusive_input_pressed(iptkey, IPT_UI_SELECT, 0))
{
if (is_last_selected() && m_focus == focused_menu::main)
@@ -1286,7 +1286,7 @@ void menu_select_launch::draw(uint32_t flags)
bgcolor = rgb_t(0xff, 0xff, 0xff);
fgcolor3 = rgb_t(0xcc, 0xcc, 0x00);
ui().draw_textured_box(container(), line_x0 + 0.01f, line_y0, line_x1 - 0.01f, line_y1, bgcolor, rgb_t(43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
// else if the mouse is over this item, draw with a different background
else if (itemnum == hover)
@@ -1300,7 +1300,7 @@ void menu_select_launch::draw(uint32_t flags)
fgcolor = fgcolor3 = UI_MOUSEOVER_COLOR;
bgcolor = UI_MOUSEOVER_BG_COLOR;
ui().draw_textured_box(container(), line_x0 + 0.01f, line_y0, line_x1 - 0.01f, line_y1, bgcolor, rgb_t(43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
if (linenum == 0 && top_line != 0)
@@ -1376,7 +1376,7 @@ void menu_select_launch::draw(uint32_t flags)
fgcolor = rgb_t(0xff, 0xff, 0x00);
bgcolor = rgb_t(0xff, 0xff, 0xff);
ui().draw_textured_box(container(), line_x0 + 0.01f, line_y0, line_x1 - 0.01f, line_y1, bgcolor, rgb_t(43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
// else if the mouse is over this item, draw with a different background
else if (count == hover)
@@ -1526,12 +1526,12 @@ float menu_select_launch::draw_right_box_title(float x1, float y1, float x2, flo
fgcolor = rgb_t(0xff, 0xff, 0x00);
bgcolor = rgb_t(0xff, 0xff, 0xff);
ui().draw_textured_box(container(), x1 + UI_LINE_WIDTH, y1 + UI_LINE_WIDTH, x1 + midl - UI_LINE_WIDTH, y1 + line_height,
- bgcolor, rgb_t(43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ bgcolor, rgb_t(43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
else if (bgcolor == UI_MOUSEOVER_BG_COLOR)
{
container().add_rect(x1 + UI_LINE_WIDTH, y1 + UI_LINE_WIDTH, x1 + midl - UI_LINE_WIDTH, y1 + line_height,
- bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ bgcolor, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
ui().draw_text_full(container(), buffer[cells].c_str(), x1 + UI_LINE_WIDTH, y1, midl - UI_LINE_WIDTH,
@@ -1742,7 +1742,7 @@ std::string menu_select_launch::arts_render_common(float origx1, float origy1, f
if (bgcolor != UI_TEXT_BG_COLOR)
{
ui().draw_textured_box(container(), origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
- origy1 + line_height, bgcolor, rgb_t(43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ origy1 + line_height, bgcolor, rgb_t(43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
ui().draw_text_full(container(),
@@ -2024,7 +2024,7 @@ void menu_select_launch::infos_render(float origx1, float origy1, float origx2,
if (bgcolor != UI_TEXT_BG_COLOR)
{
ui().draw_textured_box(container(), origx1 + ((middle - title_size) * 0.5f), origy1, origx1 + ((middle + title_size) * 0.5f),
- origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ origy1 + line_height, bgcolor, rgb_t(255, 43, 43, 43), hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
ui().draw_text_full(container(), snaptext.c_str(), origx1, origy1, origx2 - origx1, ui::text_layout::CENTER,
diff --git a/src/frontend/mame/ui/selsoft.cpp b/src/frontend/mame/ui/selsoft.cpp
index 421dc010467..35a6e008d9c 100644
--- a/src/frontend/mame/ui/selsoft.cpp
+++ b/src/frontend/mame/ui/selsoft.cpp
@@ -1155,7 +1155,7 @@ float menu_select_software::draw_left_panel(float x1, float y1, float x2, float
if (bgcolor != UI_TEXT_BG_COLOR)
{
ui().draw_textured_box(container(), x1, y1, x2, y1 + line_height, bgcolor, rgb_t(255, 43, 43, 43),
- hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(TRUE));
+ hilight_main_texture(), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_TEXWRAP(1));
}
float x1t = x1 + text_sign;
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index 9d1adf2d1d8..f172a2b5a29 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -291,7 +291,7 @@ void mame_ui_manager::display_startup_screens(bool first_time)
#if defined(EMSCRIPTEN)
// also disable for the JavaScript port since the startup screens do not run asynchronously
- show_gameinfo = show_warnings = FALSE;
+ show_gameinfo = show_warnings = false;
#endif
// loop over states
diff --git a/src/ldplayer/ldplayer.cpp b/src/ldplayer/ldplayer.cpp
index eae0ea64891..879def09d6f 100644
--- a/src/ldplayer/ldplayer.cpp
+++ b/src/ldplayer/ldplayer.cpp
@@ -176,7 +176,7 @@ protected:
chd_file *ldplayer_state::get_disc()
{
- bool found = FALSE;
+ bool found = false;
// open a path to the ROMs and find the first CHD file
file_enumerator path(machine().options().media_path());
@@ -206,7 +206,7 @@ chd_file *ldplayer_state::get_disc()
if (machine().rom_load().set_disk_handle("laserdisc", fullpath.c_str()) == CHDERR_NONE)
{
m_filename.assign(dir->name);
- found = TRUE;
+ found = true;
break;
}
}
@@ -214,7 +214,7 @@ chd_file *ldplayer_state::get_disc()
}
// if we failed, pop a message and exit
- if (found == FALSE)
+ if (found == false)
throw emu_fatalerror("No valid image file found!\n");
return machine().rom_load().get_disk_handle("laserdisc");
diff --git a/src/lib/formats/ap2_dsk.cpp b/src/lib/formats/ap2_dsk.cpp
index 6cba1db6757..319535b4687 100644
--- a/src/lib/formats/ap2_dsk.cpp
+++ b/src/lib/formats/ap2_dsk.cpp
@@ -376,7 +376,7 @@ static floperr_t apple2_nib_read_sector(floppy_image_legacy *floppy, int head, i
if (buflen != APPLE2_SECTOR_SIZE)
return FLOPPY_ERROR_INTERNAL;
- err = floppy_load_track(floppy, head, track, FALSE, &track_data_v, nullptr);
+ err = floppy_load_track(floppy, head, track, false, &track_data_v, nullptr);
if (err)
return err;
track_data = (uint8_t *) track_data_v;
@@ -465,7 +465,7 @@ static floperr_t apple2_nib_write_sector(floppy_image_legacy *floppy, int head,
if (buflen != APPLE2_SECTOR_SIZE)
return FLOPPY_ERROR_INTERNAL;
- err = floppy_load_track(floppy, head, track, TRUE, &track_data_v, nullptr);
+ err = floppy_load_track(floppy, head, track, true, &track_data_v, nullptr);
if (err)
return err;
track_data = (uint8_t *) track_data_v;
diff --git a/src/lib/formats/ap_dsk35.cpp b/src/lib/formats/ap_dsk35.cpp
index 38a36a956ec..c18ea8c65d4 100644
--- a/src/lib/formats/ap_dsk35.cpp
+++ b/src/lib/formats/ap_dsk35.cpp
@@ -791,7 +791,7 @@ static floperr_t apple35_write_track(floppy_image_legacy *floppy, int head, int
static floperr_t apple35_construct(floppy_image_legacy *floppy, uint32_t data_offset, uint32_t data_size,
- uint32_t tag_offset, uint32_t tag_size, int16_t format_byte, uint8_t sides, int is_1440k)
+ uint32_t tag_offset, uint32_t tag_size, int16_t format_byte, uint8_t sides, bool is_1440k)
{
struct apple35_tag *tag;
struct FloppyCallbacks *format;
@@ -857,14 +857,14 @@ static FLOPPY_CONSTRUCT(apple35_raw_construct)
{
uint64_t size;
uint8_t sides;
- int is_1440k;
+ bool is_1440k;
if (params)
{
/* create */
sides = params->lookup_int(PARAM_HEADS);
size = 80*sides*10*512;
- is_1440k = FALSE;
+ is_1440k = false;
}
else
{
@@ -873,7 +873,7 @@ static FLOPPY_CONSTRUCT(apple35_raw_construct)
if (size == 80*1*10*512)
{
sides = 1;
- is_1440k = FALSE;
+ is_1440k = false;
}
else if ((size == 80*2*10*512) || (size == 80*2*18*512) || (size == (80*2*18*512)+84))
{
@@ -1019,7 +1019,7 @@ static FLOPPY_CONSTRUCT(apple35_diskcopy_construct)
format_byte_param = format_byte;
return apple35_construct(floppy, data_offset, data_size,
- tag_offset, tag_size, format_byte_param, sides, FALSE);
+ tag_offset, tag_size, format_byte_param, sides, false);
}
@@ -1169,7 +1169,7 @@ static FLOPPY_CONSTRUCT(apple35_2img_construct)
}
return apple35_construct(floppy, data_offset, data_size,
- 0, 0, -1, sides, FALSE);
+ 0, 0, -1, sides, false);
}
diff --git a/src/lib/formats/basicdsk.cpp b/src/lib/formats/basicdsk.cpp
index b24ca47346d..9de079232e0 100644
--- a/src/lib/formats/basicdsk.cpp
+++ b/src/lib/formats/basicdsk.cpp
@@ -77,7 +77,7 @@ floperr_t basicdsk_construct(floppy_image_legacy *floppy, const struct basicdsk_
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
const struct basicdsk_geometry *geom;
uint64_t offs;
@@ -129,7 +129,7 @@ static int internal_basicdsk_translate_sector_interleave(floppy_image_legacy *fl
-static floperr_t internal_basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -143,7 +143,7 @@ static floperr_t internal_basicdsk_read_sector(floppy_image_legacy *floppy, int
-static floperr_t internal_basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
+static floperr_t internal_basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, const void *buffer, size_t buflen, int ddam)
{
uint64_t offset;
floperr_t err;
@@ -160,22 +160,22 @@ static floperr_t internal_basicdsk_write_sector(floppy_image_legacy *floppy, int
static floperr_t basicdsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_basicdsk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_basicdsk_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t basicdsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_basicdsk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
+ return internal_basicdsk_write_sector(floppy, head, track, sector, false, buffer, buflen, ddam);
}
static floperr_t basicdsk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_basicdsk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_basicdsk_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t basicdsk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_basicdsk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
+ return internal_basicdsk_write_sector(floppy, head, track, sector, true, buffer, buflen, ddam);
}
@@ -245,7 +245,7 @@ static floperr_t basicdsk_get_sector_length(floppy_image_legacy *floppy, int hea
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/coco_cas.cpp b/src/lib/formats/coco_cas.cpp
index ba5186f539d..6579f47a60f 100644
--- a/src/lib/formats/coco_cas.cpp
+++ b/src/lib/formats/coco_cas.cpp
@@ -61,7 +61,7 @@ static cassette_image::error coco_cas_identify(cassette_image *cassette, struct
-static int get_cas_block(cassette_image *cassette, uint64_t *offset, uint8_t *block, int *block_len)
+static bool get_cas_block(cassette_image *cassette, uint64_t *offset, uint8_t *block, int *block_len)
{
uint8_t block_length = 0;
uint8_t block_checksum = 0;
@@ -130,13 +130,13 @@ static int get_cas_block(cassette_image *cassette, uint64_t *offset, uint8_t *bl
if (p.b.l != block_checksum)
{
/* checksum failure */
- return FALSE;
+ return false;
}
else
{
/* checksum success */
*offset = current_offset;
- return TRUE;
+ return true;
}
}
}
@@ -145,7 +145,7 @@ static int get_cas_block(cassette_image *cassette, uint64_t *offset, uint8_t *bl
}
/* no more blocks */
- return FALSE;
+ return false;
}
diff --git a/src/lib/formats/cqm_dsk.cpp b/src/lib/formats/cqm_dsk.cpp
index 3c13f3d44b4..e2bde8fcf8c 100644
--- a/src/lib/formats/cqm_dsk.cpp
+++ b/src/lib/formats/cqm_dsk.cpp
@@ -66,7 +66,7 @@ static uint64_t cqm_get_track_offset(floppy_image_legacy *floppy, int head, int
return get_tag(floppy)->track_offsets[(track<<1) + head];
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
uint64_t pos = 0;
uint8_t data;
@@ -101,7 +101,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in
-static floperr_t internal_cqm_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_cqm_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -117,18 +117,18 @@ static floperr_t internal_cqm_read_sector(floppy_image_legacy *floppy, int head,
static floperr_t cqm_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_cqm_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_cqm_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t cqm_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_cqm_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_cqm_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t cqm_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/dsk_dsk.cpp b/src/lib/formats/dsk_dsk.cpp
index a4b498f47b2..5d72e093d67 100644
--- a/src/lib/formats/dsk_dsk.cpp
+++ b/src/lib/formats/dsk_dsk.cpp
@@ -68,7 +68,7 @@ static uint64_t dsk_get_track_offset(floppy_image_legacy *floppy, int head, int
return get_tag(floppy)->track_offsets[(track<<1) + head];
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
uint64_t offs;
uint64_t track_offset;
@@ -111,7 +111,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in
-static floperr_t internal_dsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_dsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -124,7 +124,7 @@ static floperr_t internal_dsk_read_sector(floppy_image_legacy *floppy, int head,
-static floperr_t internal_dsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
+static floperr_t internal_dsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, const void *buffer, size_t buflen, int ddam)
{
uint64_t offset;
floperr_t err;
@@ -141,28 +141,28 @@ static floperr_t internal_dsk_write_sector(floppy_image_legacy *floppy, int head
static floperr_t dsk_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_dsk_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_dsk_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t dsk_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_dsk_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
+ return internal_dsk_write_sector(floppy, head, track, sector, false, buffer, buflen, ddam);
}
static floperr_t dsk_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_dsk_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_dsk_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t dsk_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_dsk_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
+ return internal_dsk_write_sector(floppy, head, track, sector, true, buffer, buflen, ddam);
}
static floperr_t dsk_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
@@ -179,7 +179,7 @@ static floperr_t dsk_get_indexed_sector_info(floppy_image_legacy *floppy, int he
uint8_t sector_info[0x100];
int pos;
- retVal = get_offset(floppy, head, track, sector_index, FALSE, nullptr);
+ retVal = get_offset(floppy, head, track, sector_index, false, nullptr);
offset = dsk_get_track_offset(floppy,head,track);
pos = 0x18 + (sector_index << 3);
floppy_image_read(floppy, sector_info, offset, 0x100);
diff --git a/src/lib/formats/flopimg.cpp b/src/lib/formats/flopimg.cpp
index c924050ac08..d517c240a80 100644
--- a/src/lib/formats/flopimg.cpp
+++ b/src/lib/formats/flopimg.cpp
@@ -68,7 +68,7 @@ OPTION_GUIDE_START(floppy_option_guide)
OPTION_GUIDE_END
-static void floppy_close_internal(floppy_image_legacy *floppy, int close_file);
+static void floppy_close_internal(floppy_image_legacy *floppy, bool close_file);
/*********************************************************************
opening, closing and creating of floppy images
@@ -167,7 +167,7 @@ done:
/* if we have a floppy disk and we either errored or are not keeping it, close it */
if (floppy && (!outfloppy || err))
{
- floppy_close_internal(floppy, FALSE);
+ floppy_close_internal(floppy, false);
floppy = nullptr;
}
@@ -270,20 +270,20 @@ floperr_t floppy_create(void *fp, const struct io_procs *procs, const struct Flo
done:
if (err && floppy)
{
- floppy_close_internal(floppy, FALSE);
+ floppy_close_internal(floppy, false);
floppy = nullptr;
}
if (outfloppy)
*outfloppy = floppy;
else if (floppy)
- floppy_close_internal(floppy, FALSE);
+ floppy_close_internal(floppy, false);
return err;
}
-static void floppy_close_internal(floppy_image_legacy *floppy, int close_file)
+static void floppy_close_internal(floppy_image_legacy *floppy, bool close_file)
{
if (floppy) {
floppy_track_unload(floppy);
@@ -304,7 +304,7 @@ static void floppy_close_internal(floppy_image_legacy *floppy, int close_file)
void floppy_close(floppy_image_legacy *floppy)
{
- floppy_close_internal(floppy, TRUE);
+ floppy_close_internal(floppy, true);
}
@@ -388,7 +388,7 @@ uint64_t floppy_image_size(floppy_image_legacy *floppy)
*********************************************************************/
static floperr_t floppy_readwrite_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset,
- void *buffer, size_t buffer_len, int writing, int indexed, int ddam)
+ void *buffer, size_t buffer_len, bool writing, bool indexed, int ddam)
{
floperr_t err;
const struct FloppyCallbacks *fmt;
@@ -507,28 +507,28 @@ done:
floperr_t floppy_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset, void *buffer, size_t buffer_len)
{
- return floppy_readwrite_sector(floppy, head, track, sector, offset, buffer, buffer_len, FALSE, FALSE, 0);
+ return floppy_readwrite_sector(floppy, head, track, sector, offset, buffer, buffer_len, false, false, 0);
}
floperr_t floppy_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int offset, const void *buffer, size_t buffer_len, int ddam)
{
- return floppy_readwrite_sector(floppy, head, track, sector, offset, (void *) buffer, buffer_len, TRUE, FALSE, ddam);
+ return floppy_readwrite_sector(floppy, head, track, sector, offset, (void *) buffer, buffer_len, true, false, ddam);
}
floperr_t floppy_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int offset, void *buffer, size_t buffer_len)
{
- return floppy_readwrite_sector(floppy, head, track, sector_index, offset, buffer, buffer_len, FALSE, TRUE, 0);
+ return floppy_readwrite_sector(floppy, head, track, sector_index, offset, buffer, buffer_len, false, true, 0);
}
floperr_t floppy_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, int offset, const void *buffer, size_t buffer_len, int ddam)
{
- return floppy_readwrite_sector(floppy, head, track, sector_index, offset, (void *) buffer, buffer_len, TRUE, TRUE, ddam);
+ return floppy_readwrite_sector(floppy, head, track, sector_index, offset, (void *) buffer, buffer_len, true, true, ddam);
}
diff --git a/src/lib/formats/imageutl.cpp b/src/lib/formats/imageutl.cpp
index ecb322aac57..6ab427115e0 100644
--- a/src/lib/formats/imageutl.cpp
+++ b/src/lib/formats/imageutl.cpp
@@ -97,7 +97,7 @@ static int is_delim(char c)
an extension list
-------------------------------------------------*/
-static int image_internal_find_extension(const char *extension_list, const char *target_extension)
+static bool image_internal_find_extension(const char *extension_list, const char *target_extension)
{
/* this version allows target_extension to be delimited with a comma */
int pos = 0;
@@ -116,7 +116,7 @@ static int image_internal_find_extension(const char *extension_list, const char
/* check to see if it was found */
if (is_delim(extension_list[pos + i]) && is_delim(target_extension[i]))
- return TRUE;
+ return true;
/* move to next position in the buffer */
pos += i;
@@ -127,7 +127,7 @@ static int image_internal_find_extension(const char *extension_list, const char
}
/* not found */
- return FALSE;
+ return false;
}
@@ -137,11 +137,11 @@ static int image_internal_find_extension(const char *extension_list, const char
list
-------------------------------------------------*/
-int image_find_extension(const char *extension_list, const char *target_extension)
+bool image_find_extension(const char *extension_list, const char *target_extension)
{
/* the internal function allows something that we do not */
if (strchr(target_extension, ','))
- return FALSE;
+ return false;
/* special case to allow ext to be in the form '.EXT' */
if (*target_extension == '.')
diff --git a/src/lib/formats/imageutl.h b/src/lib/formats/imageutl.h
index 5e478cfb1e7..67359d312b2 100644
--- a/src/lib/formats/imageutl.h
+++ b/src/lib/formats/imageutl.h
@@ -172,7 +172,7 @@ int compute_log2(int val);
* Extension list handling
* ----------------------------------------------------------------------- */
-int image_find_extension(const char *extensions, const char *ext);
+bool image_find_extension(const char *extensions, const char *ext);
void image_specify_extension(char *buffer, size_t buffer_len, const char *extension);
#endif /* __IMAGEUTL_H__ */
diff --git a/src/lib/formats/imd_dsk.cpp b/src/lib/formats/imd_dsk.cpp
index 8f3626aedbb..cce87fa64f2 100644
--- a/src/lib/formats/imd_dsk.cpp
+++ b/src/lib/formats/imd_dsk.cpp
@@ -58,7 +58,7 @@ static uint64_t imd_get_track_offset(floppy_image_legacy *floppy, int head, int
return get_tag(floppy)->track_offsets[(track<<1) + head];
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
uint64_t offs = 0;
uint8_t header[5];
@@ -96,7 +96,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in
-static floperr_t internal_imd_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_imd_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -129,12 +129,12 @@ static floperr_t internal_imd_read_sector(floppy_image_legacy *floppy, int head,
static floperr_t imd_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_imd_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_imd_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t imd_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_imd_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_imd_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t imd_expand_file(floppy_image_legacy *floppy , uint64_t offset , size_t amount)
@@ -189,7 +189,7 @@ static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head,
uint8_t header[1];
// take sector offset
- err = get_offset(floppy, head, track, sector_index, TRUE, &offset);
+ err = get_offset(floppy, head, track, sector_index, true, &offset);
if (err)
return err;
@@ -225,7 +225,7 @@ static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head,
static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/sorc_dsk.cpp b/src/lib/formats/sorc_dsk.cpp
index ef99fd7ec11..7a1b734f780 100644
--- a/src/lib/formats/sorc_dsk.cpp
+++ b/src/lib/formats/sorc_dsk.cpp
@@ -35,7 +35,7 @@ static uint64_t sorc_translate_offset(floppy_image_legacy *floppy, int track, in
return 270*(16*track+sector);
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
uint64_t offs;
/* translate the sector to a raw sector */
@@ -55,7 +55,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in
-static floperr_t internal_sorc_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_sorc_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -69,7 +69,7 @@ static floperr_t internal_sorc_read_sector(floppy_image_legacy *floppy, int head
-static floperr_t internal_sorc_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
+static floperr_t internal_sorc_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, const void *buffer, size_t buflen, int ddam)
{
uint64_t offset;
floperr_t err;
@@ -86,28 +86,28 @@ static floperr_t internal_sorc_write_sector(floppy_image_legacy *floppy, int hea
static floperr_t sorc_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_sorc_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_sorc_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t sorc_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_sorc_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
+ return internal_sorc_write_sector(floppy, head, track, sector, false, buffer, buflen, ddam);
}
static floperr_t sorc_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_sorc_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_sorc_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t sorc_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_sorc_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
+ return internal_sorc_write_sector(floppy, head, track, sector, true, buffer, buflen, ddam);
}
static floperr_t sorc_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp
index 375cf3cdb42..588603a40f5 100644
--- a/src/lib/formats/td0_dsk.cpp
+++ b/src/lib/formats/td0_dsk.cpp
@@ -153,7 +153,7 @@ static uint64_t td0_get_track_offset(floppy_image_legacy *floppy, int head, int
return get_tag(floppy)->track_offsets[(track<<1) + head];
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
uint64_t offs;
uint8_t *header;
@@ -200,7 +200,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in
-static floperr_t internal_td0_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_td0_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -287,18 +287,18 @@ static floperr_t internal_td0_read_sector(floppy_image_legacy *floppy, int head,
static floperr_t td0_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_td0_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_td0_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t td0_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_td0_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_td0_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t td0_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
@@ -314,7 +314,7 @@ static floperr_t td0_get_indexed_sector_info(floppy_image_legacy *floppy, int he
uint64_t offset = 0;
uint8_t *sector_info;
- retVal = get_offset(floppy, head, track, sector_index, FALSE, &offset);
+ retVal = get_offset(floppy, head, track, sector_index, false, &offset);
sector_info = get_tag(floppy)->data + offset;
if (cylinder)
*cylinder = sector_info[0];
diff --git a/src/lib/formats/thom_dsk.cpp b/src/lib/formats/thom_dsk.cpp
index 6249d785705..a7c5cc6d433 100644
--- a/src/lib/formats/thom_dsk.cpp
+++ b/src/lib/formats/thom_dsk.cpp
@@ -79,7 +79,7 @@ static int sap_get_tracks_per_disk(floppy_image_legacy *floppy)
}
-static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, uint64_t *offset)
+static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, uint64_t *offset)
{
uint64_t offs;
struct sap_dsk_tag *tag = get_tag(floppy);
@@ -104,7 +104,7 @@ static floperr_t get_offset(floppy_image_legacy *floppy, int head, int track, in
-static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, void *buffer, size_t buflen)
+static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, void *buffer, size_t buflen)
{
uint64_t offset;
floperr_t err;
@@ -124,7 +124,7 @@ static floperr_t internal_sap_read_sector(floppy_image_legacy *floppy, int head,
-static floperr_t internal_sap_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, int sector_is_index, const void *buffer, size_t buflen, int ddam)
+static floperr_t internal_sap_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, bool sector_is_index, const void *buffer, size_t buflen, int ddam)
{
uint64_t offset;
floperr_t err;
@@ -154,28 +154,28 @@ static floperr_t internal_sap_write_sector(floppy_image_legacy *floppy, int head
static floperr_t sap_read_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_sap_read_sector(floppy, head, track, sector, FALSE, buffer, buflen);
+ return internal_sap_read_sector(floppy, head, track, sector, false, buffer, buflen);
}
static floperr_t sap_write_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_sap_write_sector(floppy, head, track, sector, FALSE, buffer, buflen, ddam);
+ return internal_sap_write_sector(floppy, head, track, sector, false, buffer, buflen, ddam);
}
static floperr_t sap_read_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, void *buffer, size_t buflen)
{
- return internal_sap_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
+ return internal_sap_read_sector(floppy, head, track, sector, true, buffer, buflen);
}
static floperr_t sap_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector, const void *buffer, size_t buflen, int ddam)
{
- return internal_sap_write_sector(floppy, head, track, sector, TRUE, buffer, buflen, ddam);
+ return internal_sap_write_sector(floppy, head, track, sector, true, buffer, buflen, ddam);
}
static floperr_t sap_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, uint32_t *sector_length)
{
floperr_t err;
- err = get_offset(floppy, head, track, sector, FALSE, nullptr);
+ err = get_offset(floppy, head, track, sector, false, nullptr);
if (err)
return err;
@@ -193,7 +193,7 @@ static floperr_t sap_get_indexed_sector_info(floppy_image_legacy *floppy, int he
uint8_t header[4];
uint64_t offset = 0;
sector_index += 1;
- err = get_offset(floppy, head, track, sector_index, FALSE, &offset);
+ err = get_offset(floppy, head, track, sector_index, false, &offset);
floppy_image_read(floppy, header, offset, 4);
if (cylinder)
diff --git a/src/lib/formats/wavfile.cpp b/src/lib/formats/wavfile.cpp
index 29f33c4102b..072be6c92a2 100644
--- a/src/lib/formats/wavfile.cpp
+++ b/src/lib/formats/wavfile.cpp
@@ -58,7 +58,7 @@ static void put_leuint16(void *ptr, uint16_t value)
static cassette_image::error wavfile_process(cassette_image *cassette, struct CassetteOptions *opts,
- int read_waveform)
+ bool read_waveform)
{
uint8_t file_header[12];
uint8_t tag_header[8];
@@ -68,7 +68,7 @@ static cassette_image::error wavfile_process(cassette_image *cassette, struct Ca
uint32_t tag_size;
uint32_t tag_samples;
uint64_t offset;
- int format_specified = FALSE;
+ bool format_specified = false;
uint16_t format_type = 0;
uint32_t bytes_per_second = 0;
@@ -102,7 +102,7 @@ static cassette_image::error wavfile_process(cassette_image *cassette, struct Ca
/* format tag */
if (format_specified || (tag_size < sizeof(format_tag)))
return cassette_image::error::INVALID_IMAGE;
- format_specified = TRUE;
+ format_specified = true;
cassette_image_read(cassette, format_tag, offset, sizeof(format_tag));
@@ -160,7 +160,7 @@ static cassette_image::error wavfile_process(cassette_image *cassette, struct Ca
static cassette_image::error wavfile_identify(cassette_image *cassette, struct CassetteOptions *opts)
{
- return wavfile_process(cassette, opts, FALSE);
+ return wavfile_process(cassette, opts, false);
}
@@ -169,7 +169,7 @@ static cassette_image::error wavfile_load(cassette_image *cassette)
{
struct CassetteOptions opts;
memset(&opts, 0, sizeof(opts));
- return wavfile_process(cassette, &opts, TRUE);
+ return wavfile_process(cassette, &opts, true);
}
diff --git a/src/lib/util/png.cpp b/src/lib/util/png.cpp
index d1189d5ffc2..9069348c843 100644
--- a/src/lib/util/png.cpp
+++ b/src/lib/util/png.cpp
@@ -235,10 +235,10 @@ static png_error read_chunk(util::core_file &fp, uint8_t **data, uint32_t *type,
process_chunk - process a PNG chunk
-------------------------------------------------*/
-static png_error process_chunk(png_private *png, uint8_t *data, uint32_t type, uint32_t length, int *keepmem)
+static png_error process_chunk(png_private *png, uint8_t *data, uint32_t type, uint32_t length, bool *keepmem)
{
/* default to not keeping memory */
- *keepmem = FALSE;
+ *keepmem = false;
/* switch off of the type */
switch (type)
@@ -258,14 +258,14 @@ static png_error process_chunk(png_private *png, uint8_t *data, uint32_t type, u
case PNG_CN_PLTE:
png->pnginfo->num_palette = length / 3;
png->pnginfo->palette = data;
- *keepmem = TRUE;
+ *keepmem = true;
break;
/* transparency information */
case PNG_CN_tRNS:
png->pnginfo->num_trans = length;
png->pnginfo->trans = data;
- *keepmem = TRUE;
+ *keepmem = true;
break;
/* image data */
@@ -281,7 +281,7 @@ static png_error process_chunk(png_private *png, uint8_t *data, uint32_t type, u
(*png->idata_next)->length = length;
(*png->idata_next)->data = data;
png->idata_next = &(*png->idata_next)->next;
- *keepmem = TRUE;
+ *keepmem = true;
break;
/* gamma */
@@ -318,7 +318,7 @@ static png_error process_chunk(png_private *png, uint8_t *data, uint32_t type, u
else
pt->next = text;
- *keepmem = TRUE;
+ *keepmem = true;
break;
}
@@ -523,7 +523,7 @@ png_error png_read_file(util::core_file &fp, png_info *pnginfo)
for ( ; ; )
{
uint32_t chunk_type, chunk_length;
- int keepmem;
+ bool keepmem;
/* read a chunk */
error = read_chunk(fp, &chunk_data, &chunk_type, &chunk_length);
diff --git a/src/lib/util/pool.cpp b/src/lib/util/pool.cpp
index 1acb8d0d6e6..606a7aea4b6 100644
--- a/src/lib/util/pool.cpp
+++ b/src/lib/util/pool.cpp
@@ -367,11 +367,11 @@ void *pool_object_remove(object_pool *pool, void *object, int destruct)
/*-------------------------------------------------
- pool_object_exists - return TRUE if an
+ pool_object_exists - return true if an
object exists in the pool
-------------------------------------------------*/
-int pool_object_exists(object_pool *pool, object_type type, void *object)
+bool pool_object_exists(object_pool *pool, object_type type, void *object)
{
int hashnum = hash_object(object);
object_entry *entry;
@@ -379,9 +379,9 @@ int pool_object_exists(object_pool *pool, object_type type, void *object)
/* find the object in question */
for (entry = pool->hashtable[hashnum]; entry != nullptr; entry = entry->next)
if (entry->object == object && (type == OBJTYPE_WILDCARD || entry->type->type == type))
- return TRUE;
+ return true;
- return FALSE;
+ return false;
}
@@ -418,7 +418,7 @@ object_pool_iterator *pool_iterate_begin(object_pool *pool, object_type type)
object pool
-------------------------------------------------*/
-int pool_iterate_next(object_pool_iterator *iter, void **objectptr, size_t *sizeptr, object_type *typeptr)
+bool pool_iterate_next(object_pool_iterator *iter, void **objectptr, size_t *sizeptr, object_type *typeptr)
{
/* if no previous entry, find the first */
if (iter->last == nullptr)
@@ -435,11 +435,11 @@ int pool_iterate_next(object_pool_iterator *iter, void **objectptr, size_t *size
*sizeptr = iter->last->size;
if (typeptr != nullptr)
*typeptr = iter->last->type->type;
- return TRUE;
+ return true;
}
/* nothing left */
- return FALSE;
+ return false;
}
@@ -479,7 +479,7 @@ void *pool_malloc_file_line(object_pool *pool, size_t size, const char *file, in
void *pool_realloc_file_line(object_pool *pool, void *ptr, size_t size, const char *file, int line)
{
if (ptr != nullptr)
- pool_object_remove(pool, ptr, FALSE);
+ pool_object_remove(pool, ptr, false);
ptr = realloc(ptr, size);
if (size != 0)
pool_object_add_file_line(pool, OBJTYPE_MEMORY, ptr, size, file, line);
@@ -551,7 +551,7 @@ static void report_failure(object_pool *pool, const char *format, ...)
TESTING FUNCTIONS
***************************************************************************/
-static int has_memory_error;
+static bool has_memory_error;
/*-------------------------------------------------
@@ -561,7 +561,7 @@ static int has_memory_error;
static void memory_error(const char *message)
{
printf("memory test failure: %s\n", message);
- has_memory_error = TRUE;
+ has_memory_error = true;
}
@@ -578,13 +578,13 @@ static void memory_error(const char *message)
* @return An int.
*/
-int test_memory_pools(void)
+bool test_memory_pools(void)
{
object_pool *pool;
void *ptrs[16];
int i;
- has_memory_error = FALSE;
+ has_memory_error = false;
pool = pool_alloc_lib(memory_error);
memset(ptrs, 0, sizeof(ptrs));
diff --git a/src/lib/util/pool.h b/src/lib/util/pool.h
index a43dacd87b2..305fc9c5f51 100644
--- a/src/lib/util/pool.h
+++ b/src/lib/util/pool.h
@@ -57,7 +57,7 @@ struct object_pool_iterator;
/* allocate a new object pool */
object_pool *pool_alloc_lib(void (*fail)(const char *message));
-/* register a new object type; returns TRUE if the type already existed and was overridden */
+/* register a new object type; returns true if the type already existed and was overridden */
void pool_type_register(object_pool *pool, object_type type, const char *friendly, void (*destructor)(void *, size_t));
/* free all allocated objects in a pool */
@@ -77,7 +77,7 @@ void *pool_object_add_file_line(object_pool *pool, object_type type, void *objec
void *pool_object_remove(object_pool *pool, void *object, int destruct);
/* does an object exist in the pool? */
-int pool_object_exists(object_pool *pool, object_type type, void *object);
+bool pool_object_exists(object_pool *pool, object_type type, void *object);
@@ -87,7 +87,7 @@ int pool_object_exists(object_pool *pool, object_type type, void *object);
object_pool_iterator *pool_iterate_begin(object_pool *pool, object_type type);
/* get the next object in the object pool */
-int pool_iterate_next(object_pool_iterator *iter, void **objectptr, size_t *sizeptr, object_type *typeptr);
+bool pool_iterate_next(object_pool_iterator *iter, void **objectptr, size_t *sizeptr, object_type *typeptr);
/* finish iterating over objects in an object pool */
void pool_iterate_end(object_pool_iterator *iter);
@@ -110,7 +110,7 @@ char *pool_strdup_file_line(object_pool *pool, const char *str, const char *file
/* ----- miscellaneous ----- */
/* internal unit tests */
-int test_memory_pools(void);
+bool test_memory_pools(void);
#endif /* __POOL_H__ */
diff --git a/src/lib/util/vbiparse.cpp b/src/lib/util/vbiparse.cpp
index 42249ab6794..bfd145dd99f 100644
--- a/src/lib/util/vbiparse.cpp
+++ b/src/lib/util/vbiparse.cpp
@@ -174,7 +174,7 @@ int vbi_parse_manchester_code(const uint16_t *source, int sourcewidth, int sourc
flag" from a line of video data
-------------------------------------------------*/
-int vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift)
+bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift)
{
int histo[256] = { 0 };
int minval = 0xff;
@@ -216,7 +216,7 @@ int vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshif
{
if (PRINTF_WHITE_FLAG)
printf("White flag NOT detected; threshold too low\n");
- return FALSE;
+ return false;
}
/*
@@ -240,7 +240,7 @@ int vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshif
if (histo[x] > histo[peakval])
peakval = x;
- /* return TRUE if it is above the 90% mark */
+ /* return true if it is above the 90% mark */
result = (peakval > minval + 9 * (maxval - minval) / 10);
if (PRINTF_WHITE_FLAG)
printf("White flag %s: peak=%02X thresh=%02X\n", result ? "detected" : "NOT detected", peakval, minval + 9 * (maxval - minval) / 10);
diff --git a/src/lib/util/vbiparse.h b/src/lib/util/vbiparse.h
index ed67a3fee9f..4ccb6a935c4 100644
--- a/src/lib/util/vbiparse.h
+++ b/src/lib/util/vbiparse.h
@@ -78,7 +78,7 @@ struct vbi_metadata
int vbi_parse_manchester_code(const uint16_t *source, int sourcewidth, int sourceshift, int expectedbits, uint32_t *result);
/* compute the "white flag" from a line of video data */
-int vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift);
+bool vbi_parse_white_flag(const uint16_t *source, int sourcewidth, int sourceshift);
/* parse everything from a video frame */
void vbi_parse_all(const uint16_t *source, int sourcerowpixels, int sourcewidth, int sourceshift, vbi_metadata *vbi);
diff --git a/src/lib/util/xmlfile.cpp b/src/lib/util/xmlfile.cpp
index 98689283c4e..0676326fdd8 100644
--- a/src/lib/util/xmlfile.cpp
+++ b/src/lib/util/xmlfile.cpp
@@ -42,7 +42,7 @@ struct xml_parse_info
***************************************************************************/
/* expat interfaces */
-static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts);
+static bool expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts);
static void expat_element_start(void *data, const XML_Char *name, const XML_Char **attributes);
static void expat_data(void *data, const XML_Char *s, int len);
static void expat_element_end(void *data, const XML_Char *name);
@@ -695,7 +695,7 @@ static void *expat_realloc(void *ptr, size_t size)
* @return An int.
*/
-static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts)
+static bool expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opts)
{
XML_Memory_Handling_Suite memcallbacks;
@@ -715,7 +715,7 @@ static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opt
/* create a root node */
parse_info->rootnode = xml_file_create();
if (parse_info->rootnode == nullptr)
- return FALSE;
+ return false;
parse_info->curnode = parse_info->rootnode;
/* create the XML parser */
@@ -726,7 +726,7 @@ static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opt
if (parse_info->parser == nullptr)
{
free(parse_info->rootnode);
- return FALSE;
+ return false;
}
/* configure the parser */
@@ -737,7 +737,7 @@ static int expat_setup_parser(xml_parse_info *parse_info, xml_parse_options *opt
/* optional parser initialization step */
if (opts != nullptr && opts->init_parser != nullptr)
(*opts->init_parser)(parse_info->parser);
- return TRUE;
+ return true;
}
diff --git a/src/lib/util/zippath.cpp b/src/lib/util/zippath.cpp
index 2ee9082a817..f85e5c63b71 100644
--- a/src/lib/util/zippath.cpp
+++ b/src/lib/util/zippath.cpp
@@ -1048,8 +1048,8 @@ const osd::directory::entry *zippath_readdir(zippath_directory *directory)
// -------------------------------------------------
-// zippath_is_zip - returns TRUE if this path is
-// a ZIP path or FALSE if not
+// zippath_is_zip - returns true if this path is
+// a ZIP path or false if not
// -------------------------------------------------
/**
@@ -1062,7 +1062,7 @@ const osd::directory::entry *zippath_readdir(zippath_directory *directory)
* @return An int.
*/
-int zippath_is_zip(zippath_directory *directory)
+bool zippath_is_zip(zippath_directory *directory)
{
return directory->zipfile != nullptr;
}
diff --git a/src/lib/util/zippath.h b/src/lib/util/zippath.h
index 89656e6cf10..3bef7fc9d39 100644
--- a/src/lib/util/zippath.h
+++ b/src/lib/util/zippath.h
@@ -63,8 +63,8 @@ void zippath_closedir(zippath_directory *directory);
// reads a directory entry
const osd::directory::entry *zippath_readdir(zippath_directory *directory);
-// returns TRUE if this path is a ZIP path or FALSE if not
-int zippath_is_zip(zippath_directory *directory);
+// returns true if this path is a ZIP path or false if not
+bool zippath_is_zip(zippath_directory *directory);
} // namespace util