[97185] trunk/dports/audio/liblastfm

michaelld at macports.org michaelld at macports.org
Wed Aug 29 05:53:19 PDT 2012


Revision: 97185
          https://trac.macports.org/changeset/97185
Author:   michaelld at macports.org
Date:     2012-08-29 05:53:18 -0700 (Wed, 29 Aug 2012)
Log Message:
-----------
liblastfm : fix use of "size" as both variable and method in code (caught by clang, but not gcc); fixes ticket #34155.

Modified Paths:
--------------
    trunk/dports/audio/liblastfm/Portfile

Added Paths:
-----------
    trunk/dports/audio/liblastfm/files/
    trunk/dports/audio/liblastfm/files/patch-src_fingerprint_fplib_FloatingAverage.h.diff

Modified: trunk/dports/audio/liblastfm/Portfile
===================================================================
--- trunk/dports/audio/liblastfm/Portfile	2012-08-29 12:38:40 UTC (rev 97184)
+++ trunk/dports/audio/liblastfm/Portfile	2012-08-29 12:53:18 UTC (rev 97185)
@@ -6,7 +6,7 @@
 
 name                liblastfm
 version             0.3.3
-revision            1
+revision            2
 categories          audio
 license             GPL-3
 maintainers         michaelld openmaintainer
@@ -35,6 +35,8 @@
 
 use_parallel_build  no
 
+patchfiles          patch-src_fingerprint_fplib_FloatingAverage.h.diff
+
 post-patch {
     # fix library install directory
     reinplace "/target\\.path/s@\\/lib@\\\$\\\$QMAKE_LIBDIR_QT@" \

Added: trunk/dports/audio/liblastfm/files/patch-src_fingerprint_fplib_FloatingAverage.h.diff
===================================================================
--- trunk/dports/audio/liblastfm/files/patch-src_fingerprint_fplib_FloatingAverage.h.diff	                        (rev 0)
+++ trunk/dports/audio/liblastfm/files/patch-src_fingerprint_fplib_FloatingAverage.h.diff	2012-08-29 12:53:18 UTC (rev 97185)
@@ -0,0 +1,39 @@
+--- src/fingerprint/fplib/FloatingAverage.h.orig	2012-08-29 08:18:44.000000000 -0400
++++ src/fingerprint/fplib/FloatingAverage.h	2012-08-29 08:26:25.000000000 -0400
+@@ -27,9 +27,9 @@
+ class FloatingAverage
+ {
+ public:
+-   FloatingAverage(size_t size)
++   FloatingAverage(size_t m_size)
+    {
+-      m_values.resize(size);
++      m_values.resize(m_size);
+       m_valIt = m_values.head();
+       m_sum = 0;
+       m_bufferFilled = false;
+@@ -39,9 +39,9 @@
+    {
+       m_sum = 0;
+       const T* pCircularBuffer = m_values.get_buffer();
+-      const int size = m_values.size();
++      const int m_size = m_values.size();
+ 
+-      for ( int i = 0; i < size; ++i )
++      for ( int i = 0; i < m_size; ++i )
+          m_sum += pCircularBuffer[i];
+    }
+ 
+@@ -76,9 +76,10 @@
+    {
+       T real_sum = 0;
+       const T* pCircularBuffer = m_values.get_buffer();
+-      for ( int i = 0; i < size; ++i )
++      const int m_size = m_values.size();
++      for ( int i = 0; i < m_size; ++i )
+          real_sum += pCircularBuffer[i];
+-      return abs(real_sum - m_sum) / this->size();
++      return abs(real_sum - m_sum) / m_size;
+    }
+ 
+    size_t size() const
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120829/e9379b45/attachment.html>


More information about the macports-changes mailing list