From 46881a0f26809cd2a6560e172a1e93ed3c6e7025 Mon Sep 17 00:00:00 2001 From: Sean McBride Date: Wed, 1 Jul 2020 15:26:41 -0400 Subject: [PATCH] chore: suffix fn typedefs with _fn_t --- runtime/include/priority_queue.h | 14 ++++++------ runtime/include/sandbox_request_scheduler.h | 14 ++++++------ runtime/include/sandbox_run_queue.h | 25 ++++++++++----------- runtime/src/priority_queue.c | 2 +- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/runtime/include/priority_queue.h b/runtime/include/priority_queue.h index 5a73c02..fdda889 100644 --- a/runtime/include/priority_queue.h +++ b/runtime/include/priority_queue.h @@ -13,18 +13,18 @@ * @param element * @returns priority (a u64) */ -typedef uint64_t (*priority_queue_get_priority_t)(void *element); +typedef uint64_t (*priority_queue_get_priority_fn_t)(void *element); /* We assume that priority is expressed in terms of a 64 bit unsigned integral */ struct priority_queue { - ck_spinlock_fas_t lock; - uint64_t highest_priority; - void * items[MAX]; - int first_free; - priority_queue_get_priority_t get_priority; + ck_spinlock_fas_t lock; + uint64_t highest_priority; + void * items[MAX]; + int first_free; + priority_queue_get_priority_fn_t get_priority; }; -void priority_queue_initialize(struct priority_queue *self, priority_queue_get_priority_t get_priority); +void priority_queue_initialize(struct priority_queue *self, priority_queue_get_priority_fn_t get_priority); int priority_queue_enqueue(struct priority_queue *self, void *value, char *name); void * priority_queue_dequeue(struct priority_queue *self, char *name); int priority_queue_length(struct priority_queue *self); diff --git a/runtime/include/sandbox_request_scheduler.h b/runtime/include/sandbox_request_scheduler.h index a043371..d5ae5e8 100644 --- a/runtime/include/sandbox_request_scheduler.h +++ b/runtime/include/sandbox_request_scheduler.h @@ -4,14 +4,14 @@ #include /* Returns pointer back if successful, null otherwise */ -typedef sandbox_request_t *(*sandbox_request_scheduler_add_t)(void *); -typedef sandbox_request_t *(*sandbox_request_scheduler_remove_t)(void); -typedef uint64_t (*sandbox_request_scheduler_peek_t)(void); +typedef sandbox_request_t *(*sandbox_request_scheduler_add_fn_t)(void *); +typedef sandbox_request_t *(*sandbox_request_scheduler_remove_fn_t)(void); +typedef uint64_t (*sandbox_request_scheduler_peek_fn_t)(void); -typedef struct sandbox_request_scheduler_config_t { - sandbox_request_scheduler_add_t add; - sandbox_request_scheduler_remove_t remove; - sandbox_request_scheduler_peek_t peek; +typedef struct sandbox_request_scheduler_config { + sandbox_request_scheduler_add_fn_t add; + sandbox_request_scheduler_remove_fn_t remove; + sandbox_request_scheduler_peek_fn_t peek; } sandbox_request_scheduler_config_t; diff --git a/runtime/include/sandbox_run_queue.h b/runtime/include/sandbox_run_queue.h index d0eafe8..b0b779b 100644 --- a/runtime/include/sandbox_run_queue.h +++ b/runtime/include/sandbox_run_queue.h @@ -5,19 +5,18 @@ #include /* Returns pointer back if successful, null otherwise */ -typedef struct sandbox *(*sandbox_run_queue_add_t)(struct sandbox *); -typedef bool (*sandbox_run_queue_is_empty_t)(void); -typedef void (*sandbox_run_queue_delete_t)(struct sandbox *sandbox); -typedef struct sandbox *(*sandbox_run_queue_get_next_t)(); - -typedef void (*sandbox_run_queue_preempt_t)(ucontext_t *); - -typedef struct sandbox_run_queue_config_t { - sandbox_run_queue_add_t add; - sandbox_run_queue_is_empty_t is_empty; - sandbox_run_queue_delete_t delete; - sandbox_run_queue_get_next_t get_next; - sandbox_run_queue_preempt_t preempt; +typedef struct sandbox *(*sandbox_run_queue_add_fn_t)(struct sandbox *); +typedef bool (*sandbox_run_queue_is_empty_fn_t)(void); +typedef void (*sandbox_run_queue_delete_fn_t)(struct sandbox *sandbox); +typedef struct sandbox *(*sandbox_run_queue_get_next_fn_t)(); +typedef void (*sandbox_run_queue_preempt_fn_t)(ucontext_t *); + +typedef struct sandbox_run_queue_config { + sandbox_run_queue_add_fn_t add; + sandbox_run_queue_is_empty_fn_t is_empty; + sandbox_run_queue_delete_fn_t delete; + sandbox_run_queue_get_next_fn_t get_next; + sandbox_run_queue_preempt_fn_t preempt; } sandbox_run_queue_config_t; diff --git a/runtime/src/priority_queue.c b/runtime/src/priority_queue.c index fd5b9fd..cbdb533 100644 --- a/runtime/src/priority_queue.c +++ b/runtime/src/priority_queue.c @@ -119,7 +119,7 @@ priority_queue_percolate_down(struct priority_queue *self, int parent_index) * @param get_priority pointer to a function that returns the priority of an element */ void -priority_queue_initialize(struct priority_queue *self, priority_queue_get_priority_t get_priority) +priority_queue_initialize(struct priority_queue *self, priority_queue_get_priority_fn_t get_priority) { assert(self != NULL); assert(get_priority != NULL);