diff options
author | David Robillard <d@drobilla.net> | 2024-06-22 18:46:19 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-06-22 18:59:26 -0400 |
commit | aad5574b4d52f0f02ed1ec3d8f1e12227176a98e (patch) | |
tree | f7439857e05904e78f8b1012c48c5a313e4788d8 | |
parent | d29acfa029c0a0dd0e8167b88f15549c67c410e8 (diff) | |
download | zix-aad5574b4d52f0f02ed1ec3d8f1e12227176a98e.tar.gz zix-aad5574b4d52f0f02ed1ec3d8f1e12227176a98e.tar.bz2 zix-aad5574b4d52f0f02ed1ec3d8f1e12227176a98e.zip |
Fix whitespace and add code formatting test
-rw-r--r-- | include/zix/hash.h | 4 | ||||
-rw-r--r-- | include/zix/sem.h | 4 | ||||
-rw-r--r-- | test/meson.build | 13 |
3 files changed, 16 insertions, 5 deletions
diff --git a/include/zix/hash.h b/include/zix/hash.h index e425b9f..2bde652 100644 --- a/include/zix/hash.h +++ b/include/zix/hash.h @@ -28,14 +28,14 @@ ZIX_BEGIN_DECLS #if defined(ZIX_HASH_KEY_TYPE) typedef ZIX_HASH_KEY_TYPE ZixHashKey; #else -typedef void ZixHashKey; ///< The type of a key within a record +typedef void ZixHashKey; ///< The type of a key within a record #endif // ZIX_HASH_RECORD_TYPE can be defined to make the API more type-safe #if defined(ZIX_HASH_RECORD_TYPE) typedef ZIX_HASH_RECORD_TYPE ZixHashRecord; #else -typedef void ZixHashRecord; ///< The type of a hash table record +typedef void ZixHashRecord; ///< The type of a hash table record #endif // ZIX_HASH_SEARCH_DATA_TYPE can be defined to make the API more type-safe diff --git a/include/zix/sem.h b/include/zix/sem.h index 8aa205e..42dd6c3 100644 --- a/include/zix/sem.h +++ b/include/zix/sem.h @@ -30,8 +30,8 @@ ZIX_BEGIN_DECLS This is an integer that is never negative, and has two main operations: increment (post) and decrement (wait). If a decrement can't be performed - (because the value is 0) the caller will be blocked until another thread posts - and the operation can succeed. + (because the value is 0) the caller will be blocked until another thread + posts and the operation can succeed. Semaphores can be created with any starting value, but typically this will be 0 so the semaphore can be used as a simple signal where each post diff --git a/test/meson.build b/test/meson.build index 15f449c..2ef815e 100644 --- a/test/meson.build +++ b/test/meson.build @@ -23,6 +23,17 @@ if not meson.is_subproject() and get_option('lint') suite: 'data', ) endif + + # Check code formatting + clang_format = find_program('clang-format', required: false) + if clang_format.found() + test( + 'format', + clang_format, + args: ['--Werror', '--dry-run'] + c_headers + sources, + suite: 'code', + ) + endif endif # Set warning suppression flags specific to tests @@ -103,7 +114,7 @@ foreach test, cases : sequential_tests endforeach endforeach -# Test multi-threaded +# Test multi-threaded if thread_dep.found() foreach test, cases : threaded_tests sources = common_test_sources + files('test_@0@.c'.format(test)) |