diff --git a/configure.ac b/configure.ac index 92ee29eadcdd9dc5f94d349988db157e0953b2f9..a86a1df9851ffd64ab51ed3b68883a4fb0e7d6b6 100644 --- a/configure.ac +++ b/configure.ac @@ -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 -Wextra" dnl Check for header files AC_FUNC_ALLOCA diff --git a/src/account.cpp b/src/account.cpp index 5eedf99bd4b48a7a5fee986f1e84588dfd825b4d..88fdf99fda109f291d4d476ff2e830d1a6628edd 100644 --- a/src/account.cpp +++ b/src/account.cpp @@ -83,7 +83,7 @@ Account::subscribeContactsPresence() } void -Account::publishPresence(std::string presenceStatus) +Account::publishPresence(std::string presenceStatus UNUSED) { /* if(_link->isContactPresenceSupported()) diff --git a/src/audio/alsalayer.cpp b/src/audio/alsalayer.cpp index 8df372658b509dd96490d2ee222f7df853d0cff3..e1ba97a377118d7bcb8b8b0b6bb4a9a05c07b3e7 100644 --- a/src/audio/alsalayer.cpp +++ b/src/audio/alsalayer.cpp @@ -475,9 +475,11 @@ AlsaLayer::read( void* buffer, int toCopy) } int -AlsaLayer::putInCache( char code, void *buffer, int toCopy ) +AlsaLayer::putInCache( char code UNUSED, + void *buffer UNUSED, + int toCopy UNUSED ) { - return 1; + return 1; } void diff --git a/src/audio/codecDescriptor.cpp b/src/audio/codecDescriptor.cpp index 04b35d547a100b1ca724ffccef1e08e56fa50603..6dc3ead7f84e16b25f75abb406cf816cd044eff9 100644 --- a/src/audio/codecDescriptor.cpp +++ b/src/audio/codecDescriptor.cpp @@ -106,12 +106,12 @@ CodecDescriptor::isActive(AudioCodecType payload) } void -CodecDescriptor::removeCodec(AudioCodecType payload) +CodecDescriptor::removeCodec(AudioCodecType payload UNUSED) { } void -CodecDescriptor::addCodec(AudioCodecType payload) +CodecDescriptor::addCodec(AudioCodecType payload UNUSED) { } diff --git a/src/audio/pulselayer.cpp b/src/audio/pulselayer.cpp index a9942eacea223d54bbb0fd1e0d878952d98e1415..aeedc33a4badc4f508140493a826c27bee8209a3 100644 --- a/src/audio/pulselayer.cpp +++ b/src/audio/pulselayer.cpp @@ -130,7 +130,7 @@ PulseLayer::createStreams( pa_context* c ) } bool -PulseLayer::openDevice(int indexIn, int indexOut, int sampleRate, int frameSize , int stream, std::string plugin) +PulseLayer::openDevice(int indexIn UNUSED, int indexOut UNUSED, int sampleRate, int frameSize , int stream UNUSED, std::string plugin UNUSED) { _sampleRate = sampleRate; _frameSize = frameSize; @@ -165,7 +165,7 @@ PulseLayer::closePlaybackStream( void ) } int -PulseLayer::playSamples(void* buffer, int toCopy, bool isTalking) +PulseLayer::playSamples(void* buffer, int toCopy, bool isTalking UNUSED) { int a = _mainSndRingBuffer.AvailForPut(); if ( a >= toCopy ) { @@ -249,14 +249,14 @@ PulseLayer::audioCallback ( pa_stream* s, size_t bytes, void* userdata ) } void -PulseLayer::underflow ( pa_stream* s, void* userdata ) +PulseLayer::underflow ( pa_stream* s UNUSED, void* userdata UNUSED ) { _debug("Buffer Underflow\n"); } void -PulseLayer::overflow ( pa_stream* s, void* userdata ) +PulseLayer::overflow ( pa_stream* s, void* userdata UNUSED ) { //PulseLayer* pulse = (PulseLayer*) userdata; pa_stream_drop( s ); @@ -314,7 +314,7 @@ void PulseLayer::writeToSpeaker( void ) } if ( (tone=_manager->getTelephoneFile()) != 0 ) { toGet = framesPerBuffer; - toPlay = ( toGet * sizeof(SFLDataFormat)> framesPerBuffer )? framesPerBuffer : toGet * sizeof(SFLDataFormat) ; + toPlay = ( (int)(toGet * sizeof(SFLDataFormat)) > framesPerBuffer )? framesPerBuffer : toGet * sizeof(SFLDataFormat) ; out = (SFLDataFormat*)pa_xmalloc(toPlay); tone->getNext(out, toPlay/2 , 100); pa_stream_write( playback->pulseStream() , out , toPlay , pa_xfree, 0 , PA_SEEK_RELATIVE) ; @@ -354,7 +354,7 @@ void PulseLayer::readFromMic( void ) } int -PulseLayer::putInCache( char code, void *buffer, int toCopy ) +PulseLayer::putInCache( char code UNUSED, void *buffer UNUSED, int toCopy UNUSED ) { _debug("Put the DTMF in cache\n"); //pa_stream_write( cache->pulseStream() , buffer , toCopy , pa_xfree, 0 , PA_SEEK_RELATIVE); @@ -362,7 +362,7 @@ PulseLayer::putInCache( char code, void *buffer, int toCopy ) return 1; } -static void retrieve_server_info(pa_context *c, const pa_server_info *i, void *userdata) +static void retrieve_server_info(pa_context *c UNUSED, const pa_server_info *i, void *userdata UNUSED) { _debug("Server Info: Process owner : %s\n" , i->user_name); _debug("\t\tServer name : %s - Server version = %s\n" , i->server_name, i->server_version); @@ -381,7 +381,7 @@ static void retrieve_client_list(pa_context *c, const pa_client_info *i, int eol } */ -static void reduce_sink_list(pa_context *c, const pa_sink_input_info *i, int eol, void *userdata) +static void reduce_sink_list(pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) { PulseLayer* pulse = (PulseLayer*) userdata; AudioStream* s = pulse->getPlaybackStream(); @@ -396,7 +396,7 @@ static void reduce_sink_list(pa_context *c, const pa_sink_input_info *i, int eol } } -static void restore_sink_list(pa_context *c, const pa_sink_input_info *i, int eol, void *userdata) +static void restore_sink_list(pa_context *c UNUSED, const pa_sink_input_info *i, int eol, void *userdata) { PulseLayer* pulse = (PulseLayer*) userdata; //AudioStream* s = pulse->getPlaybackStream(); @@ -429,7 +429,7 @@ PulseLayer::serverinfo( void ) pa_context_get_server_info( context , retrieve_server_info , NULL ); } -static void on_success(pa_context *c, int success, void *userdata) +static void on_success(pa_context *c UNUSED, int success UNUSED, void *userdata UNUSED) { _debug("Operation successfull \n"); } diff --git a/src/audio/pulselayer.h b/src/audio/pulselayer.h index 08db1de9d33460c4ca7b833f5c236c4955a1f724..bcdf055163d978982dc3166ba221b3afc1e5403d 100644 --- a/src/audio/pulselayer.h +++ b/src/audio/pulselayer.h @@ -110,7 +110,7 @@ class PulseLayer : public AudioLayer { /** * UNUSED in pulseaudio layer */ - std::vector<std::string> getSoundCardsInfo( int stream ) { + std::vector<std::string> getSoundCardsInfo( int stream UNUSED ) { std::vector<std::string> tmp; return tmp; } @@ -118,12 +118,12 @@ class PulseLayer : public AudioLayer { /** * UNUSED in pulseaudio layer */ - bool soundCardIndexExist( int card , int stream ) { return true; } + bool soundCardIndexExist( int card UNUSED, int stream UNUSED ) { return true; } /** * UNUSED in pulseaudio layer */ - int soundCardGetIndex( std::string description ) { return 0;} + int soundCardGetIndex( std::string description UNUSED ) { return 0;} /** * UNUSED in pulseaudio layer diff --git a/src/audio/samplecache.cpp b/src/audio/samplecache.cpp index 87a22c9643998669c2b6c68b390ab129a28a6d2d..7f73642506ed1b71e3b12187847d4e8910b62f9b 100644 --- a/src/audio/samplecache.cpp +++ b/src/audio/samplecache.cpp @@ -30,7 +30,7 @@ SampleCache::~SampleCache() } bool -SampleCache::uploadSample( SFLDataFormat* buffer , size_t size ) +SampleCache::uploadSample( SFLDataFormat* buffer UNUSED, size_t size UNUSED ) { //pa_stream_write( pulse->caching , buffer , size , pa_xfree, 0 , PA_SEEK_RELATIVE); //pa_stream_finish_upload( pulse->caching ); diff --git a/src/dbus/callmanager.cpp b/src/dbus/callmanager.cpp index 9152b558ab016533ec4238704ac299d2c4283325..d3dbe2e84fd1425e8312ab3d41f9df1d0cb27413 100644 --- a/src/dbus/callmanager.cpp +++ b/src/dbus/callmanager.cpp @@ -114,7 +114,7 @@ CallManager::getVolume( const ::DBus::String& device ) } std::map< ::DBus::String, ::DBus::String > -CallManager::getCallDetails( const ::DBus::String& callID ) +CallManager::getCallDetails( const ::DBus::String& callID UNUSED ) { _debug("CallManager::getCallDetails received\n"); std::map<std::string, std::string> a; diff --git a/src/dbus/configurationmanager.cpp b/src/dbus/configurationmanager.cpp index 2e6a8c6ee1ca0f9ddd711a46ce52054ea0201c45..d0fe204e61b0b9f710934aa02d1bf5ff61315e92 100644 --- a/src/dbus/configurationmanager.cpp +++ b/src/dbus/configurationmanager.cpp @@ -80,8 +80,9 @@ ConfigurationManager::getAccountList( ) std::vector< ::DBus::String > ConfigurationManager::getToneLocaleList( ) { + std::vector< ::DBus::String > ret; _debug("ConfigurationManager::getToneLocaleList received\n"); - + return ret; } @@ -89,7 +90,9 @@ ConfigurationManager::getToneLocaleList( ) ::DBus::String ConfigurationManager::getVersion( ) { + ::DBus::String ret(""); _debug("ConfigurationManager::getVersion received\n"); + return ret; } @@ -97,8 +100,9 @@ ConfigurationManager::getVersion( ) std::vector< ::DBus::String > ConfigurationManager::getRingtoneList( ) { + std::vector< ::DBus::String > ret; _debug("ConfigurationManager::getRingtoneList received\n"); - + return ret; } @@ -208,14 +212,17 @@ ConfigurationManager::getCurrentAudioOutputPlugin( void ) std::vector< ::DBus::String > ConfigurationManager::getPlaybackDeviceList( ) { + std::vector< ::DBus::String > ret; _debug("ConfigurationManager::getPlaybackDeviceList received\n"); - + return ret; } std::vector< ::DBus::String > ConfigurationManager::getRecordDeviceList( ) { + std::vector< ::DBus::String > ret; _debug("ConfigurationManager::getRecordDeviceList received\n"); + return ret; } diff --git a/src/dbus/contactmanager.cpp b/src/dbus/contactmanager.cpp index 52dcfa1b93a998f96a09c3449ce25fc35a6f34f3..2a376470c1e465d8a28c5fc0a41b1bc3798fe8aa 100644 --- a/src/dbus/contactmanager.cpp +++ b/src/dbus/contactmanager.cpp @@ -23,25 +23,27 @@ const char* ContactManager::SERVER_PATH = "/org/sflphone/SFLphone/ContactManager"; std::map< ::DBus::String, ::DBus::String > -ContactManager::getContacts( const ::DBus::String& accountID ) +ContactManager::getContacts( const ::DBus::String& accountID UNUSED) { // TODO + std::map< ::DBus::String, ::DBus::String > ret; + return ret; } void -ContactManager::setContacts( const ::DBus::String& accountID, const std::map< ::DBus::String, ::DBus::String >& details ) +ContactManager::setContacts( const ::DBus::String& accountID UNUSED, const std::map< ::DBus::String UNUSED, ::DBus::String >& details UNUSED) { // TODO } void -ContactManager::setPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo ) +ContactManager::setPresence( const ::DBus::String& accountID UNUSED, const ::DBus::String& presence UNUSED, const ::DBus::String& additionalInfo UNUSED) { // TODO } void -ContactManager::setContactPresence( const ::DBus::String& accountID, const ::DBus::String& presence, const ::DBus::String& additionalInfo ) +ContactManager::setContactPresence( const ::DBus::String& accountID UNUSED, const ::DBus::String& presence UNUSED, const ::DBus::String& additionalInfo UNUSED) { // TODO } diff --git a/src/dbus/instance.cpp b/src/dbus/instance.cpp index c573817129bb40d1e80f5caf3240c23911782ce7..a3d9c20082a151bb9b78073d9654861e97fb784f 100644 --- a/src/dbus/instance.cpp +++ b/src/dbus/instance.cpp @@ -29,8 +29,8 @@ Instance::Instance( DBus::Connection& connection ) } void -Instance::Register( const ::DBus::Int32& pid, - const ::DBus::String& name ) +Instance::Register( const ::DBus::Int32& pid UNUSED, + const ::DBus::String& name UNUSED) { _debug("Instance::register received\n"); count++; @@ -38,7 +38,7 @@ Instance::Register( const ::DBus::Int32& pid, void -Instance::Unregister( const ::DBus::Int32& pid ) +Instance::Unregister( const ::DBus::Int32& pid UNUSED) { _debug("Instance::unregister received\n"); count --; diff --git a/src/global.h b/src/global.h index afdbdaf05d53919b587b39a8569b9a41b8fbdf55..b68c72671df938dedfe1ad271fe8c83f1f8f040c 100644 --- a/src/global.h +++ b/src/global.h @@ -126,4 +126,6 @@ typedef short int16; #define PULSEAUDIO 1 #define CHECK_INTERFACE( layer , api ) (layer == api) +#define UNUSED __attribute__((__unused__)) + #endif // __GLOBAL_H__ diff --git a/src/managerimpl.cpp b/src/managerimpl.cpp index a30e871ae623b626d69b2d0b1f8ea2aadb3ac4e4..f1bf959ed120852564aaae2ffd3b88ab011d88e3 100644 --- a/src/managerimpl.cpp +++ b/src/managerimpl.cpp @@ -551,7 +551,7 @@ ManagerImpl::playDtmf(char code, bool isTalking) if( CHECK_INTERFACE( layer , PULSEAUDIO )) { // Cache the samples on the sound server - (PulseLayer*)audiolayer->putInCache( code, _buf , size * sizeof(SFLDataFormat) ); + // (PulseLayer*)audiolayer->putInCache( code, _buf , size * sizeof(SFLDataFormat) ); } delete[] _buf; _buf = 0; @@ -731,7 +731,7 @@ ManagerImpl::registrationSucceed(const AccountID& accountid) //THREAD=VoIP void -ManagerImpl::unregistrationSucceed(const AccountID& accountid) +ManagerImpl::unregistrationSucceed(const AccountID& accountid UNUSED) { _debug("UNREGISTRATION SUCCEED\n"); if (_dbus) _dbus->getConfigurationManager()->accountsChanged(); @@ -1791,7 +1791,7 @@ ManagerImpl::detachZeroconfEvents(Pattern::Observer& observer) * Main Thread */ bool -ManagerImpl::getCallStatus(const std::string& sequenceId) +ManagerImpl::getCallStatus(const std::string& sequenceId UNUSED) { if (!_dbus) { return false; } ost::MutexLock m(_callAccountMapMutex); @@ -2232,7 +2232,7 @@ ManagerImpl::loadAccountMap() TokenList::iterator iter = sections.begin(); while(iter != sections.end()) { // Check if it starts with "Account:" (SIP and IAX pour le moment) - if (iter->find("Account:") == -1) { + if ((int)(iter->find("Account:")) == -1) { iter++; continue; } @@ -2345,7 +2345,7 @@ ManagerImpl::getAccountLink(const AccountID& accountID) } pjsip_regc -*getSipRegcFromID(const AccountID& id) +*getSipRegcFromID(const AccountID& id UNUSED) { /*SIPAccount *tmp = dynamic_cast<SIPAccount *>getAccount(id); if(tmp != NULL) diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp index 213f3a1f04d6afc0c08c1f5cb7c042da143c4927..4228028ccb514a7dee845d26f90e5411109597d1 100644 --- a/src/sipvoiplink.cpp +++ b/src/sipvoiplink.cpp @@ -356,7 +356,7 @@ SIPVoIPLink::refuse (const CallID& id) } bool -SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code) +SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code UNUSED) { SIPCall* call = getSIPCall(id); if (call==0) { _debug("Call doesn't exist\n"); return false; } @@ -383,7 +383,7 @@ SIPVoIPLink::carryingDTMFdigits(const CallID& id, char code) } bool -SIPVoIPLink::sendMessage(const std::string& to, const std::string& body) +SIPVoIPLink::sendMessage(const std::string& to UNUSED, const std::string& body UNUSED) { return true; } @@ -407,7 +407,7 @@ SIPVoIPLink::SIPOutgoingInvite(SIPCall* call) } bool -SIPVoIPLink::SIPStartCall(SIPCall* call, const std::string& subject) +SIPVoIPLink::SIPStartCall(SIPCall* call, const std::string& subject UNUSED) { if (!call) return false; @@ -476,7 +476,7 @@ SIPVoIPLink::SIPToHeader(const std::string& to) } bool -SIPVoIPLink::SIPCheckUrl(const std::string& url) +SIPVoIPLink::SIPCheckUrl(const std::string& url UNUSED) { return true; } diff --git a/src/useragent.cpp b/src/useragent.cpp index 22e49c3afb9f2c7ec590d076dd8a5ec97eaf4a2f..7fc5c1e4d61e3537e350c897ba5bdb4cb28a8412 100644 --- a/src/useragent.cpp +++ b/src/useragent.cpp @@ -349,7 +349,7 @@ void UserAgent::busy_sleep(unsigned msec) } bool UserAgent::addAccount(AccountID id, pjsip_regc **regc2, const std::string& server, const std::string& user, const std::string& passwd, - const int& timeout, const unsigned int& port) { + const int& timeout UNUSED, const unsigned int& port) { pj_status_t status; AccountID *currentId = new AccountID(id); char contactTmp[256]; @@ -698,7 +698,7 @@ pj_bool_t UserAgent::mod_on_rx_request(pjsip_rx_data *rdata) { // Retrieve all the message. Should contains only the method name but ... request = rdata->msg_info.msg->line.req.method.name.ptr; // Check if the message is a notification - if( request.find( method_name ) != -1 ) { + if( request.find( method_name ) != (size_t)-1 ) { set_voicemail_info( account_id, rdata->msg_info.msg->body ); } pjsip_endpt_respond_stateless(getInstance()->getEndPoint(), rdata, PJSIP_SC_OK, NULL, NULL, NULL); diff --git a/src/useragent.h b/src/useragent.h index 5fd237dc46e17f76822c07493fe1feb261e76359..f5cf104f819944e157edd682a01a9924669a816a 100644 --- a/src/useragent.h +++ b/src/useragent.h @@ -126,11 +126,11 @@ public: bool makeOutgoingCall(const std::string& to, SIPCall* call, const AccountID& id); pj_pool_t *getAppPool() {return _pool;} static pj_bool_t mod_on_rx_request(pjsip_rx_data *rdata); - static pj_bool_t mod_on_rx_response(pjsip_rx_data *rdata) {return PJ_SUCCESS;} + static pj_bool_t mod_on_rx_response(pjsip_rx_data *rdata UNUSED) {return PJ_SUCCESS;} static void regc_cb(struct pjsip_regc_cbparam *param); static void xfer_func_cb( pjsip_evsub *sub, pjsip_event *event); static void xfer_svr_cb(pjsip_evsub *sub, pjsip_event *event); - static void call_on_media_update( pjsip_inv_session *inv, pj_status_t status) {} + static void call_on_media_update( pjsip_inv_session *inv UNUSED, pj_status_t status UNUSED) {} static void call_on_state_changed( pjsip_inv_session *inv, pjsip_event *e); static void call_on_forked(pjsip_inv_session *inv, pjsip_event *e); static void call_on_tsx_changed(pjsip_inv_session *inv, pjsip_transaction *tsx, pjsip_event *e); diff --git a/src/voiplink.cpp b/src/voiplink.cpp index 1a762036ed9a44f0c84b2b0458da5dfabc09d22e..5b0dea44f75d4203bf1c2055f197cf121cdc5415 100644 --- a/src/voiplink.cpp +++ b/src/voiplink.cpp @@ -135,7 +135,7 @@ VoIPLink::subscribePresenceForContact(Contact* contact) }*/ void -VoIPLink::publishPresenceStatus(std::string status) +VoIPLink::publishPresenceStatus(std::string status UNUSED) { // Nothing to do if presence is not supported // or the function will be overidden