summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/osdsync.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/osdsync.cpp')
-rw-r--r--src/osd/osdsync.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/osd/osdsync.cpp b/src/osd/osdsync.cpp
index f8143aa2c51..85950b33093 100644
--- a/src/osd/osdsync.cpp
+++ b/src/osd/osdsync.cpp
@@ -10,10 +10,10 @@
#include <windows.h>
#include <process.h>
#include <tchar.h>
-#include <stdlib.h>
+#include <cstdlib>
#ifdef __GNUC__
-#include <stdint.h>
+#include <cstdint>
#endif
#endif
#include <mutex>
@@ -85,7 +85,7 @@ static void spin_while_not(const volatile _AtomType * volatile atom, const _Main
// osd_num_processors
//============================================================
-int osd_get_num_processors(void)
+int osd_get_num_processors()
{
#if defined(SDLMAME_EMSCRIPTEN)
// multithreading is not supported at this time
@@ -211,7 +211,7 @@ int osd_num_processors = 0;
// FUNCTION PROTOTYPES
//============================================================
-static int effective_num_processors(void);
+static int effective_num_processors();
static void * worker_thread_entry(void *param);
static void worker_thread_process(osd_work_queue *queue, work_thread_info *thread);
static bool queue_has_list_items(osd_work_queue *queue);
@@ -445,20 +445,18 @@ void osd_work_queue_free(osd_work_queue *queue)
// free all items in the free list
while (queue->free.load() != nullptr)
{
- osd_work_item *item = (osd_work_item *)queue->free;
+ auto *item = (osd_work_item *)queue->free;
queue->free = item->next;
- if (item->event != nullptr)
- delete item->event;
+ delete item->event;
delete item;
}
// free all items in the active list
while (queue->list.load() != nullptr)
{
- osd_work_item *item = (osd_work_item *)queue->list;
+ auto *item = (osd_work_item *)queue->list;
queue->list = item->next;
- if (item->event != nullptr)
- delete item->event;
+ delete item->event;
delete item;
}
@@ -641,7 +639,7 @@ void osd_work_item_release(osd_work_item *item)
// effective_num_processors
//============================================================
-static int effective_num_processors(void)
+static int effective_num_processors()
{
int physprocs = osd_get_num_processors();
@@ -672,7 +670,7 @@ static int effective_num_processors(void)
static void *worker_thread_entry(void *param)
{
- work_thread_info *thread = (work_thread_info *)param;
+ auto *thread = (work_thread_info *)param;
osd_work_queue &queue = thread->queue;
// loop until we exit