diff mbox

fix warnings

Message ID 200909071232.39682.Christoph.Egger@amd.com
State Superseded
Headers show

Commit Message

Christoph Egger Sept. 7, 2009, 10:32 a.m. UTC
Hi!

Attached patch fixes the warnings on NetBSD:

./audio/audio.h:150: warning: redundant redeclaration of 'popcount'
/usr/include/strings.h:57: warning: previous declaration of 'popcount' was 
here

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
diff mbox

Patch

diff --git a/audio/audio.c b/audio/audio.c
index c067afb..822ca04 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -107,6 +107,7 @@  struct mixeng_volume nominal_volume = {
 #endif
 };
 
+#if !defined(__NetBSD__)
 /* http://www.df.lth.se/~john_e/gems/gem002d.html */
 /* http://www.multi-platforms.com/Tips/PopCount.htm */
 uint32_t popcount (uint32_t u)
@@ -118,6 +119,7 @@  uint32_t popcount (uint32_t u)
     u = ( u&0x0000ffff) + (u>>16);
     return u;
 }
+#endif
 
 inline uint32_t lsbindex (uint32_t u)
 {
diff --git a/audio/audio.h b/audio/audio.h
index fda2af3..54024dc 100644
--- a/audio/audio.h
+++ b/audio/audio.h
@@ -147,7 +147,11 @@  static inline void *advance (void *p, int incr)
     return (d + incr);
 }
 
+#if defined(__NetBSD__)
+#define popcount(u) popcount32(u)
+#else
 uint32_t popcount (uint32_t u);
+#endif
 uint32_t lsbindex (uint32_t u);
 
 #ifdef __GNUC__