aboutsummaryrefslogtreecommitdiffstats
path: root/lv2/atom/atom-test-utils.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-12-26 19:21:17 +0100
committerDavid Robillard <d@drobilla.net>2020-12-26 19:21:17 +0100
commit882b9446cbf7316345de391188e68c2a7333da5b (patch)
tree5baf31e0a28313b380cc7e8694b09a2a517d14f3 /lv2/atom/atom-test-utils.c
parent8d2251749da9e0ae4254502edfc8917236a9b8c0 (diff)
downloadlv2-882b9446cbf7316345de391188e68c2a7333da5b.tar.xz
Format all code with clang-format
Diffstat (limited to 'lv2/atom/atom-test-utils.c')
-rw-r--r--lv2/atom/atom-test-utils.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/lv2/atom/atom-test-utils.c b/lv2/atom/atom-test-utils.c
index 50e8887..b015cec 100644
--- a/lv2/atom/atom-test-utils.c
+++ b/lv2/atom/atom-test-utils.c
@@ -30,44 +30,44 @@ static uint32_t n_uris = 0;
static char*
copy_string(const char* str)
{
- const size_t len = strlen(str);
- char* dup = (char*)malloc(len + 1);
- memcpy(dup, str, len + 1);
- return dup;
+ const size_t len = strlen(str);
+ char* dup = (char*)malloc(len + 1);
+ memcpy(dup, str, len + 1);
+ return dup;
}
static LV2_URID
urid_map(LV2_URID_Map_Handle handle, const char* uri)
{
- for (uint32_t i = 0; i < n_uris; ++i) {
- if (!strcmp(uris[i], uri)) {
- return i + 1;
- }
- }
+ for (uint32_t i = 0; i < n_uris; ++i) {
+ if (!strcmp(uris[i], uri)) {
+ return i + 1;
+ }
+ }
- uris = (char**)realloc(uris, ++n_uris * sizeof(char*));
- uris[n_uris - 1] = copy_string(uri);
- return n_uris;
+ uris = (char**)realloc(uris, ++n_uris * sizeof(char*));
+ uris[n_uris - 1] = copy_string(uri);
+ return n_uris;
}
static void
free_urid_map(void)
{
- for (uint32_t i = 0; i < n_uris; ++i) {
- free(uris[i]);
- }
+ for (uint32_t i = 0; i < n_uris; ++i) {
+ free(uris[i]);
+ }
- free(uris);
+ free(uris);
}
LV2_LOG_FUNC(1, 2)
static int
test_fail(const char* fmt, ...)
{
- va_list args;
- va_start(args, fmt);
- fprintf(stderr, "error: ");
- vfprintf(stderr, fmt, args);
- va_end(args);
- return 1;
+ va_list args;
+ va_start(args, fmt);
+ fprintf(stderr, "error: ");
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+ return 1;
}