final cleanup of TRUE/FALSE, left only in windows section where it represent BOOL (nw)

This commit is contained in:
Miodrag Milanovic 2016-10-22 19:07:11 +02:00
parent 88b5a5c09f
commit a3d7454412
9 changed files with 31 additions and 44 deletions

View File

@ -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
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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

View File

@ -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();

View File

@ -76,19 +76,6 @@ using std::int32_t;
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
***************************************************************************/

View File

@ -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);
/*-----------------------------------------------------------------------------

View File

@ -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)