Skip to content

Commit

Permalink
Fix windows warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Mar 28, 2022
1 parent 098bac5 commit 6e4d62d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/ignition/math/MovingWindowFilter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ namespace ignition

/// \brief iterator pointing to current value in buffer
protected: typename std::vector<T>::iterator valIter;
IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING

/// \brief keep track of running sum
protected: T sum;
IGN_UTILS_WARN_RESUME__DLL_INTERFACE_MISSING

/// \brief keep track of number of elements
protected: unsigned int samples = 0;
Expand Down
4 changes: 3 additions & 1 deletion src/MovingWindowFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ bool MovingWindowFilter<T>::WindowFilled() const
template<typename T>
T MovingWindowFilter<T>::Value() const
{
return static_cast<T>(this->sum / static_cast<double>(this->samples));
const double value =
static_cast<double>(this->sum) / static_cast<double>(this->samples);
return static_cast<T>(value);
}

template class MovingWindowFilter<int>;
Expand Down

0 comments on commit 6e4d62d

Please sign in to comment.