use c++ style casts

This commit is contained in:
Dane Springmeyer 2016-03-10 11:44:01 -08:00
parent f90f6d83c6
commit aa8c543744
2 changed files with 2 additions and 2 deletions

View file

@ -165,7 +165,7 @@ public:
void set_default_mode(colorizer_mode mode)
{
default_mode_ = (mode == COLORIZER_INHERIT) ? COLORIZER_LINEAR:(colorizer_mode_enum)mode;
default_mode_ = (mode == COLORIZER_INHERIT) ? COLORIZER_LINEAR : static_cast<colorizer_mode_enum>(mode);
}
void set_default_mode_enum(colorizer_mode_enum mode) { set_default_mode(mode); }

View file

@ -41,7 +41,7 @@ struct weighted_vertex : private util::noncopyable
vertex2d const& A = prev->coord;
vertex2d const& B = next->coord;
vertex2d const& C = coord;
return std::abs((double)((A.x - C.x) * (B.y - A.y) - (A.x - B.x) * (C.y - A.y))) / 2.0;
return std::abs(static_cast<double>((A.x - C.x) * (B.y - A.y) - (A.x - B.x) * (C.y - A.y))) / 2.0;
}
struct ascending_sort