Permalink
Browse files

Declare size variable

For clang this code fails to compile, and it's not hard to see why. Frankly it is amazing it compiled with GCC and CL! What I think happened is the address of the size function from the class was used. You may want to look into that, perhaps this code is never called?
  • Loading branch information...
1 parent c997133 commit 25a2ef2a35ecc036416351b89623ee499fea865d @mxcl mxcl committed Aug 22, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 include/fplib/FloatingAverage.h
@@ -82,6 +82,7 @@ class FloatingAverage
{
T real_sum = 0;
const T* pCircularBuffer = m_values.get_buffer();
+ const int size = m_values.size();
for ( int i = 0; i < size; ++i )
real_sum += pCircularBuffer[i];
return abs(real_sum - m_sum) / this->size();

0 comments on commit 25a2ef2

Please sign in to comment.