Skip to content

Commit

Permalink
clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
thinks committed Oct 26, 2024
1 parent c39b187 commit 9ad3874
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Checks: "-*,\
-readability-magic-numbers,\
-readability-identifier-length,\
-readability-function-cognitive-complexity"
WarningsAsErrors: ''
WarningsAsErrors: '*'
CheckOptions:
- key: 'bugprone-argument-comment.StrictMode'
value: 'true'
Expand Down
8 changes: 4 additions & 4 deletions include/thinks/tph_poisson.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ extern "C" {
#define TPH_POISSON_CEIL ceilf
#define TPH_POISSON_FLOOR floorf
#endif
/* clang-format on */

typedef TPH_POISSON_REAL_TYPE tph_poisson_real;

/* clang-format off */
typedef struct tph_poisson_args_ tph_poisson_args;
typedef struct tph_poisson_allocator_ tph_poisson_allocator;
typedef struct tph_poisson_sampling_ tph_poisson_sampling;
Expand Down Expand Up @@ -1063,8 +1061,10 @@ int tph_poisson_create(const tph_poisson_args *args,

/* Add first sample randomly within bounds. No need to check (non-existing) neighbors. */
tph_poisson_rand_sample(&ctx, ctx.sample);
ret = tph_poisson_add_sample(&ctx, internal, ctx.sample);
TPH_POISSON_ASSERT(ret == TPH_POISSON_SUCCESS);
tph_poisson_add_sample(&ctx, internal, ctx.sample);
(void)tph_poisson_add_sample(&ctx, internal, ctx.sample);
// ret = tph_poisson_add_sample(&ctx, internal, ctx.sample);
// TPH_POISSON_ASSERT(ret == TPH_POISSON_SUCCESS);

TPH_POISSON_ASSERT(tph_poisson_vec_size(&ctx.active_indices) / (ptrdiff_t)sizeof(ptrdiff_t) == 1);
ptrdiff_t active_index_count = 1;
Expand Down
4 changes: 3 additions & 1 deletion test/src/tph_poisson_alloc_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ static void test_destroyed_alloc(void)
tph_poisson_destroy(&sampling);
}

static void test_arena_alloc(void) {}

int main(int argc, char *argv[])
{
(void)argc;
Expand All @@ -202,7 +204,7 @@ int main(int argc, char *argv[])
printf("test_destroyed_alloc...\n");
test_destroyed_alloc();

printf("test_arena_alloc");
printf("test_arena_alloc...\n");
test_arena_alloc();

return EXIT_SUCCESS;
Expand Down

0 comments on commit 9ad3874

Please sign in to comment.