Skip to content

Commit

Permalink
Indent
Browse files Browse the repository at this point in the history
  • Loading branch information
38 committed Aug 18, 2018
1 parent ef7e1df commit 518c184
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions lib/pstd/include/pstd/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ typedef struct {
typedef int (*pstd_type_assertion_t)(pipe_t pipe, const char* type, void* data);

/**
* @brief The callback function for type check has been completed done.
* @brief The callback function for type check has been completed done.
* This function is called when the analysis on current pipe is completed done.
* @detail This is useful when we want to validate the type shape of a field, because we cannot use type assertion,
* since we call the type assertion before all the accessor has been resolved.
* since we call the type assertion before all the accessor has been resolved.
* In addition the type assertion is served as the assertion on pipe. So it's a bad idea that we check the
* field information in the function.
* That is why we need such a callback.
* Unlike the type assertion, this callback is actually called after everything for this pipe is done.
* Unlike the type assertion, this callback is actually called after everything for this pipe is done.
* And the accessor layout is not allowed to change.
* @param pipe The pipe descriptor for which the framework called the callback function.
* @param data The additional data we want to pass to this function
Expand Down
18 changes: 9 additions & 9 deletions servlets/language/rust/servlet.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef void* (*rust_bootstrap_func_t)(uint32_t argc, char const* const* argv, p
* @param self The rust servlet object
* @param argc The number of arguments
* @param argv The argument list
* @param tm The type model object
* @param tm The type model object
* @return status code
**/
typedef int (*rust_servlet_init_func_t)(void* self, uint32_t argc, char const* const* argv);
Expand All @@ -63,7 +63,7 @@ typedef int (*rust_servlet_cleanup_func_t)(void* self);
* @brief The asynchronous Rust servlet task init function
* @param self The servlet object
* @param handle The task handle
* @param type_inst The type instance
* @param type_inst The type instance
* @return The private task data or NULL on error case
**/
typedef void* (*rust_servlet_async_init_func_t)(void* self, void* handle, pstd_type_instance_t* type_inst);
Expand All @@ -77,7 +77,7 @@ typedef void* (*rust_servlet_async_init_func_t)(void* self, void* handle, pstd_t
typedef int (*rust_servlet_async_exec_func_t)(void* handle, void* task_data);

/**
* @brief The async Rust servlet cleanup
* @brief The async Rust servlet cleanup
* @param self The servlet object
* @param handle The task handle
* @param task_data The task data
Expand Down Expand Up @@ -120,7 +120,7 @@ static void _va_list_wrapper(rust_va_list_callback_func_t cont, void* data, ...)

static int _init(uint32_t argc, char const* const* argv, void* ctxmem)
{
if(argc < 2)
if(argc < 2)
ERROR_RETURN_LOG(int, "Invalid servlet init string, expected: %s [rust_shared_object] <params>", argv[0]);

context_t* ctx = (context_t*)ctxmem;
Expand All @@ -142,16 +142,16 @@ static int _init(uint32_t argc, char const* const* argv, void* ctxmem)

if(NULL == (ctx->exec_func = (rust_servlet_exec_func_t)dlsym(ctx->dl_handle, "_rs_invoke_exec")))
ERROR_LOG_ERRNO_GOTO(ERR, "Cannot find symbol _rs_invoke_exec, make sure you are loading a Rust servlet binary (dlsym: %s)", dlerror());

if(NULL == (ctx->cleanup_func = (rust_servlet_cleanup_func_t)dlsym(ctx->dl_handle, "_rs_invoke_cleanup")))
ERROR_LOG_ERRNO_GOTO(ERR, "Cannot find symbol _rs_invoke_cleanup, make sure you are loading a Rust servlet binary (dlsym: %s)", dlerror());

if(NULL == (ctx->async_init_func = (rust_servlet_async_init_func_t)dlsym(ctx->dl_handle, "_rs_invoke_async_init")))
ERROR_LOG_ERRNO_GOTO(ERR, "Cannot find symbol _rs_invoke_async_init, make sure you are loading a Rust servlet binary (dlsym: %s)", dlerror());

if(NULL == (ctx->async_exec_func = (rust_servlet_async_exec_func_t)dlsym(ctx->dl_handle, "_rs_invoke_async_exec")))
ERROR_LOG_ERRNO_GOTO(ERR, "Cannot find symbol _rs_invoke_async_exec, make sure you are loading a Rust servlet binary (dlsym: %s)", dlerror());

if(NULL == (ctx->async_cleanup_func = (rust_servlet_async_cleanup_func_t)dlsym(ctx->dl_handle, "_rs_invoke_async_cleanup")))
ERROR_LOG_ERRNO_GOTO(ERR, "Cannot find symbol _rs_invoke_async_cleanup, make sure you are loading a Rust servlet binary (dlsym: %s)", dlerror());

Expand Down Expand Up @@ -200,7 +200,7 @@ static int _async_setup(async_handle_t* task_handle, void* task_data, void* ctxm
{
context_t* ctx = (context_t*)ctxmem;
async_data_t* async_data = (async_data_t*)task_data;

pstd_type_instance_t* type_inst = PSTD_TYPE_INSTANCE_LOCAL_NEW(ctx->type_model);

if(NULL == (async_data->rust_obj = ctx->async_init_func(ctx->rust_servlet_obj, task_handle, type_inst)))
Expand All @@ -225,7 +225,7 @@ static int _async_cleanup(async_handle_t* task_handle, void* task_data, void* ct
{
context_t* ctx = (context_t*)ctxmem;
async_data_t* async_data = (async_data_t*)task_data;

pstd_type_instance_t* type_inst = PSTD_TYPE_INSTANCE_LOCAL_NEW(ctx->type_model);

int rc = ctx->async_cleanup_func(ctx->rust_servlet_obj, task_handle, async_data->rust_obj, type_inst);
Expand Down

0 comments on commit 518c184

Please sign in to comment.