Skip to content
Snippets Groups Projects
Commit cb083acd authored by Yun Liu's avatar Yun Liu
Browse files

Merge branch 'warnings' of...

Merge branch 'warnings' of ssh://yun@192.168.1.16//home-local/manu/dev/sfl/sflphone into remove_warnings

Conflicts:

	src/audio/codecs/gsmcodec.cpp
	src/audio/codecs/speexcodec.cpp
parents 2df0f38f 492a949e
No related branches found
No related tags found
No related merge requests found
......@@ -89,7 +89,7 @@ dnl Define C++ as default language
AC_LANG(C++)
dnl Setup C++ compiler flags
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $USER_INCLUDES -O0 -g -Wall -Weffc++ -Wfatal-errors"
CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS $USER_INCLUDES -O0 -g -Wall -Weffc++ -Wfatal-errors -Werror"
dnl Check for header files
AC_FUNC_ALLOCA
......
......@@ -27,10 +27,12 @@
#include <samplerate.h>
AudioFile::AudioFile()
: AudioLoop()
: AudioLoop(),
_filename(),
_codec(NULL),
_start(false)
{
// could vary later ...
_start = false;
}
AudioFile::~AudioFile()
......@@ -45,7 +47,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in
// if the filename was already load, with the same samplerate
// we do nothing
if (_filename == filename && _sampleRate == sampleRate) {
if ( strcmp(_filename.c_str(), filename.c_str()) == 0 && _sampleRate == (int)sampleRate) {
return true;
} else {
// reset to 0
......@@ -87,7 +89,7 @@ AudioFile::loadFile(const std::string& filename, AudioCodec* codec , unsigned in
// expandedsize is the number of bytes, not the number of int
// expandedsize should be exactly two time more, else failed
int16 monoBuffer[length];
unsigned int expandedsize = _codec->codecDecode (monoBuffer, (unsigned char *) fileBuffer, length);
int expandedsize = (int)_codec->codecDecode (monoBuffer, (unsigned char *) fileBuffer, length);
if (expandedsize != length*2) {
_debug("Audio file error on loading audio file!");
return false;
......
......@@ -33,6 +33,12 @@ public:
_hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false;
}
AudioCodec( const AudioCodec& codec )
: _codecName(codec._codecName), _clockRate(codec._clockRate), _channel(codec._channel), _bitrate(codec._bitrate),_bandwidth(codec._bandwidth),_payload(codec._payload), _hasDynamicPayload(false),_state(true) {
_hasDynamicPayload = (_payload >= 96 && _payload <= 127) ? true : false;
}
virtual ~AudioCodec() {
}
/**
......
......@@ -30,7 +30,7 @@ extern "C"{
class Gsm : public AudioCodec {
public:
// _payload should be 3
Gsm (int payload=3): AudioCodec(payload, "GSM"), _decode_gsmhandle(), _encode_gsmhandle() {
Gsm (int payload=3): AudioCodec(payload, "GSM"), _decode_gsmhandle(NULL), _encode_gsmhandle(NULL){
_clockRate = 8000;
_channel = 1;
_bitrate = 13.3;
......@@ -42,18 +42,10 @@ public:
printf("AudioCodec: ERROR: encode_gsm_create\n");
}
// Copy Constructor
Gsm(const Gsm& rh): AudioCodec(3, "GSM"),_decode_gsmhandle(), _encode_gsmhandle() /*: _clockRate(rh._clockRate), _channel(rh._channel), _bitrate(rh._bitrate), _bandwidth(rh._bandwidth) */{
printf("GSM copy constructor hasn't been implemented yet. Quit!");
exit(0);
}
Gsm( const Gsm& );
Gsm& operator=( const Gsm& );
// Assignment Operator
Gsm& operator=( const Gsm& rh){
printf("GSM assignment operator hasn't been implemented yet. Quit!");
exit(0);
}
virtual ~Gsm (void){
gsm_destroy(_decode_gsmhandle);
gsm_destroy(_encode_gsmhandle);
......
......@@ -25,7 +25,13 @@
class Speex : public AudioCodec{
public:
Speex(int payload=0)
: AudioCodec(payload, "speex"), _speexModePtr(NULL), _speex_dec_bits(), _speex_enc_bits(), _speex_dec_state(NULL), _speex_enc_state(NULL), _speex_frame_size(0)
: AudioCodec(payload, "speex"),
_speexModePtr(NULL),
_speex_dec_bits(),
_speex_enc_bits(),
_speex_dec_state(),
_speex_enc_state(),
_speex_frame_size()
{
_clockRate = 8000;
_channel = 1;
......@@ -34,19 +40,9 @@ public:
initSpeex();
}
// Copy Constructor
Speex(const Speex& rh): AudioCodec(0, "speex"), _speexModePtr(rh._speexModePtr), _speex_dec_bits(rh._speex_dec_bits), _speex_enc_bits(rh._speex_enc_bits),
_speex_dec_state(rh._speex_dec_state), _speex_enc_state(rh._speex_enc_state), _speex_frame_size(rh._speex_frame_size) {
printf("Speex copy constructor hasn't been implemented yet. Quit!");
exit(0);
}
// Assignment Operator
Speex& operator=( const Speex& rh){
printf("Speex assignment operator hasn't been implemented yet. Quit!");
exit(0);
}
Speex( const Speex& );
Speex& operator=(const Speex&);
void initSpeex() {
/*
if (_clockRate < 16000 ) {
......
......@@ -21,11 +21,9 @@
*/
#include "tonelist.h"
ToneList::ToneList() {
_nbTone = TONE_NBTONE; // could be dynamic
_nbCountry = TONE_NBCOUNTRY; // could be dynamic
_defaultCountryId = ZID_NORTH_AMERICA;
ToneList::ToneList() : _nbTone( TONE_NBTONE ) ,
_nbCountry( TONE_NBCOUNTRY ),
_defaultCountryId( ZID_NORTH_AMERICA ){
initToneDefinition();
}
......@@ -104,14 +102,16 @@ ToneList::getCountryId(const std::string& countryName)
}
}
TelephoneTone::TelephoneTone(const std::string& countryName, unsigned int sampleRate) {
TelephoneTone::TelephoneTone(const std::string& countryName, unsigned int sampleRate) :
_currentTone( Tone::TONE_NULL ),
_toneList()
{
ToneList::COUNTRYID countryId = _toneList.getCountryId(countryName);
_tone[Tone::TONE_DIALTONE] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_DIALTONE), sampleRate);
_tone[Tone::TONE_BUSY] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_BUSY), sampleRate);
_tone[Tone::TONE_RINGTONE] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_RINGTONE), sampleRate);
_tone[Tone::TONE_CONGESTION] = new Tone(_toneList.getDefinition(countryId, Tone::TONE_CONGESTION), sampleRate);
_currentTone = Tone::TONE_NULL;
}
TelephoneTone::~TelephoneTone()
......
......@@ -25,7 +25,7 @@
namespace Conf {
// ctor
ConfigTree::ConfigTree()
ConfigTree::ConfigTree():_sections()
{
}
......
......@@ -73,7 +73,10 @@ namespace Conf {
private:
friend class ConfigTree;
ConfigTreeIterator(ConfigTree *configTree) : _tree(configTree) {}
ConfigTreeIterator(ConfigTree *configTree) : _tree(configTree), _endToken(), _iter(), _iterItem() {}
ConfigTreeIterator(const Conf::ConfigTreeIterator&);
ConfigTreeIterator& operator=(const Conf::ConfigTreeIterator&);
ConfigTree* _tree;
TokenList _endToken;
......@@ -151,7 +154,7 @@ namespace Conf {
class ConfigTreeItem {
public:
ConfigTreeItem() : _defaultValue(""), _type("string") {}
ConfigTreeItem() : _name(""), _value(""), _defaultValue(""), _type("string") {}
// defaultvalue = value
ConfigTreeItem(const std::string& name, const std::string& value, const std::string& type) :
_name(name), _value(value),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment