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

int i should match count, which is a CFIndex #5147

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AZero13
Copy link
Contributor

@AZero13 AZero13 commented Dec 11, 2024

No description provided.

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

By that token, the type should be size_t as sizeof(...) / sizeof(...) is a size_t as sizeof returns size_t. I'm not sure that there is a good justification here per se. Why not convert the int to CFIndex at the use site?

@AZero13
Copy link
Contributor Author

AZero13 commented Dec 11, 2024

By that token, the type should be size_t as sizeof(...) / sizeof(...) is a size_t as sizeof returns size_t. I'm not sure that there is a good justification here per se. Why not convert the int to CFIndex at the use site?

Because it fits in a CFIndex and long means more possible optimizations due to unsigned being defined overflow behavior even if it doesn't overflow (thanks LLVM)

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