get rid of warnings

this eliminates all warnings and turns on -Werror
This commit is contained in:
Michael Zanetti 2014-10-12 03:17:18 +02:00 committed by Michael Zanetti
parent 02b2cd0235
commit 1cc0c4dd15
12 changed files with 29 additions and 21 deletions

View File

@ -2,6 +2,9 @@
GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"') GUH_VERSION_STRING=$$system('dpkg-parsechangelog | sed -n -e "s/^Version: //p"')
DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\" DEFINES += GUH_VERSION_STRING=\\\"$${GUH_VERSION_STRING}\\\"
QMAKE_CXXFLAGS += -Werror
CONFIG += c++11
# Enable coverage option # Enable coverage option
coverage { coverage {
QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage -O0 QMAKE_CXXFLAGS += -fprofile-arcs -ftest-coverage -O0

View File

@ -265,6 +265,8 @@ DeviceManager::DeviceError DeviceManager::pairDevice(const PairingTransactionId
return DeviceErrorDeviceClassNotFound; return DeviceErrorDeviceClassNotFound;
} }
Q_UNUSED(pairingTransactionId)
Q_UNUSED(params)
switch (deviceClass.setupMethod()) { switch (deviceClass.setupMethod()) {
case DeviceClass::SetupMethodJustAdd: case DeviceClass::SetupMethodJustAdd:
qWarning() << "Cannot setup this device this way. No need to pair this device."; qWarning() << "Cannot setup this device this way. No need to pair this device.";
@ -314,6 +316,7 @@ DeviceManager::DeviceError DeviceManager::pairDevice(const PairingTransactionId
DeviceManager::DeviceError DeviceManager::confirmPairing(const PairingTransactionId &pairingTransactionId, const QString &secret) DeviceManager::DeviceError DeviceManager::confirmPairing(const PairingTransactionId &pairingTransactionId, const QString &secret)
{ {
Q_UNUSED(secret)
if (m_pairingsJustAdd.contains(pairingTransactionId)) { if (m_pairingsJustAdd.contains(pairingTransactionId)) {
qWarning() << "this SetupMethod is not implemented yet"; qWarning() << "this SetupMethod is not implemented yet";
m_pairingsJustAdd.remove(pairingTransactionId); m_pairingsJustAdd.remove(pairingTransactionId);

View File

@ -3,8 +3,6 @@ include(../guh.pri)
TARGET = guh TARGET = guh
TEMPLATE = lib TEMPLATE = lib
CONFIG += c++11
QT += network QT += network
target.path = /usr/lib target.path = /usr/lib

View File

@ -249,6 +249,7 @@ QList<ParamType> DevicePluginEQ3::configurationDescription() const
DeviceManager::DeviceError DevicePluginEQ3::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params) DeviceManager::DeviceError DevicePluginEQ3::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params)
{ {
Q_UNUSED(params)
if(deviceClassId == cubeDeviceClassId){ if(deviceClassId == cubeDeviceClassId){
m_cubeDiscovery->detectCubes(); m_cubeDiscovery->detectCubes();
return DeviceManager::DeviceErrorAsync; return DeviceManager::DeviceErrorAsync;

View File

@ -881,6 +881,7 @@ void MaxCube::setDeviceEcoMode(QByteArray rfAddress, int roomId, ActionId action
void MaxCube::displayCurrentTemperature(QByteArray rfAddress, int roomId, bool display, ActionId actionId) void MaxCube::displayCurrentTemperature(QByteArray rfAddress, int roomId, bool display, ActionId actionId)
{ {
Q_UNUSED(roomId)
m_actionId = actionId; m_actionId = actionId;
if(!isConnected() || !isInitialized()){ if(!isConnected() || !isInitialized()){
emit commandActionFinished(false,m_actionId); emit commandActionFinished(false,m_actionId);

View File

@ -247,6 +247,7 @@ DevicePluginMailNotification::~DevicePluginMailNotification()
DeviceManager::DeviceSetupStatus DevicePluginMailNotification::setupDevice(Device *device) DeviceManager::DeviceSetupStatus DevicePluginMailNotification::setupDevice(Device *device)
{ {
Q_UNUSED(device)
// Google mail // Google mail
// if(device->deviceClassId() == googleMailDeviceClassId){ // if(device->deviceClassId() == googleMailDeviceClassId){
// m_smtpClient->setConnectionType(SmtpClient::SslConnection); // m_smtpClient->setConnectionType(SmtpClient::SslConnection);

View File

@ -136,6 +136,7 @@ void DevicePluginPhilipsHue::deviceRemoved(Device *device)
DeviceManager::DeviceSetupStatus DevicePluginPhilipsHue::confirmPairing(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList &params) DeviceManager::DeviceSetupStatus DevicePluginPhilipsHue::confirmPairing(const PairingTransactionId &pairingTransactionId, const DeviceClassId &deviceClassId, const ParamList &params)
{ {
Q_UNUSED(deviceClassId)
Param ipParam; Param ipParam;
foreach (const Param &param, params) { foreach (const Param &param, params) {
if (param.name() == "ip") { if (param.name() == "ip") {
@ -260,7 +261,7 @@ void DevicePluginPhilipsHue::getLightsFinished(int id, const QVariant &params)
void DevicePluginPhilipsHue::getFinished(int id, const QVariant &params) void DevicePluginPhilipsHue::getFinished(int id, const QVariant &params)
{ {
qDebug() << "got lights" << params; qDebug() << "got lights" << params << id;
} }
void DevicePluginPhilipsHue::lightStateChanged() void DevicePluginPhilipsHue::lightStateChanged()

View File

@ -177,26 +177,26 @@ void Light::setColor(const QColor &color)
quint16 hue = color.hue() * 65535 / 360; quint16 hue = color.hue() * 65535 / 360;
quint8 sat = color.saturation(); quint8 sat = color.saturation();
// Transform from RGB to XYZ // // Transform from RGB to XYZ
QGenericMatrix<3, 3, qreal> rgb2xyzMatrix; // QGenericMatrix<3, 3, qreal> rgb2xyzMatrix;
rgb2xyzMatrix(0, 0) = 0.412453; rgb2xyzMatrix(0, 1) = 0.357580; rgb2xyzMatrix(0, 2) = 0.180423; // rgb2xyzMatrix(0, 0) = 0.412453; rgb2xyzMatrix(0, 1) = 0.357580; rgb2xyzMatrix(0, 2) = 0.180423;
rgb2xyzMatrix(1, 0) = 0.212671; rgb2xyzMatrix(1, 1) = 0.715160; rgb2xyzMatrix(1, 2) = 0.072169; // rgb2xyzMatrix(1, 0) = 0.212671; rgb2xyzMatrix(1, 1) = 0.715160; rgb2xyzMatrix(1, 2) = 0.072169;
rgb2xyzMatrix(2, 0) = 0.019334; rgb2xyzMatrix(2, 1) = 0.119193; rgb2xyzMatrix(2, 2) = 0.950227; // rgb2xyzMatrix(2, 0) = 0.019334; rgb2xyzMatrix(2, 1) = 0.119193; rgb2xyzMatrix(2, 2) = 0.950227;
QGenericMatrix<1, 3, qreal> rgbMatrix; // QGenericMatrix<1, 3, qreal> rgbMatrix;
rgbMatrix(0, 0) = 1.0 * color.red() / 255; // rgbMatrix(0, 0) = 1.0 * color.red() / 255;
rgbMatrix(1, 0) = 1.0 * color.green() / 255; // rgbMatrix(1, 0) = 1.0 * color.green() / 255;
rgbMatrix(2, 0) = 1.0 * color.blue() / 255; // rgbMatrix(2, 0) = 1.0 * color.blue() / 255;
QGenericMatrix<1, 3, qreal> xyzMatrix = rgb2xyzMatrix * rgbMatrix; // QGenericMatrix<1, 3, qreal> xyzMatrix = rgb2xyzMatrix * rgbMatrix;
// transform from XYZ to CIELUV u' and v' // // transform from XYZ to CIELUV u' and v'
qreal u = 4*xyzMatrix(0, 0) / (xyzMatrix(0, 0) + 15*xyzMatrix(1, 0) + 3*xyzMatrix(2, 0)); // qreal u = 4*xyzMatrix(0, 0) / (xyzMatrix(0, 0) + 15*xyzMatrix(1, 0) + 3*xyzMatrix(2, 0));
qreal v = 9*xyzMatrix(1, 0) / (xyzMatrix(0, 0) + 15*xyzMatrix(1, 0) + 3*xyzMatrix(2, 0)); // qreal v = 9*xyzMatrix(1, 0) / (xyzMatrix(0, 0) + 15*xyzMatrix(1, 0) + 3*xyzMatrix(2, 0));
// Transform from CIELUV to (x,y) // Transform from CIELUV to (x,y)
qreal x = 27*u / (18*u - 48*v + 36); // qreal x = 27*u / (18*u - 48*v + 36);
qreal y = 12*v / (18*u - 48*v + 36); // qreal y = 12*v / (18*u - 48*v + 36);
qDebug() << "setting color" << color; qDebug() << "setting color" << color;
if (m_busyStateChangeId == -1) { if (m_busyStateChangeId == -1) {

View File

@ -148,6 +148,7 @@ DevicePluginWemo::DevicePluginWemo()
DeviceManager::DeviceError DevicePluginWemo::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params) DeviceManager::DeviceError DevicePluginWemo::discoverDevices(const DeviceClassId &deviceClassId, const ParamList &params)
{ {
Q_UNUSED(params)
if(deviceClassId != wemoSwitchDeviceClassId){ if(deviceClassId != wemoSwitchDeviceClassId){
return DeviceManager::DeviceErrorDeviceClassNotFound; return DeviceManager::DeviceErrorDeviceClassNotFound;
} }

View File

@ -1,7 +1,7 @@
include(../guh.pri) include(../guh.pri)
TEMPLATE = lib TEMPLATE = lib
CONFIG += plugin c++11 CONFIG += plugin
INCLUDEPATH += ../../../libguh INCLUDEPATH += ../../../libguh
LIBS += -L../../../libguh -lguh LIBS += -L../../../libguh -lguh

View File

@ -11,7 +11,6 @@ target.path = /usr/bin
INSTALLS += target INSTALLS += target
QT += network QT += network
CONFIG += c++11
LIBS += -L$$top_builddir/libguh/ -lguh LIBS += -L$$top_builddir/libguh/ -lguh

View File

@ -1,5 +1,5 @@
QT += testlib network QT += testlib network
CONFIG += testcase c++11 CONFIG += testcase
include($$top_srcdir/server/server.pri) include($$top_srcdir/server/server.pri)