Skip to content

Commit

Permalink
fix warnings from MSVC, re #49
Browse files Browse the repository at this point in the history
  • Loading branch information
gentryx committed Feb 20, 2017
1 parent 47f84d7 commit 15edfb5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/libgeodecomp/geometry/coord.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class Coord<1>

inline explicit Coord(const FloatCoord<1>& other)
{
c[0] = other[0];
c[0] = int(other[0]);
}

#ifdef __CUDACC__
Expand Down Expand Up @@ -149,9 +149,9 @@ class Coord<1>
* converts the coord to a linear index. This is good for addressing a linear array via Coords.
*/
__host__ __device__
inline std::size_t toIndex(const Coord<1>& dim) const
inline std::size_t toIndex(const Coord<1>& /* dim */) const
{
return x();
return std::size_t(x());
}

__host__ __device__
Expand Down Expand Up @@ -235,13 +235,13 @@ class Coord<1>
__host__ __device__
inline Coord operator*(float scale) const
{
return Coord(scale * x());
return Coord(int(scale * x()));
}

__host__ __device__
inline Coord operator*(double scale) const
{
return Coord(scale * x());
return Coord(int(scale * x()));
}

__host__ __device__
Expand Down Expand Up @@ -358,8 +358,8 @@ class Coord<2>

inline explicit Coord(const FloatCoord<2>& other)
{
c[0] = other[0];
c[1] = other[1];
c[0] = int(other[0]);
c[1] = int(other[1]);
}

#ifdef __CUDACC__
Expand Down Expand Up @@ -498,13 +498,13 @@ class Coord<2>
__host__ __device__
inline Coord operator*(float scale) const
{
return Coord(scale * x(), scale * y());
return Coord(int(scale * x()), int(scale * y()));
}

__host__ __device__
inline Coord operator*(double scale) const
{
return Coord(scale * x(), scale * y());
return Coord(int(scale * x()), int(scale * y()));
}

__host__ __device__
Expand Down Expand Up @@ -617,9 +617,9 @@ class Coord<3>

inline explicit Coord(const FloatCoord<3>& other)
{
c[0] = other[0];
c[1] = other[1];
c[2] = other[2];
c[0] = int(other[0]);
c[1] = int(other[1]);
c[2] = int(other[2]);
}

#ifdef __CUDACC__
Expand Down Expand Up @@ -784,14 +784,14 @@ class Coord<3>
__host__ __device__
inline Coord operator*(float scale) const
{
return Coord(scale * x(), scale * y(), scale * z());
return Coord(int(scale * x()), int(scale * y()), int(scale * z()));
}


__host__ __device__
inline Coord operator*(double scale) const
{
return Coord(scale * x(), scale * y(), scale * z());
return Coord(int(scale * x()), int(scale * y()), int(scale * z()));
}

__host__ __device__
Expand Down

0 comments on commit 15edfb5

Please sign in to comment.