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

Hint value collisions #791

Open
GraemeWilde opened this issue Jun 20, 2016 · 3 comments
Open

Hint value collisions #791

GraemeWilde opened this issue Jun 20, 2016 · 3 comments
Labels
bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs
Milestone

Comments

@GraemeWilde
Copy link

These defines in glfw3.h have the same values, I believe this is not how it should be, though it won't cause any issues either (afaik).

#define GLFW_NATIVE_CONTEXT_API     0x00036001
#define GLFW_EGL_CONTEXT_API        0x00036002

#define GLFW_ARROW_CURSOR           0x00036001
#define GLFW_IBEAM_CURSOR           0x00036002
@elmindreda elmindreda added the bug Bug reports and bugfix pull requests label Jun 21, 2016
@elmindreda elmindreda added this to the 4.0 milestone Jun 21, 2016
@elmindreda
Copy link
Member

Oops. Thank you for spotting this! It likely won't cause any issues, as you say, but it's still wrong.

@elmindreda elmindreda self-assigned this Jun 21, 2016
@elmindreda elmindreda changed the title glfw3.h two pairs of defines have the same value. (No big deal because they aren't related,afaik) Hint value collisions Jun 21, 2016
@dmitshur
Copy link
Collaborator

dmitshur commented Jun 22, 2016

it's still wrong

Can I ask why you consider it wrong? If those defines are parts of separate namespaces, then overlap in their values is not wrong. Is it?

I agree that using different values might be a good idea because it will help catch potential user errors, where someone could mistakenly use a define for one namespace for a function that expects another, and because there is no type system to catch it, the only other way to catch such a mistake is to avoid reusing same values. Maybe this is what you meant?

@elmindreda
Copy link
Member

elmindreda commented Jun 22, 2016

@shurcooL Yes, exactly. It breaks the pattern and loses the ability to disambiguate by value.

Will likely be moving to enums for 4.0.

@elmindreda elmindreda added the verified Reproduced or otherwise verified bugs label Jul 31, 2016
@elmindreda elmindreda removed their assignment May 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports and bugfix pull requests verified Reproduced or otherwise verified bugs
Projects
None yet
Development

No branches or pull requests

3 participants