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

Visual Studio Warning - Possible loss of data - Assigning zeros #84

Closed
J-Light opened this issue Jun 17, 2018 · 1 comment
Closed

Visual Studio Warning - Possible loss of data - Assigning zeros #84

J-Light opened this issue Jun 17, 2018 · 1 comment

Comments

@J-Light
Copy link
Contributor

J-Light commented Jun 17, 2018

VS2015 warns of possible loss of data when assigning a zero value as the value is always int and converted to float or double.

An easy fix would be to make the following changes to findNeighbors function

auto zero = static_cast<decltype(result.worstDist())>(0);
assign(dists, (DIM > 0 ? DIM : BaseClassRef::dim), zero); // Fill it with zeros.
@jlblancoc
Copy link
Owner

Closed after #85

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

No branches or pull requests

2 participants