Skip to contentSkip to conversation

fix warnings

PATCH New Christoph Egger 1 participant 1 message Sep 7, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix warnings

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

Signature · 6 lines
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Andrew Bowd, Thomas M. McCoy, Giuliano Meroni
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632
audio/audio.c +2 -0
index c067afb..822ca04 100644
@@ -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)
 {
audio/audio.h +4 -0
index fda2af3..54024dc 100644
@@ -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__