From 4e024bb4f5c8aa8b07459f7fbd65c35122127fd1 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 22 Sep 2010 14:19:28 +0200 Subject: Remove compiler warnings when building the emulator. This forces -Wall during the build. Note that this patch doesn't remove all warnings, but most of the remaining ones are from upstream anyway. Change-Id: I8808d8495e99866e156ce5780d2e3c305eab491f --- audio/audio.c | 2 ++ audio/ossaudio.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) (limited to 'audio') diff --git a/audio/audio.c b/audio/audio.c index aa4102b..6f107dc 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -201,6 +201,7 @@ struct mixeng_volume nominal_volume = { #endif }; +#if 0 /* http://www.df.lth.se/~john_e/gems/gem002d.html */ /* http://www.multi-platforms.com/Tips/PopCount.htm */ uint32_t popcount (uint32_t u) @@ -217,6 +218,7 @@ inline uint32_t lsbindex (uint32_t u) { return popcount ((u&-u)-1); } +#endif #ifdef AUDIO_IS_FLAWLESS_AND_NO_CHECKS_ARE_REQURIED #error No its not diff --git a/audio/ossaudio.c b/audio/ossaudio.c index f946f79..ceb81ce 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -36,6 +36,23 @@ #define AUDIO_CAP "oss" #include "audio_int.h" +/* http://www.df.lth.se/~john_e/gems/gem002d.html */ +/* http://www.multi-platforms.com/Tips/PopCount.htm */ +uint32_t popcount (uint32_t u) +{ + u = ((u&0x55555555) + ((u>>1)&0x55555555)); + u = ((u&0x33333333) + ((u>>2)&0x33333333)); + u = ((u&0x0f0f0f0f) + ((u>>4)&0x0f0f0f0f)); + u = ((u&0x00ff00ff) + ((u>>8)&0x00ff00ff)); + u = ( u&0x0000ffff) + (u>>16); + return u; +} + +inline uint32_t lsbindex (uint32_t u) +{ + return popcount ((u&-u)-1); +} + typedef struct OSSVoiceOut { HWVoiceOut hw; void *pcm_buf; -- cgit v1.1