diff options
author | David Robillard <d@drobilla.net> | 2020-12-26 19:24:15 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-12-31 13:37:55 +0100 |
commit | 9f5fb1cf1b3df6a86d6571886169455d9d9ec393 (patch) | |
tree | 0e7515a3d319eb06b5450e3482055fc269503f1c /src/host.c | |
parent | 1fece68f494158fff81fd3dca5a928860d5a6376 (diff) | |
download | suil-9f5fb1cf1b3df6a86d6571886169455d9d9ec393.tar.gz suil-9f5fb1cf1b3df6a86d6571886169455d9d9ec393.tar.bz2 suil-9f5fb1cf1b3df6a86d6571886169455d9d9ec393.zip |
Format all code with clang-format
Diffstat (limited to 'src/host.c')
-rw-r--r-- | src/host.c | 70 |
1 files changed, 36 insertions, 34 deletions
@@ -33,53 +33,55 @@ suil_host_new(SuilPortWriteFunc write_func, SuilPortSubscribeFunc subscribe_func, SuilPortUnsubscribeFunc unsubscribe_func) { - SuilHost* host = (SuilHost*)calloc(1, sizeof(struct SuilHostImpl)); - host->write_func = write_func; - host->index_func = index_func; - host->subscribe_func = subscribe_func; - host->unsubscribe_func = unsubscribe_func; - host->argc = suil_argc; - host->argv = suil_argv; - return host; + SuilHost* host = (SuilHost*)calloc(1, sizeof(struct SuilHostImpl)); + + host->write_func = write_func; + host->index_func = index_func; + host->subscribe_func = subscribe_func; + host->unsubscribe_func = unsubscribe_func; + host->argc = suil_argc; + host->argv = suil_argv; + + return host; } SUIL_API void -suil_host_set_touch_func(SuilHost* host, - SuilTouchFunc touch_func) +suil_host_set_touch_func(SuilHost* host, SuilTouchFunc touch_func) { - host->touch_func = touch_func; + host->touch_func = touch_func; } SUIL_API void suil_host_free(SuilHost* host) { - if (host) { - if (host->gtk_lib) { - dylib_close(host->gtk_lib); - } - free(host); - } + if (host) { + if (host->gtk_lib) { + dylib_close(host->gtk_lib); + } + + free(host); + } } #ifdef SUIL_WITH_X11 static void suil_load_init_module(const char* module_name) { - void* const lib = suil_open_module(module_name); - if (!lib) { - return; - } - - SuilVoidFunc init_func = suil_dlfunc(lib, "suil_host_init"); - if (init_func) { - (*init_func)(); - } else { - SUIL_ERRORF("Corrupt init module %s\n", module_name); - } - - dylib_close(lib); + void* const lib = suil_open_module(module_name); + if (!lib) { + return; + } + + SuilVoidFunc init_func = suil_dlfunc(lib, "suil_host_init"); + if (init_func) { + (*init_func)(); + } else { + SUIL_ERRORF("Corrupt init module %s\n", module_name); + } + + dylib_close(lib); } #endif @@ -87,12 +89,12 @@ SUIL_API void suil_init(int* argc, char*** argv, SuilArg key, ...) { - (void)key; + (void)key; - suil_argc = argc ? *argc : 0; - suil_argv = argv ? *argv : NULL; + suil_argc = argc ? *argc : 0; + suil_argv = argv ? *argv : NULL; #ifdef SUIL_WITH_X11 - suil_load_init_module("suil_x11"); + suil_load_init_module("suil_x11"); #endif } |