Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: use re_is_aligned() #1035

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/re_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ typedef SSIZE_T ssize_t;

/** Check alignment of pointer (p) and byte count (c) **/
#define re_is_aligned(p, c) (((uintptr_t)(const void *)(p)) % (c) == 0)
#define is_aligned re_is_aligned

/** Get the minimal value */
#undef MIN
Expand Down
4 changes: 2 additions & 2 deletions test/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int test_mem(void)
obj->pattern = PATTERN;

TEST_EQUALS(1, mem_nrefs(obj));
TEST_ASSERT(is_aligned(obj, mem_alignment));
TEST_ASSERT(re_is_aligned(obj, mem_alignment));

obj = mem_ref(obj);
TEST_EQUALS(2, mem_nrefs(obj));
Expand All @@ -67,7 +67,7 @@ int test_mem(void)
TEST_ERR(err);
}

TEST_ASSERT(is_aligned(obj, mem_alignment));
TEST_ASSERT(re_is_aligned(obj, mem_alignment));

old = mem_ref(obj);
TEST_EQUALS(2, mem_nrefs(obj));
Expand Down
Loading