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

Add dedicated macros for pointer comparisons #46

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

stefano-p
Copy link
Contributor

Add pointer comparison macros

Add new macros CHECK_PTR_EQ/NE and REQUIRE_PTR_EQ/NE to simplify pointer comparisons. These macros automatically handle void* casting and use the appropriate %p format specifier for pointer output.

Before:
CHECK_EQ((void*)ptr1, (void*)ptr2);

After:
CHECK_PTR_EQ(ptr1, ptr2);

This change improves code readability while maintaining consistency with the existing CHECK_NULL/NOT_NULL macros. The new macros follow TAU's established pattern and style conventions.

Add pointer comparison macros

Add new macros CHECK_PTR_EQ/NE and REQUIRE_PTR_EQ/NE to simplify pointer
comparisons. These macros automatically handle void* casting and use the
appropriate %p format specifier for pointer output.

Before:
CHECK_EQ((void*)ptr1, (void*)ptr2);

After:
CHECK_PTR_EQ(ptr1, ptr2);

This change improves code readability while maintaining consistency with
the existing CHECK_NULL/NOT_NULL macros. The new macros follow TAU's
established pattern and style conventions.
Copy link
Owner

@jasmcaus jasmcaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jasmcaus jasmcaus merged commit a9a377f into jasmcaus:dev Nov 12, 2024
22 of 87 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants