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

Using ~0 instead of -1 as magic number for end(). #972

Merged
merged 2 commits into from
Mar 11, 2015

Conversation

rolanddenis
Copy link
Member

Using -1 as magic number for unsigned int is implementation dependant.
~0 is a better choice and is type-size independant.

Using -1 as magic number for unsigned int is implementation dependant.
~0 is a better choice and is type-size independant.
@dcoeurjo
Copy link
Member

Thanks. It was not in your PR but could you please uncomment the CONCEPT_ASSERT in Labels.h (and check what was wrong) ?

@dcoeurjo
Copy link
Member

(please have a look to my comment on the previous PR)

... as magic number for end() iterator in Labels.
Also adding CUnsignedNumber and CIntegralNumber concept check for TWord
template parameter.
@rolanddenis
Copy link
Member Author

Concerning the CONCEPT_ASSERT, the concept name was wrong. I corrected it (to CUnsignedNumber) and added CIntegralNumber concept check. I also added a test block in testLabels.cpp related to the iterator bug.
Could you please wait to merge this PR: I have another bug with LabelledMap that I wish to include in this PR.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 90.32% when pulling 0102a99 on rolanddenis:bug_label_bis into bbbff58 on DGtal-team:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.23%) to 90.11% when pulling 4988580 on rolanddenis:bug_label_bis into bbbff58 on DGtal-team:master.

@dcoeurjo
Copy link
Member

Great. thanks.
Merging

dcoeurjo added a commit that referenced this pull request Mar 11, 2015
Using ~0 instead of -1 as magic number for end().
@dcoeurjo dcoeurjo merged commit 176e9d3 into DGtal-team:master Mar 11, 2015
@rolanddenis rolanddenis deleted the bug_label_bis branch March 11, 2015 09:42
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.

3 participants