chore: replace app header guards w pragma once

main
Sean McBride 4 years ago
parent f7e472a8d9
commit 0eb474a8d7

@ -1,5 +1,4 @@
#ifndef ARCH_AARCH64_CONTEXT_H
#define ARCH_AARCH64_CONTEXT_H
#pragma once
#include <unistd.h>
#include <ucontext.h>
@ -112,5 +111,3 @@ arch_context_switch(arch_context_t *ca, arch_context_t *na)
"d8", "d9", "d10", "d11", "d12", "d13", "d14", "d15");
return 0;
}
#endif /* ARCH_AARCH64_CONTEXT_H */

@ -1,5 +1,4 @@
#ifndef ARCH_CONTEXT_H
#define ARCH_CONTEXT_H
#pragma once
#if defined(AARCH64) || defined(aarch64)
#include "aarch64/context.h"
@ -10,5 +9,3 @@
#define X86_64
#include "x86_64/context.h"
#endif
#endif /* ARCH_CONTEXT_H */

@ -1,5 +1,4 @@
#ifndef ARCH_X86_64_CONTEXT_H
#define ARCH_X86_64_CONTEXT_H
#pragma once
#include <assert.h>
#include <string.h>
@ -162,5 +161,3 @@ arch_context_switch(arch_context_t *current, arch_context_t *next)
return 0;
}
#endif /* ARCH_X86_64_CONTEXT_H */

@ -1,5 +1,4 @@
#ifndef SFRT_CURRENT_SANDBOX_H
#define SFRT_CURRENT_SANDBOX_H
#pragma once
#include "sandbox.h"
#include "types.h"
@ -11,5 +10,3 @@ union uv_any_handle *current_sandbox_get_libuv_handle(int io_handle_index);
int current_sandbox_initialize_io_handle(void);
void current_sandbox_set(struct sandbox *sandbox);
int current_sandbox_set_file_descriptor(int io_handle_index, int file_descriptor);
#endif /* SFRT_CURRENT_SANDBOX_H */

@ -1,9 +1,6 @@
#ifndef SRFT_HTTP_PARSER_SETTINGS_H
#define SRFT_HTTP_PARSER_SETTINGS_H
#pragma once
#include "http_parser.h"
void http_parser_settings_initialize(void);
http_parser_settings *http_parser_settings_get();
#endif /* SRFT_HTTP_PARSER_SETTINGS_H */

@ -1,5 +1,4 @@
#ifndef SFRT_HTTP_REQUEST_H
#define SFRT_HTTP_REQUEST_H
#pragma once
#include <types.h>
@ -28,5 +27,3 @@ struct http_request {
* General HTTP Request Functions *
**************************************************/
int http_request_get_body(struct http_request *http_request, char **body);
#endif /* SFRT_HTTP_HEADER_H */

@ -1,5 +1,4 @@
#ifndef SFRT_HTTP_RESPONSE_H
#define SFRT_HTTP_RESPONSE_H
#pragma once
#include <http_parser.h>
#include <types.h>
@ -36,5 +35,3 @@ int http_response_encode_as_vector(struct http_response *http_response);
int http_response_set_body(struct http_response *http_response, char *body, int length);
int http_response_set_header(struct http_response *http_response, char *h, int length);
int http_response_set_status(struct http_response *http_response, char *status, int length);
#endif /* SFRT_HTTP_RESPONSE_H */

@ -1,6 +1,4 @@
#ifndef SFRT_LIBUV_CALLBACKS_H
#define SFRT_LIBUV_CALLBACKS_H
#pragma once
#include <assert.h>
#include <runtime.h>
@ -89,5 +87,3 @@ libuv_callbacks_on_allocate_setup_request_response_data(uv_handle_t *h, size_t s
buf->base = (sandbox->request_response_data + sandbox->request_response_data_length);
buf->len = l > suggested ? suggested : l;
}
#endif /* SFRT_SANDBOX_H */

@ -1,8 +1,6 @@
#ifndef SFRT_MODULE_H
#define SFRT_MODULE_H
#pragma once
#include <uv.h>
#include <types.h>
struct module {
@ -190,5 +188,3 @@ void module_free(struct module *module);
struct module *module_new(char *mod_name, char *mod_path, i32 argument_count, u32 stack_sz, u32 max_heap,
u32 relative_deadline_us, int port, int req_sz, int resp_sz);
int module_new_from_json(char *filename);
#endif /* SFRT_MODULE_H */

@ -1,5 +1,4 @@
#ifndef SFRT_MODULE_DATABASE_H
#define SFRT_MODULE_DATABASE_H
#pragma once
#include <module.h>
@ -25,5 +24,3 @@ module_database_add(struct module *module)
return 0;
}
#endif /* SFRT_MODULE_DATABASE_H */

@ -1,5 +1,4 @@
#ifndef SFRT_RUNTIME_H
#define SFRT_RUNTIME_H
#pragma once
#include <sys/epoll.h> /* for epoll_create1(), epoll_ctl(), struct epoll_event */
#include "types.h"
@ -15,5 +14,3 @@ void listener_thread_initialize(void);
void stub_init(i32 offset);
unsigned long long __getcycles(void);
#endif /* SFRT_RUNTIME_H */

@ -1,5 +1,4 @@
#ifndef SFRT_SANDBOX_H
#define SFRT_SANDBOX_H
#pragma once
#include <ucontext.h>
#include <uv.h>
@ -224,5 +223,3 @@ sandbox_get_libuv_handle(struct sandbox *sandbox, int io_handle_index)
if (io_handle_index >= SANDBOX_MAX_IO_HANDLE_COUNT || io_handle_index < 0) return NULL;
return &sandbox->io_handles[io_handle_index].libuv_handle;
}
#endif /* SFRT_SANDBOX_H */

@ -1,10 +1,7 @@
#ifndef SFRT_SANDBOX_COMPLETION_QUEUE_H
#define SFRT_SANDBOX_COMPLETION_QUEUE_H
#pragma once
#include "sandbox.h"
void sandbox_completion_queue_add(struct sandbox *sandbox);
void sandbox_completion_queue_free();
void sandbox_completion_queue_initialize();
#endif /* SFRT_SANDBOX_COMPLETION_QUEUE_H */

@ -1,5 +1,4 @@
#ifndef SFRT_SANDBOX_REQUEST_H
#define SFRT_SANDBOX_REQUEST_H
#pragma once
#include <stdbool.h>
@ -48,5 +47,3 @@ sandbox_request_allocate(struct module *module, char *arguments, int socket_desc
debuglog("[%p: %s]\n", sandbox_request, sandbox_request->module->name);
return sandbox_request;
}
#endif /* SFRT_SANDBOX_REQUEST_H */

@ -1,5 +1,4 @@
#ifndef SFRT_SANDBOX_REQUEST_SCHEDULER_H
#define SFRT_SANDBOX_REQUEST_SCHEDULER_H
#pragma once
#include <sandbox_request.h>
@ -20,5 +19,3 @@ void sandbox_request_scheduler_initialize(sandbox_request_scheduler_config_t *co
sandbox_request_t *sandbox_request_scheduler_add(sandbox_request_t *);
sandbox_request_t *sandbox_request_scheduler_remove();
uint64_t sandbox_request_scheduler_peek();
#endif /* SFRT_SANDBOX_REQUEST_SCHEDULER_H */

@ -1,8 +1,5 @@
#ifndef SFRT_SANDBOX_REQUEST_SCHEDULER_FIFO_H
#define SFRT_SANDBOX_REQUEST_SCHEDULER_FIFO_H
#pragma once
#include <sandbox_request_scheduler.h>
void sandbox_request_scheduler_fifo_initialize();
#endif /* SFRT_SANDBOX_REQUEST_SCHEDULER_FIFO_H */

@ -1,8 +1,5 @@
#ifndef SFRT_SANDBOX_REQUEST_SCHEDULER_PS_H
#define SFRT_SANDBOX_REQUEST_SCHEDULER_PS_H
#pragma once
#include <sandbox_request_scheduler.h>
void sandbox_request_scheduler_ps_initialize();
#endif /* SFRT_SANDBOX_REQUEST_SCHEDULER_PS_H */

@ -1,5 +1,4 @@
#ifndef SFRT_SANDBOX_RUN_QUEUE_H
#define SFRT_SANDBOX_RUN_QUEUE_H
#pragma once
#include <stdbool.h>
#include <sandbox.h>
@ -29,6 +28,3 @@ void sandbox_run_queue_delete(struct sandbox *);
bool sandbox_run_queue_is_empty();
struct sandbox *sandbox_run_queue_get_next();
void sandbox_run_queue_preempt(ucontext_t *);
#endif /* SFRT_SANDBOX_RUN_QUEUE_H */

@ -1,8 +1,5 @@
#ifndef SFRT_SANDBOX_RUN_QUEUE_FIFO_H
#define SFRT_SANDBOX_RUN_QUEUE_FIFO_H
#pragma once
#include "sandbox.h"
void sandbox_run_queue_fifo_initialize();
#endif /* SFRT_SANDBOX_RUN_QUEUE_FIFO_H */

@ -1,8 +1,5 @@
#ifndef SFRT_SANDBOX_RUN_QUEUE_PS_H
#define SFRT_SANDBOX_RUN_QUEUE_PS_H
#pragma once
#include "sandbox.h"
void sandbox_run_queue_ps_initialize();
#endif /* SFRT_SANDBOX_RUN_QUEUE_PS_H */

@ -1,5 +1,4 @@
#ifndef SFRT_SOFTWARE_INTERRUPT_H
#define SFRT_SOFTWARE_INTERRUPT_H
#pragma once
#include <stdbool.h>
#include <assert.h>
@ -99,5 +98,3 @@ software_interrupt_unmask_signal(int signal)
void software_interrupt_initialize(void);
void software_interrupt_arm_timer(void);
void software_interrupt_disarm_timer(void);
#endif /* SFRT_SOFTWARE_INTERRUPT_H */

@ -1,5 +1,4 @@
#ifndef SFRT_TYPES_H
#define SFRT_TYPES_H
#pragma once
#include <assert.h>
#include <errno.h>
@ -150,6 +149,3 @@ typedef void (*mod_libc_fn_t)(i32, i32);
/* If multicore, use all but the dedicated listener core
If there are fewer cores than this, main dynamically overrides this and uses all available */
#define WORKER_THREAD_CORE_COUNT (NCORES > 1 ? NCORES - 1 : NCORES)
#endif /* SFRT_TYPES_H */

@ -1,5 +1,4 @@
#ifndef SFRT_WORKER_THREAD_H
#define SFRT_WORKER_THREAD_H
#pragma once
#include <uv.h>
#include "types.h"
@ -56,5 +55,3 @@ worker_thread_get_libuv_handle(void)
{
return &worker_thread_uvio_handle;
}
#endif /* SFRT_WORKER_THREAD_H */

Loading…
Cancel
Save