Small fixes for some float literals.
authorJoerg Mueller <nexyon@gmail.com>
Fri, 1 Jan 2010 11:55:56 +0000 (11:55 +0000)
committerJoerg Mueller <nexyon@gmail.com>
Fri, 1 Jan 2010 11:55:56 +0000 (11:55 +0000)
14 files changed:
intern/audaspace/FX/AUD_EnvelopeReader.cpp
intern/audaspace/FX/AUD_HighpassFactory.h
intern/audaspace/FX/AUD_HighpassReader.cpp
intern/audaspace/FX/AUD_LowpassFactory.h
intern/audaspace/FX/AUD_LowpassReader.cpp
intern/audaspace/FX/AUD_PitchFactory.h
intern/audaspace/FX/AUD_VolumeFactory.h
intern/audaspace/OpenAL/AUD_OpenALDevice.cpp
intern/audaspace/fftw/AUD_BandPassReader.cpp
intern/audaspace/intern/AUD_C-API.cpp
intern/audaspace/intern/AUD_ChannelMapperReader.cpp
intern/audaspace/intern/AUD_ConverterFunctions.cpp
intern/audaspace/intern/AUD_SinusReader.cpp
intern/audaspace/intern/AUD_SoftwareDevice.cpp

index f41aee1d4bc6a2af04129b6d6f859eddf4d02215..71ccbfd6503d4f4dbe4882755a8e3fe7fa07b71a 100644 (file)
@@ -44,8 +44,8 @@ AUD_EnvelopeReader::AUD_EnvelopeReader(AUD_IReader* reader, float attack,
        AUD_NEW("buffer")
        memset(m_envelopes->getBuffer(), 0, samplesize);
 
-       m_bAttack = pow(arthreshold, 1.0/(specs.rate * attack));
-       m_bRelease = pow(arthreshold, 1.0/(specs.rate * release));
+       m_bAttack = pow(arthreshold, 1.0f/(specs.rate * attack));
+       m_bRelease = pow(arthreshold, 1.0f/(specs.rate * release));
 }
 
 AUD_EnvelopeReader::~AUD_EnvelopeReader()
index cce21eed27d99e198e2f94d19aa52fe18d821eab..5e31053ed6c809677bee12cd6133faaf485eec15 100644 (file)
@@ -51,14 +51,14 @@ public:
         * \param frequency The cutoff frequency.
         * \param Q The Q factor.
         */
-       AUD_HighpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0);
+       AUD_HighpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
 
        /**
         * Creates a new highpass factory.
         * \param frequency The cutoff frequency.
         * \param Q The Q factor.
         */
-       AUD_HighpassFactory(float frequency, float Q = 1.0);
+       AUD_HighpassFactory(float frequency, float Q = 1.0f);
 
        virtual AUD_IReader* createReader();
 };
index c83a9588edf71990946f0ca700698907542a103a..36b1bb8082e8b2e3b684cb21d25b4e7fd0eaaf6c 100644 (file)
@@ -55,7 +55,7 @@ AUD_HighpassReader::AUD_HighpassReader(AUD_IReader* reader, float frequency,
        m_position = 0;
 
        // calculate coefficients
-       float w0 = 2.0 * M_PI * frequency / specs.rate;
+       float w0 = 2 * M_PI * frequency / specs.rate;
        float alpha = sin(w0) / (2 * Q);
        float norm = 1 + alpha;
        m_coeff[0][0] = 0;
index 0455e2491e681419428c183a0dffeed1ee864c3a..8a419823de02edc1b2274996c26ead7a6b87faa8 100644 (file)
@@ -51,14 +51,14 @@ public:
         * \param frequency The cutoff frequency.
         * \param Q The Q factor.
         */
-       AUD_LowpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0);
+       AUD_LowpassFactory(AUD_IFactory* factory, float frequency, float Q = 1.0f);
 
        /**
         * Creates a new lowpass factory.
         * \param frequency The cutoff frequency.
         * \param Q The Q factor.
         */
-       AUD_LowpassFactory(float frequency, float Q = 1.0);
+       AUD_LowpassFactory(float frequency, float Q = 1.0f);
 
        virtual AUD_IReader* createReader();
 };
index 4e8492e098b5f8f34c8a4b44600a6d3d2244de1a..6dc0bf66a961d35bde0bd00ff27770f85a40ab8c 100644 (file)
@@ -55,7 +55,7 @@ AUD_LowpassReader::AUD_LowpassReader(AUD_IReader* reader, float frequency,
        m_position = 0;
 
        // calculate coefficients
-       float w0 = 2.0 * M_PI * frequency / specs.rate;
+       float w0 = 2 * M_PI * frequency / specs.rate;
        float alpha = sin(w0) / (2 * Q);
        float norm = 1 + alpha;
        m_coeff[0][0] = 0;
index 3209aa4698331c3dd20e5b923193cecf646f2978..96c4d0d7e9209832675b5596889b56d585c6969c 100644 (file)
@@ -45,7 +45,7 @@ public:
         * \param factory The input factory.
         * \param pitch The desired pitch.
         */
-       AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0);
+       AUD_PitchFactory(AUD_IFactory* factory = 0, float pitch = 1.0f);
 
        /**
         * Creates a new pitch factory.
index d2812536d839ead28cfc790dde81583741d424e7..09f91241b4705c483a508236e89b191ff89a0187 100644 (file)
@@ -47,7 +47,7 @@ public:
         * \param factory The input factory.
         * \param volume The desired volume.
         */
-       AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0);
+       AUD_VolumeFactory(AUD_IFactory* factory = 0, float volume = 1.0f);
 
        /**
         * Creates a new volume factory.
index dfd5d29e4aa319faa4b53ccbf642c4391aa9e503..0d90b0149431114571a468bc3ba7c82858036814 100644 (file)
@@ -868,7 +868,7 @@ bool AUD_OpenALDevice::seek(AUD_Handle* handle, float position)
 
 float AUD_OpenALDevice::getPosition(AUD_Handle* handle)
 {
-       float position = 0.0;
+       float position = 0.0f;
 
        lock();
 
@@ -1283,7 +1283,7 @@ bool AUD_OpenALDevice::setSourceSetting(AUD_Handle* handle,
                        result = true;
                        break;
                case AUD_3DSS_IS_RELATIVE:
-                       alSourcei(source, AL_SOURCE_RELATIVE, value > 0.0);
+                       alSourcei(source, AL_SOURCE_RELATIVE, value > 0.0f);
                        result = true;
                        break;
                case AUD_3DSS_MAX_DISTANCE:
@@ -1341,7 +1341,7 @@ float AUD_OpenALDevice::getSourceSetting(AUD_Handle* handle,
                        {
                                ALint i;
                                alGetSourcei(source, AL_SOURCE_RELATIVE, &i);
-                               result = i ? 1.0 : 0.0;
+                               result = i ? 1.0f : 0.0f;
                                break;
                        }
                case AUD_3DSS_MAX_DISTANCE:
index e77b69863f13747d1764a1b71b3014c0d9c7c4b0..67729914c6d771c632e00e223bf2d7364d0c8f74 100644 (file)
@@ -108,7 +108,7 @@ void AUD_BandPassReader::read(int & length, sample_t* & buffer)
 
                        for(int i = 0; i < m_length / 2 + 1; i++)
                        {
-                               frequency = i * specs.rate / (m_length / 2.0 + 1.0);
+                               frequency = i * specs.rate / (m_length / 2.0f + 1.0f);
                                if((frequency < m_low) || (frequency > m_high))
                                        complex[i][0] = complex[i][1] = 0.0;
                        }
index 964ac2e650c84bb59f7278066ef2b47d7ab04dc0..1e2e1e8a872c8b431ea56f86e83c1ced3f4ba72d 100644 (file)
@@ -182,7 +182,7 @@ AUD_SoundInfo AUD_getInfo(AUD_Sound* sound)
        {
                info.specs.channels = AUD_CHANNELS_INVALID;
                info.specs.rate = AUD_RATE_INVALID;
-               info.length = 0.0;
+               info.length = 0.0f;
        }
 
        return info;
@@ -427,7 +427,7 @@ float AUD_get3DSetting(AUD_3DSetting setting)
        catch(AUD_Exception)
        {
        }
-       return 0.0;
+       return 0.0f;
 }
 
 int AUD_update3DSource(AUD_Handle* handle, AUD_3DData* data)
@@ -483,7 +483,7 @@ float AUD_get3DSourceSetting(AUD_Handle* handle, AUD_3DSourceSetting setting)
                {
                }
        }
-       return 0.0;
+       return 0.0f;
 }
 
 int AUD_setSoundVolume(AUD_Handle* handle, float volume)
index 4de5875a33fa9d3479d66cc02d55b578cb4ec16d..d78278219e80d13b131251206358db401bae2b1f 100644 (file)
@@ -49,7 +49,8 @@ AUD_ChannelMapperReader::AUD_ChannelMapperReader(AUD_IReader* reader,
                for(i=0; i < m_rch; i++)
                        sum += mapping[channels][i];
                for(i=0; i < m_rch; i++)
-                       m_mapping[channels][i] = sum > 0.0 ? mapping[channels][i]/sum : 0.0;
+                       m_mapping[channels][i] = sum > 0.0f ?
+                                                                        mapping[channels][i]/sum : 0.0f;
        }
 
        m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
index 70018917d43a376f1dba0f43d24d50aa12115fc6..0d48df04a642b7f86f69436354184617ba5a7f20 100644 (file)
 #define AUD_U8_0               0x80
 #define AUD_S16_MAX            0x7FFF
 #define AUD_S16_MIN            0x8000
-#define AUD_S16_FLT            32768.0
+#define AUD_S16_FLT            32768.0f
 #define AUD_S32_MAX            0x7FFFFFFF
 #define AUD_S32_MIN            0x80000000
-#define AUD_S32_FLT            2147483648.0
-#define AUD_FLT_MAX            1.0
-#define AUD_FLT_MIN            -1.0
+#define AUD_S32_FLT            2147483648.0f
+#define AUD_FLT_MAX            1.0f
+#define AUD_FLT_MIN            -1.0f
 
 void AUD_convert_u8_s16(data_t* target, data_t* source, int length)
 {
index 83a1a3ed3c38da3e2bb9daea913c1f6cd453b9bb..c52513d5d2eae6794bb3015a538c1a50a58abec3 100644 (file)
@@ -93,7 +93,7 @@ void AUD_SinusReader::read(int & length, sample_t* & buffer)
        buffer = m_buffer->getBuffer();
        for(int i = 0; i < length; i++)
        {
-               buffer[i] = sin((m_position + i) * 2.0 * M_PI * m_frequency /
+               buffer[i] = sin((m_position + i) * 2.0f * M_PI * m_frequency /
                                                (float)m_sampleRate);
        }
 
index 142251c7e2d066eae77f52d066a5d8c62ada7e1d..a615bcd0245d5deceb5ff62ecc1add8167565e5e 100644 (file)
@@ -51,7 +51,7 @@ void AUD_SoftwareDevice::create()
        m_playingSounds = new std::list<AUD_SoftwareHandle*>(); AUD_NEW("list")
        m_pausedSounds = new std::list<AUD_SoftwareHandle*>(); AUD_NEW("list")
        m_playback = false;
-       m_volume = 1.0;
+       m_volume = 1.0f;
        m_mixer = new AUD_Mixer(); AUD_NEW("mixer")
        m_mixer->setSpecs(m_specs);
 
@@ -184,7 +184,7 @@ AUD_Handle* AUD_SoftwareDevice::play(AUD_IFactory* factory, bool keep)
        AUD_SoftwareHandle* sound = new AUD_SoftwareHandle; AUD_NEW("handle")
        sound->keep = keep;
        sound->reader = reader;
-       sound->volume = 1.0;
+       sound->volume = 1.0f;
 
        lock();
        m_playingSounds->push_back(sound);
@@ -421,10 +421,10 @@ bool AUD_SoftwareDevice::setCapability(int capability, void *value)
        case AUD_CAPS_VOLUME:
                lock();
                m_volume = *((float*)value);
-               if(m_volume > 1.0)
-                       m_volume = 1.0;
-               else if(m_volume < 0.0)
-                       m_volume = 0.0;
+               if(m_volume > 1.0f)
+                       m_volume = 1.0f;
+               else if(m_volume < 0.0f)
+                       m_volume = 0.0f;
                unlock();
                return true;
        case AUD_CAPS_SOURCE_VOLUME:
@@ -435,10 +435,10 @@ bool AUD_SoftwareDevice::setCapability(int capability, void *value)
                        {
                                AUD_SoftwareHandle* handle = (AUD_SoftwareHandle*)caps->handle;
                                handle->volume = caps->value;
-                               if(handle->volume > 1.0)
-                                       handle->volume = 1.0;
-                               else if(handle->volume < 0.0)
-                                       handle->volume = 0.0;
+                               if(handle->volume > 1.0f)
+                                       handle->volume = 1.0f;
+                               else if(handle->volume < 0.0f)
+                                       handle->volume = 0.0f;
                                result = true;
                        }
                        unlock();