chore: suffix fn typedefs with _fn_t

main
Sean McBride 4 years ago
parent ab41672359
commit 46881a0f26

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

@ -4,14 +4,14 @@
#include <sandbox_request.h>
/* 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;

@ -5,19 +5,18 @@
#include <sandbox.h>
/* 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;

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

Loading…
Cancel
Save