whitespace

This commit is contained in:
Brad Parker 2016-10-02 16:35:27 -04:00
parent cf3ae942c2
commit 88d70d7da6
2 changed files with 15 additions and 15 deletions

View File

@ -37,14 +37,14 @@ enum task_queue_ctl_state
TASK_QUEUE_CTL_NONE = 0, TASK_QUEUE_CTL_NONE = 0,
/* Deinitializes the task system. /* Deinitializes the task system.
* This deinitializes the task system. * This deinitializes the task system.
* The tasks that are running at * The tasks that are running at
* the moment will stay on hold * the moment will stay on hold
* until TASK_QUEUE_CTL_INIT is called again. */ * until TASK_QUEUE_CTL_INIT is called again. */
TASK_QUEUE_CTL_DEINIT, TASK_QUEUE_CTL_DEINIT,
/* Initializes the task system. /* Initializes the task system.
* This initializes the task system * This initializes the task system
* and chooses an appropriate * and chooses an appropriate
* implementation according to the settings. * implementation according to the settings.
* *
@ -52,7 +52,7 @@ enum task_queue_ctl_state
TASK_QUEUE_CTL_INIT, TASK_QUEUE_CTL_INIT,
/** /**
* Calls func for every running task * Calls func for every running task
* until it returns true. * until it returns true.
* Returns a task or NULL if not found. * Returns a task or NULL if not found.
*/ */
@ -71,7 +71,7 @@ enum task_queue_ctl_state
TASK_QUEUE_CTL_WAIT, TASK_QUEUE_CTL_WAIT,
/* Checks for finished tasks /* Checks for finished tasks
* Takes the finished tasks, if any, * Takes the finished tasks, if any,
* and runs their callbacks. * and runs their callbacks.
* This must only be called from the main thread. */ * This must only be called from the main thread. */
TASK_QUEUE_CTL_CHECK, TASK_QUEUE_CTL_CHECK,
@ -93,7 +93,7 @@ enum task_queue_ctl_state
TASK_QUEUE_CTL_UNSET_THREADED, TASK_QUEUE_CTL_UNSET_THREADED,
TASK_QUEUE_CTL_IS_THREADED, TASK_QUEUE_CTL_IS_THREADED,
/** /**
* Signals a task to end without waiting for * Signals a task to end without waiting for
* it to complete. */ * it to complete. */
@ -127,11 +127,11 @@ struct retro_task
* be called immediately after running the main callback */ * be called immediately after running the main callback */
retro_task_handler_t cleanup; retro_task_handler_t cleanup;
/* set to true by the handler to signal /* set to true by the handler to signal
* the task has finished executing. */ * the task has finished executing. */
bool finished; bool finished;
/* set to true by the task system /* set to true by the task system
* to signal the task *must* end. */ * to signal the task *must* end. */
bool cancelled; bool cancelled;
@ -147,14 +147,14 @@ struct retro_task
/* created and destroyed by the code related to the handler */ /* created and destroyed by the code related to the handler */
void *state; void *state;
/* created by task handler; destroyed by main loop /* created by task handler; destroyed by main loop
* (after calling the callback) */ * (after calling the callback) */
char *error; char *error;
/* -1 = unmettered, 0-100 progress value */ /* -1 = unmettered, 0-100 progress value */
int8_t progress; int8_t progress;
/* handler can modify but will be /* handler can modify but will be
* free()d automatically if non-NULL. */ * free()d automatically if non-NULL. */
char *title; char *title;

View File

@ -61,7 +61,7 @@ static void task_queue_msg_push(unsigned prio, unsigned duration,
#endif #endif
char buf[1024]; char buf[1024];
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap); vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap); va_end(ap);
@ -155,7 +155,7 @@ static void retro_task_regular_cancel(void *task)
retro_task_t *t = (retro_task_t*)task; retro_task_t *t = (retro_task_t*)task;
t->cancelled = true; t->cancelled = true;
} }
static void retro_task_regular_gather(void) static void retro_task_regular_gather(void)
{ {
retro_task_t *task = NULL; retro_task_t *task = NULL;
@ -324,7 +324,7 @@ static void retro_task_threaded_cancel(void *task)
retro_task_t *t; retro_task_t *t;
slock_lock(running_lock); slock_lock(running_lock);
for (t = tasks_running.front; t; t = t->next) for (t = tasks_running.front; t; t = t->next)
{ {
if (t == task) if (t == task)
@ -556,7 +556,7 @@ bool task_queue_ctl(enum task_queue_ctl_state state, void *data)
{ {
#ifdef HAVE_THREADS #ifdef HAVE_THREADS
bool current_threaded = (impl_current == &impl_threaded); bool current_threaded = (impl_current == &impl_threaded);
bool want_threaded = bool want_threaded =
task_queue_ctl(TASK_QUEUE_CTL_IS_THREADED, NULL); task_queue_ctl(TASK_QUEUE_CTL_IS_THREADED, NULL);
if (want_threaded != current_threaded) if (want_threaded != current_threaded)
@ -571,7 +571,7 @@ bool task_queue_ctl(enum task_queue_ctl_state state, void *data)
break; break;
case TASK_QUEUE_CTL_PUSH: case TASK_QUEUE_CTL_PUSH:
{ {
/* The lack of NULL checks in the following functions /* The lack of NULL checks in the following functions
* is proposital to ensure correct control flow by the users. */ * is proposital to ensure correct control flow by the users. */
retro_task_t *task = (retro_task_t*)data; retro_task_t *task = (retro_task_t*)data;
impl_current->push_running(task); impl_current->push_running(task);