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

fix: correct struct init + one array to array comp. #627

Merged
merged 3 commits into from
May 13, 2024
Merged

Conversation

lemire
Copy link
Member

@lemire lemire commented May 13, 2024

Mostly nitpicking but one change is significant...

This expression looks wrong...

context->high_bytes != high48

I am not sure what an array-to-array comparison does in C.

@lemire lemire requested review from SLieve and Dr-Emann May 13, 2024 17:07
benchmarks/add_benchmark.c Show resolved Hide resolved
src/roaring64.c Show resolved Hide resolved
Copy link
Contributor

@SLieve SLieve left a comment

Choose a reason for hiding this comment

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

Thanks for finding that bug @lemire !

@madscientist
Copy link
Contributor

If you used the preprocessor to handle zero-initialization I think something like this would be nicer:

#if ...whatever for C++ and C23...
# define EMPTY_INIT
#else
# define EMPTY_INIT 0
#endif 

roaring_bulk_context_t context = {EMPTY_INIT};

rather than putting the braces in the preproc. Just a suggestion.

@lemire
Copy link
Member Author

lemire commented May 13, 2024

@madscientist I am going to merge what I have now but I am inviting contributions to improve it.

@lemire lemire merged commit 44228a0 into master May 13, 2024
38 checks passed
@Dr-Emann Dr-Emann deleted the minor_fixes branch May 13, 2024 21:44
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.

4 participants