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

extend curLabel range to [0..std::limits<unsigned long long>::max()] … #210

Merged
merged 2 commits into from
Mar 24, 2018

Conversation

avilleret
Copy link
Contributor

…and warp when reaching limits

fix ##193

I made a code snippet to try to trig the issue, but std::numeric_limits<usigned long long>::max() is to hard to reach...

here is the code : https://gist.github.com/avilleret/ad41050756401d1ef0bef78ec1995ced

@kylemcdonald
Copy link
Owner

kylemcdonald commented Mar 7, 2018

i see what you're suggesting here, but without taking a closer look i'm not sure your solution is correctly implemented.

for example, you shouldn't need to use a modulo operator to wrap something at its boundaries:

unsigned byte a = 255;
unsigned byte b = a + 1; // b == 0

i think if you remove that line then i can merge this PR.

no need to use modulo at numeric limit
@avilleret
Copy link
Contributor Author

you're absolutely right, it was my mistake

@kylemcdonald kylemcdonald merged commit cb76ee5 into kylemcdonald:master Mar 24, 2018
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