explicit casts help mitigate MSVC warnery

This commit is contained in:
Dennis Luxen 2014-10-28 10:36:09 -04:00
parent 0f5dffb1c3
commit b257c881b5
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ struct String
struct Number
{
Number() {}
Number(double value) : value(value) {}
Number(double value) : value(static_cast<double>(value)) {}
double value;
};

View File

@ -1121,11 +1121,11 @@ class StaticRTree
if (SPECIAL_NODEID != result_phantom_node.forward_node_id)
{
result_phantom_node.forward_weight *= ratio;
result_phantom_node.forward_weight *= static_cast<decltype(result_phantom_node.forward_weight)>(ratio);
}
if (SPECIAL_NODEID != result_phantom_node.reverse_node_id)
{
result_phantom_node.reverse_weight *= (1.f - ratio);
result_phantom_node.reverse_weight *= static_cast<decltype(result_phantom_node.reverse_weight)>(1.f - ratio);
}
}