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

[C++] Fix narrowing conversion in client #726

Merged
merged 1 commit into from
Nov 4, 2019
Merged

[C++] Fix narrowing conversion in client #726

merged 1 commit into from
Nov 4, 2019

Conversation

StephanDollberg
Copy link
Contributor

MSCV is correctly complaining about the narrowing conversion from
std::size_t to int in AtomicArrayUpdater::removeElement.

This patch makes us return a std::size_t instead. Using -1 to
signify an invalid length is not needed as the length value is not used
anyway if the pointer is null. Hence we use 0 as the invalid value and
avoid the narrowing conversion.

MSCV is correctly complaining about the narrowing conversion from
`std::size_t` to `int` in `AtomicArrayUpdater::removeElement`.

This patch makes us return a `std::size_t` instead. Using `-1` to
signify an invalid length is not needed as the length value is not used
anyway if the pointer is null. Hence we use `0` as the invalid value and
avoid the narrowing conversion.
@tmontgomery
Copy link
Contributor

I restarted the failed build. Once it comes back OK, will merge.

@tmontgomery tmontgomery merged commit 6a08a8a into aeron-io:master Nov 4, 2019
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