diff options
Diffstat (limited to 'src/osd')
-rw-r--r-- | src/osd/modules/file/posixfile.cpp | 2 | ||||
-rw-r--r-- | src/osd/modules/file/stdfile.cpp | 6 | ||||
-rw-r--r-- | src/osd/modules/file/winfile.cpp | 12 | ||||
-rw-r--r-- | src/osd/modules/output/win32_output.cpp | 8 | ||||
-rw-r--r-- | src/osd/modules/render/drawd3d.cpp | 14 | ||||
-rw-r--r-- | src/osd/modules/render/drawd3d.h | 2 | ||||
-rw-r--r-- | src/osd/osdcomm.h | 13 | ||||
-rw-r--r-- | src/osd/osdcore.h | 14 | ||||
-rw-r--r-- | src/osd/osdsync.cpp | 4 |
9 files changed, 31 insertions, 44 deletions
diff --git a/src/osd/modules/file/posixfile.cpp b/src/osd/modules/file/posixfile.cpp index 370c98afe03..5b90e43a57c 100644 --- a/src/osd/modules/file/posixfile.cpp +++ b/src/osd/modules/file/posixfile.cpp @@ -339,7 +339,7 @@ osd_file::error osd_file::remove(std::string const &filename) // osd_get_physical_drive_geometry //============================================================ -int osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps) +bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps) { return false; // no, no way, huh-uh, forget it } diff --git a/src/osd/modules/file/stdfile.cpp b/src/osd/modules/file/stdfile.cpp index 988000b14c3..611775ab0ba 100644 --- a/src/osd/modules/file/stdfile.cpp +++ b/src/osd/modules/file/stdfile.cpp @@ -167,11 +167,11 @@ osd_file::error osd_file::remove(std::string const &filename) // osd_get_physical_drive_geometry //============================================================ -int osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps) +bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps) { - // there is no standard way of doing this, so we always return FALSE, indicating + // there is no standard way of doing this, so we always return false, indicating // that a given path is not a physical drive - return FALSE; + return false; } diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp index ffc16ae93ff..44f5b5c13ce 100644 --- a/src/osd/modules/file/winfile.cpp +++ b/src/osd/modules/file/winfile.cpp @@ -289,22 +289,22 @@ osd_file::error osd_file::remove(std::string const &filename) // osd_get_physical_drive_geometry //============================================================ -int osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps) +bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps) { DISK_GEOMETRY dg; DWORD bytesRead; HANDLE file; int result; - // if it doesn't smell like a physical drive, just return FALSE + // if it doesn't smell like a physical drive, just return false if (!is_path_to_physical_drive(filename)) - return FALSE; + return false; // do a create file on the drive auto t_filename = osd::text::to_tstring(filename); file = CreateFile(t_filename.c_str(), GENERIC_READ, FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, nullptr); if (file == INVALID_HANDLE_VALUE) - return FALSE; + return false; // device I/O control should return the geometry result = DeviceIoControl(file, IOCTL_DISK_GET_DRIVE_GEOMETRY, nullptr, 0, &dg, sizeof(dg), &bytesRead, nullptr); @@ -312,7 +312,7 @@ int osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, u // if that failed, return false if (!result) - return FALSE; + return false; // store the results *cylinders = (uint32_t)dg.Cylinders.QuadPart; @@ -326,7 +326,7 @@ int osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, u *heads /= 2; *cylinders *= 2; } - return TRUE; + return true; } diff --git a/src/osd/modules/output/win32_output.cpp b/src/osd/modules/output/win32_output.cpp index 810e0dbe79e..d7097d43cf4 100644 --- a/src/osd/modules/output/win32_output.cpp +++ b/src/osd/modules/output/win32_output.cpp @@ -175,7 +175,7 @@ void output_win32::exit() int output_win32::create_window_class(void) { - static uint8_t classes_created = FALSE; + static bool classes_created = false; /* only do this once */ if (!classes_created) @@ -192,7 +192,7 @@ int output_win32::create_window_class(void) // register the class; fail if we can't if (!RegisterClass(&wc)) return 1; - classes_created = TRUE; + classes_created = true; } return 0; @@ -263,7 +263,7 @@ LRESULT output_win32::register_client(HWND hwnd, LPARAM id) LRESULT output_win32::unregister_client(HWND hwnd, LPARAM id) { registered_client **client; - int found = FALSE; + bool found = false; // find any matching IDs in the list and remove them for (client = &m_clientlist; *client != nullptr; client = &(*client)->next) @@ -272,7 +272,7 @@ LRESULT output_win32::unregister_client(HWND hwnd, LPARAM id) registered_client *temp = *client; *client = (*client)->next; global_free(temp); - found = TRUE; + found = true; break; } diff --git a/src/osd/modules/render/drawd3d.cpp b/src/osd/modules/render/drawd3d.cpp index 42fde48d373..74739710c2b 100644 --- a/src/osd/modules/render/drawd3d.cpp +++ b/src/osd/modules/render/drawd3d.cpp @@ -1381,7 +1381,7 @@ void renderer_d3d9::pick_best_mode() // update_window_size //============================================================ -int renderer_d3d9::update_window_size() +bool renderer_d3d9::update_window_size() { auto win = assert_window(); @@ -1395,22 +1395,22 @@ int renderer_d3d9::update_window_size() // clear out any pending resizing if the area didn't change if (win->m_resize_state == RESIZE_STATE_PENDING) win->m_resize_state = RESIZE_STATE_NORMAL; - return FALSE; + return false; } // if we're in the middle of resizing, leave it alone as well if (win->m_resize_state == RESIZE_STATE_RESIZING) - return FALSE; + return false; // set the new bounds and create the device again m_width = rect_width(&client); m_height = rect_height(&client); if (device_create(win->main_window()->platform_window<HWND>())) - return FALSE; + return false; // reset the resize state to normal, and indicate we made a change win->m_resize_state = RESIZE_STATE_NORMAL; - return TRUE; + return true; } @@ -2228,9 +2228,9 @@ void texture_info::compute_size(int texwidth, int texheight) // if we're above the max width/height, do what? if (finalwidth > m_texture_manager->get_max_texture_width() || finalheight > m_texture_manager->get_max_texture_height()) { - static int printed = FALSE; + static bool printed = false; if (!printed) osd_printf_warning("Texture too big! (wanted: %dx%d, max is %dx%d)\n", finalwidth, finalheight, (int)m_texture_manager->get_max_texture_width(), (int)m_texture_manager->get_max_texture_height()); - printed = TRUE; + printed = true; } // compute the U/V scale factors diff --git a/src/osd/modules/render/drawd3d.h b/src/osd/modules/render/drawd3d.h index 4c2a8a6f875..e024694e2ab 100644 --- a/src/osd/modules/render/drawd3d.h +++ b/src/osd/modules/render/drawd3d.h @@ -85,7 +85,7 @@ public: void pick_best_mode(); int get_adapter_for_monitor(); - int update_window_size(); + bool update_window_size(); int pre_window_draw_check(); void begin_frame(); diff --git a/src/osd/osdcomm.h b/src/osd/osdcomm.h index e519b597d96..d6ed9a43a88 100644 --- a/src/osd/osdcomm.h +++ b/src/osd/osdcomm.h @@ -77,19 +77,6 @@ using std::uint64_t; using std::int64_t; /*************************************************************************** - FUNDAMENTAL CONSTANTS -***************************************************************************/ - -/* Ensure that TRUE/FALSE are defined */ -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/*************************************************************************** FUNDAMENTAL MACROS ***************************************************************************/ diff --git a/src/osd/osdcore.h b/src/osd/osdcore.h index 2989f568c73..5a2422e50f9 100644 --- a/src/osd/osdcore.h +++ b/src/osd/osdcore.h @@ -265,11 +265,11 @@ const char *osd_getenv(const char *name); Return value: - TRUE if the filename points to a physical drive and if the values - pointed to by cylinders, heads, sectors, and bps are valid; FALSE in + true if the filename points to a physical drive and if the values + pointed to by cylinders, heads, sectors, and bps are valid; false in any other case -----------------------------------------------------------------------------*/ -int osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps); +bool osd_get_physical_drive_geometry(const char *filename, uint32_t *cylinders, uint32_t *heads, uint32_t *sectors, uint32_t *bps); /*----------------------------------------------------------------------------- @@ -560,10 +560,10 @@ int osd_work_queue_items(osd_work_queue *queue); Return value: - TRUE if the queue is empty; FALSE if the wait timed out before the + true if the queue is empty; false if the wait timed out before the queue was emptied. -----------------------------------------------------------------------------*/ -int osd_work_queue_wait(osd_work_queue *queue, osd_ticks_t timeout); +bool osd_work_queue_wait(osd_work_queue *queue, osd_ticks_t timeout); /*----------------------------------------------------------------------------- @@ -637,10 +637,10 @@ static inline osd_work_item *osd_work_item_queue(osd_work_queue *queue, osd_work Return value: - TRUE if the item completed; FALSE if the wait timed out before the + true if the item completed; false if the wait timed out before the item completed. -----------------------------------------------------------------------------*/ -int osd_work_item_wait(osd_work_item *item, osd_ticks_t timeout); +bool osd_work_item_wait(osd_work_item *item, osd_ticks_t timeout); /*----------------------------------------------------------------------------- diff --git a/src/osd/osdsync.cpp b/src/osd/osdsync.cpp index 3c6600c73e8..2a0e996b465 100644 --- a/src/osd/osdsync.cpp +++ b/src/osd/osdsync.cpp @@ -335,7 +335,7 @@ int osd_work_queue_items(osd_work_queue *queue) // osd_work_queue_wait //============================================================ -int osd_work_queue_wait(osd_work_queue *queue, osd_ticks_t timeout) +bool osd_work_queue_wait(osd_work_queue *queue, osd_ticks_t timeout) { // if no threads, no waiting if (queue->threads == 0) @@ -568,7 +568,7 @@ osd_work_item *osd_work_item_queue_multiple(osd_work_queue *queue, osd_work_call // osd_work_item_wait //============================================================ -int osd_work_item_wait(osd_work_item *item, osd_ticks_t timeout) +bool osd_work_item_wait(osd_work_item *item, osd_ticks_t timeout) { // if we're done already, just return if (item->done) |