Commit 6c771fa0 authored by Julien Bonjean's avatar Julien Bonjean

[#3376] Code cleanup

parent 76fa379a
# Global variables # Global variables
CXXFLAGS=-Wall -Werror -Wextra
src=$(top_srcdir) src=$(top_srcdir)
sfllibdir=$(DESTDIR)$(libdir)/sflphone sfllibdir=$(DESTDIR)$(libdir)/sflphone
sflcodecdir=$(sfllibdir)/codecs sflcodecdir=$(sfllibdir)/codecs
......
...@@ -252,7 +252,7 @@ void AudioSrtpSession::initializeLocalCryptoContext(void) ...@@ -252,7 +252,7 @@ void AudioSrtpSession::initializeLocalCryptoContext(void)
} }
#pragma GCC diagnostic ignored "-Wunused-value"
char* AudioSrtpSession::encodeBase64(unsigned char *input, int length) char* AudioSrtpSession::encodeBase64(unsigned char *input, int length)
{ {
BIO *b64, *bmem; BIO *b64, *bmem;
...@@ -284,6 +284,7 @@ char* AudioSrtpSession::encodeBase64(unsigned char *input, int length) ...@@ -284,6 +284,7 @@ char* AudioSrtpSession::encodeBase64(unsigned char *input, int length)
return buffer; return buffer;
} }
#pragma GCC diagnostic error "-Wunused-value"
char* AudioSrtpSession::decodeBase64(unsigned char *input, int length, int *length_out) char* AudioSrtpSession::decodeBase64(unsigned char *input, int length, int *length_out)
{ {
......
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
#ifndef __SFL_CALLMANAGER_H__ #ifndef __SFL_CALLMANAGER_H__
#define __SFL_CALLMANAGER_H__ #define __SFL_CALLMANAGER_H__
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "callmanager-glue.h" #include "callmanager-glue.h"
#pragma GCC diagnostic error "-Wignored-qualifiers"
#pragma GCC diagnostic error "-Wunused-parameter"
#include <dbus-c++/dbus.h> #include <dbus-c++/dbus.h>
#include <exception> #include <exception>
......
...@@ -101,19 +101,6 @@ ...@@ -101,19 +101,6 @@
</arg> </arg>
</method> </method>
<method name="setNumberOfCredential" tp:name-for-bindings="setNumberOfCredential">
<tp:docstring>
</tp:docstring>
<arg type="s" name="accountID" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
<arg type="i" name="number" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
</method>
<method name="deleteAllCredential" tp:name-for-bindings="deleteAllCredential"> <method name="deleteAllCredential" tp:name-for-bindings="deleteAllCredential">
<tp:docstring> <tp:docstring>
</tp:docstring> </tp:docstring>
...@@ -776,10 +763,6 @@ ...@@ -776,10 +763,6 @@
<method name="getTlsSettings" tp:name-for-bindings="getTlsSettings"> <method name="getTlsSettings" tp:name-for-bindings="getTlsSettings">
<tp:docstring> <tp:docstring>
</tp:docstring> </tp:docstring>
<arg type="s" name="accountID" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/>
<arg type="a{ss}" name="details" direction="out"> <arg type="a{ss}" name="details" direction="out">
<tp:docstring> <tp:docstring>
...@@ -791,10 +774,6 @@ ...@@ -791,10 +774,6 @@
<tp:docstring> <tp:docstring>
</tp:docstring> </tp:docstring>
<annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/> <annotation name="com.trolltech.QtDBus.QtTypeName.In1" value="MapStringString"/>
<arg type="s" name="accountID" direction="in">
<tp:docstring>
</tp:docstring>
</arg>
<arg type="a{ss}" name="details" direction="in"> <arg type="a{ss}" name="details" direction="in">
<tp:docstring> <tp:docstring>
</tp:docstring> </tp:docstring>
......
...@@ -115,7 +115,7 @@ std::map<std::string, std::string> ConfigurationManager::getIp2IpDetails(void) { ...@@ -115,7 +115,7 @@ std::map<std::string, std::string> ConfigurationManager::getIp2IpDetails(void) {
ip2ipAccountDetails.insert(std::pair<std::string, std::string>(LOCAL_PORT, portstr.str())); ip2ipAccountDetails.insert(std::pair<std::string, std::string>(LOCAL_PORT, portstr.str()));
std::map<std::string, std::string> tlsSettings; std::map<std::string, std::string> tlsSettings;
tlsSettings = getTlsSettings(IP2IP_PROFILE); tlsSettings = getTlsSettings();
std::copy(tlsSettings.begin(), tlsSettings.end(), std::inserter( std::copy(tlsSettings.begin(), tlsSettings.end(), std::inserter(
ip2ipAccountDetails, ip2ipAccountDetails.end())); ip2ipAccountDetails, ip2ipAccountDetails.end()));
...@@ -162,7 +162,7 @@ void ConfigurationManager::setIp2IpDetails(const std::map<std::string, ...@@ -162,7 +162,7 @@ void ConfigurationManager::setIp2IpDetails(const std::map<std::string,
it = map_cpy.find(ZRTP_DISPLAY_SAS_ONCE); it = map_cpy.find(ZRTP_DISPLAY_SAS_ONCE);
if (it != details.end()) sipaccount->setZrtpDiaplaySasOnce((it->second == "true")); if (it != details.end()) sipaccount->setZrtpDiaplaySasOnce((it->second == "true"));
setTlsSettings(IP2IP_PROFILE, details); setTlsSettings(details);
Manager::instance().saveConfig(); Manager::instance().saveConfig();
...@@ -174,8 +174,7 @@ void ConfigurationManager::setIp2IpDetails(const std::map<std::string, ...@@ -174,8 +174,7 @@ void ConfigurationManager::setIp2IpDetails(const std::map<std::string,
} }
std::map<std::string, std::string> ConfigurationManager::getTlsSettings( std::map<std::string, std::string> ConfigurationManager::getTlsSettings() {
const std::string& section) {
std::map<std::string, std::string> tlsSettings; std::map<std::string, std::string> tlsSettings;
...@@ -203,8 +202,7 @@ std::map<std::string, std::string> ConfigurationManager::getTlsSettings( ...@@ -203,8 +202,7 @@ std::map<std::string, std::string> ConfigurationManager::getTlsSettings(
return tlsSettings; return tlsSettings;
} }
void ConfigurationManager::setTlsSettings(const std::string& section, void ConfigurationManager::setTlsSettings(const std::map<std::string, std::string>& details) {
const std::map<std::string, std::string>& details) {
std::map<std::string, std::string> map_cpy = details; std::map<std::string, std::string> map_cpy = details;
std::map<std::string, std::string>::iterator it; std::map<std::string, std::string>::iterator it;
...@@ -306,16 +304,6 @@ int32_t ConfigurationManager::getNumberOfCredential( ...@@ -306,16 +304,6 @@ int32_t ConfigurationManager::getNumberOfCredential(
return sipaccount->getCredentialCount(); return sipaccount->getCredentialCount();
} }
void ConfigurationManager::setNumberOfCredential(const std::string& accountID,
const int32_t& number) {
/*
if (accountID != AccountNULL || !accountID.empty()) {
SIPAccount *sipaccount = (SIPAccount *)Manager::instance().getAccount(accountID);
sipaccount->setCredentialCount(number);
}
*/
}
void ConfigurationManager::setCredential(const std::string& accountID, void ConfigurationManager::setCredential(const std::string& accountID,
const int32_t& index, const std::map<std::string, std::string>& details) { const int32_t& index, const std::map<std::string, std::string>& details) {
Manager::instance().setCredential(accountID, index, details); Manager::instance().setCredential(accountID, index, details);
......
...@@ -34,7 +34,12 @@ ...@@ -34,7 +34,12 @@
#ifndef CONFIGURATIONMANAGER_H #ifndef CONFIGURATIONMANAGER_H
#define CONFIGURATIONMANAGER_H #define CONFIGURATIONMANAGER_H
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "configurationmanager-glue.h" #include "configurationmanager-glue.h"
#pragma GCC diagnostic error "-Wignored-qualifiers"
#pragma GCC diagnostic error "-Wunused-parameter"
#include <dbus-c++/dbus.h> #include <dbus-c++/dbus.h>
...@@ -67,7 +72,6 @@ public: ...@@ -67,7 +72,6 @@ public:
std::map< std::string, std::string > getCredential (const std::string& accountID, const int32_t& index); std::map< std::string, std::string > getCredential (const std::string& accountID, const int32_t& index);
int32_t getNumberOfCredential (const std::string& accountID); int32_t getNumberOfCredential (const std::string& accountID);
void setCredential (const std::string& accountID, const int32_t& index, const std::map< std::string, std::string >& details); void setCredential (const std::string& accountID, const int32_t& index, const std::map< std::string, std::string >& details);
void setNumberOfCredential (const std::string& accountID, const int32_t& number);
std::vector< std::string > getCodecList(void); std::vector< std::string > getCodecList(void);
std::vector< std::string > getSupportedTlsMethod(void); std::vector< std::string > getSupportedTlsMethod(void);
...@@ -131,8 +135,8 @@ public: ...@@ -131,8 +135,8 @@ public:
std::map <std::string, std::string> getHistory (void); std::map <std::string, std::string> getHistory (void);
void setHistory (const std::map <std::string, std::string>& entries); void setHistory (const std::map <std::string, std::string>& entries);
std::map<std::string, std::string> getTlsSettings(const std::string& accountID); std::map<std::string, std::string> getTlsSettings(void);
void setTlsSettings(const std::string& accountID, const std::map< std::string, std::string >& details); void setTlsSettings(const std::map< std::string, std::string >& details);
std::string getAddrFromInterfaceName(const std::string& interface); std::string getAddrFromInterfaceName(const std::string& interface);
......
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
#ifndef INSTANCE_H #ifndef INSTANCE_H
#define INSTANCE_H #define INSTANCE_H
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "instance-glue.h" #include "instance-glue.h"
#pragma GCC diagnostic error "-Wignored-qualifiers"
#pragma GCC diagnostic error "-Wunused-parameter"
#include <dbus-c++/dbus.h> #include <dbus-c++/dbus.h>
......
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
#ifndef NETWORKMANAGER_H #ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H #define NETWORKMANAGER_H
#pragma GCC diagnostic ignored "-Wignored-qualifiers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "networkmanager_proxy.h" #include "networkmanager_proxy.h"
#pragma GCC diagnostic error "-Wignored-qualifiers"
#pragma GCC diagnostic error "-Wunused-parameter"
using namespace std; using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment