Skip to content

Commit

Permalink
Adding warning flags to the project file and fixing some local warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
VeithMetro committed Aug 22, 2023
1 parent bb7695e commit 9df488f
Show file tree
Hide file tree
Showing 36 changed files with 56 additions and 37 deletions.
2 changes: 1 addition & 1 deletion AVS/Impl/AVSDevice/AVSDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(AVSDevice, 1, 0);
SERVICE_REGISTRATION(AVSDevice, 1, 0)

using namespace alexaClientSDK;

Expand Down
2 changes: 1 addition & 1 deletion AVS/Impl/SmartScreen/SmartScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(SmartScreen, 1, 0);
SERVICE_REGISTRATION(SmartScreen, 1, 0)

using namespace alexaClientSDK;

Expand Down
2 changes: 1 addition & 1 deletion BluetoothControl/BluetoothControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ENUM_CONVERSION_BEGIN(Plugin::BluetoothControl::Config::adaptertype)
{ Plugin::BluetoothControl::Config::CLASSIC, _TXT("classic") },
{ Plugin::BluetoothControl::Config::LOW_ENERGY, _TXT("lowenergy") },
{ Plugin::BluetoothControl::Config::DUAL, _TXT("dual") },
ENUM_CONVERSION_END(Plugin::BluetoothControl::Config::adaptertype);
ENUM_CONVERSION_END(Plugin::BluetoothControl::Config::adaptertype)

namespace Plugin {

Expand Down
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,30 @@ option(PLUGIN_WEBSERVER "Include WebServer plugin" OFF)
option(PLUGIN_WEBSHELL "Include WebShell plugin" OFF)
option(PLUGIN_WIFICONTROL "Include WifiControl plugin" OFF)
option(PLUGIN_FILETRANSFER "Include FileTransfer plugin" OFF)
option(ENABLE_STRICT_COMPILER_SETTINGS "Enable compiler flags to get the warnings/errors due to improper condition in the code" ON)

if(BUILD_REFERENCE)
add_definitions(-DBUILD_REFERENCE=${BUILD_REFERENCE})
endif()

if(ENABLE_STRICT_COMPILER_SETTINGS)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(FATAL_ERROR "Compiling with Clang")
set(CMAKE_STRICT_COMPILER_SETTINGS "-Weverything -Wextra -Wpedantic -Werror")
set(CMAKE_STRICT_CXX_COMPILER_SETTINGS "${CMAKE_STRICT_COMPILER_SETTINGS} -Wnon-virtual-dtor")
elseif(${CMAKE_COMPILER_IS_GNUCXX})
message(STATUS "Compiling with GCC")
set(CMAKE_STRICT_COMPILER_SETTINGS "-Wall -Wextra -Wpedantic -Werror")
set(CMAKE_STRICT_CXX_COMPILER_SETTINGS "${CMAKE_STRICT_COMPILER_SETTINGS} -Wnon-virtual-dtor")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
message(STATUS "Compiling with MS Visual Studio")
set(CMAKE_STRICT_COMPILER_SETTINGS "/W4")
else()
message(STATUS "Compiler ${CMAKE_CXX_COMPILER_ID}")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_STRICT_CXX_COMPILER_SETTINGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_STRICT_COMPILER_SETTINGS}")
endif()

if(PLUGIN_AVS)
add_subdirectory(AVS)
Expand Down
2 changes: 1 addition & 1 deletion Cobalt/CobaltImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ class CobaltImplementation:
PluginHost::IShell* _service;
};

SERVICE_REGISTRATION(CobaltImplementation, 1, 0);
SERVICE_REGISTRATION(CobaltImplementation, 1, 0)

}
/* namespace Plugin */
Expand Down
2 changes: 1 addition & 1 deletion Compositor/lib/Mesa/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ namespace Plugin {
Compositor::Color _background;
};

SERVICE_REGISTRATION(CompositorImplementation, 1, 0);
SERVICE_REGISTRATION(CompositorImplementation, 1, 0)

} // namespace Plugin
} // namespace WPEFramework
2 changes: 1 addition & 1 deletion Compositor/lib/RPI/RPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ namespace Plugin {
ClientDataContainer _clients;
};

SERVICE_REGISTRATION(CompositorImplementation, 1, 0);
SERVICE_REGISTRATION(CompositorImplementation, 1, 0)

} // namespace Plugin
} // namespace WPEFramework
2 changes: 1 addition & 1 deletion Compositor/lib/Wayland/Wayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ namespace Plugin {
#endif
};

SERVICE_REGISTRATION(CompositorImplementation, 1, 0);
SERVICE_REGISTRATION(CompositorImplementation, 1, 0)

} // namespace Plugin

Expand Down
2 changes: 1 addition & 1 deletion Doggo/Doggo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(Doggo, 1, 0);
SERVICE_REGISTRATION(Doggo, 1, 0)

const string Doggo::Initialize(PluginHost::IShell* service)
{
Expand Down
2 changes: 1 addition & 1 deletion LanguageAdministrator/LanguageAdministratorImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(LanguageAdministratorImpl, 1, 0);
SERVICE_REGISTRATION(LanguageAdministratorImpl, 1, 0)

LanguageAdministratorImpl::LanguageAdministratorImpl()
: _adminLock()
Expand Down
2 changes: 1 addition & 1 deletion NetworkControl/NetworkControlImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ POP_WARNING()
std::vector<Exchange::INetworkControl::INotification*> _notifications;
};

SERVICE_REGISTRATION(NetworkControlImplementation, 1, 0);
SERVICE_REGISTRATION(NetworkControlImplementation, 1, 0)
} // namespace Plugin
} // namespace WPEFramework

2 changes: 1 addition & 1 deletion RemoteControl/LinuxDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,5 +824,5 @@ ENUM_CONVERSION_BEGIN(Plugin::LinuxDevice::type)
{ Plugin::LinuxDevice::type::MOUSE, _TXT("MOUSE") },
{ Plugin::LinuxDevice::type::JOYSTICK, _TXT("JOYSTICK") },
{ Plugin::LinuxDevice::type::TOUCH, _TXT("TOUCH") },
ENUM_CONVERSION_END(Plugin::LinuxDevice::type);
ENUM_CONVERSION_END(Plugin::LinuxDevice::type)
}
2 changes: 1 addition & 1 deletion ResourceMonitor/ResourceMonitorImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,6 @@ namespace Plugin {
string _csvFilePath;
};

SERVICE_REGISTRATION(ResourceMonitorImplementation, 1, 0);
SERVICE_REGISTRATION(ResourceMonitorImplementation, 1, 0)
} /* namespace Plugin */
} // namespace WPEFramework
2 changes: 1 addition & 1 deletion Spark/SparkImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ POP_WARNING()
NotificationSink _sink;
};

SERVICE_REGISTRATION(SparkImplementation, 1, 0);
SERVICE_REGISTRATION(SparkImplementation, 1, 0)

} /* namespace Plugin */

Expand Down
2 changes: 1 addition & 1 deletion Streamer/StreamerImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace WPEFramework {

namespace Plugin {

SERVICE_REGISTRATION(StreamerImplementation, 1, 0);
SERVICE_REGISTRATION(StreamerImplementation, 1, 0)

/* virtual */ uint32_t StreamerImplementation::Configure(PluginHost::IShell* service)
{
Expand Down
2 changes: 1 addition & 1 deletion Svalbard/CryptographyRPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,6 @@ namespace Plugin {
ExternalAccess* _rpcLink;
};

SERVICE_REGISTRATION(CryptographyImplementation, 1, 0);
SERVICE_REGISTRATION(CryptographyImplementation, 1, 0)
}
} /* namespace WPEFramework::Plugin */
2 changes: 1 addition & 1 deletion VolumeControl/VolumeControlImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(VolumeControlImplementation, 1, 0);
SERVICE_REGISTRATION(VolumeControlImplementation, 1, 0)

VolumeControlImplementation::VolumeControlImplementation()
: _adminLock{}
Expand Down
2 changes: 1 addition & 1 deletion WebPA/Clients/CCSP/CCSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class CCSP :
// The essence of making the IWebPAClient interface available. This instantiates
// an object that can be created from the outside of the library by looking
// for the CCSP class name, that realizes the IStateControl interface.
SERVICE_REGISTRATION(CCSP, 1, 0);
SERVICE_REGISTRATION(CCSP, 1, 0)

uint32_t CCSP::Worker()
{
Expand Down
2 changes: 1 addition & 1 deletion WebPA/Clients/GenericAdapter/Implementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class GenericAdapter : public Exchange::IWebPA::IWebPAClient, public Core::Threa
// The essence of making the IWebPAClient interface available. This instantiates
// an object that can be created from the outside of the library by looking
// for the GenericAdapter class name, that realizes the IStateControl interface.
SERVICE_REGISTRATION(GenericAdapter, 1, 0);
SERVICE_REGISTRATION(GenericAdapter, 1, 0)

uint32_t GenericAdapter::ConnectToParodus()
{
Expand Down
2 changes: 1 addition & 1 deletion WebPA/WebPAImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,6 @@ class WebPAImplementation :
// The essence of making the IWebPAService interface available. This instantiates
// an object that can be created from the outside of the library by looking
// for the WebPAImplementation class name, that realizes the IStateControl interface.
SERVICE_REGISTRATION(WebPAImplementation, 1, 0);
SERVICE_REGISTRATION(WebPAImplementation, 1, 0)

}
2 changes: 1 addition & 1 deletion WebServer/WebServerImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ POP_WARNING()
std::list<PluginHost::IStateControl::INotification*> _observers;
};

SERVICE_REGISTRATION(WebServerImplementation, 1, 0);
SERVICE_REGISTRATION(WebServerImplementation, 1, 0)

/* virtual */ void WebServerImplementation::IncomingChannel::Received(Core::ProxyType<Web::Request>& request)
{
Expand Down
2 changes: 1 addition & 1 deletion WifiControl/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ENUM_CONVERSION_BEGIN(WPASupplicant::Controller::events)
{ WPASupplicant::Controller::WPS_EVENT_FAIL, _TXT("WPS-FAIL") },
{ WPASupplicant::Controller::AP_ENABLED, _TXT("AP-ENABLED") },

ENUM_CONVERSION_END(WPASupplicant::Controller::events);
ENUM_CONVERSION_END(WPASupplicant::Controller::events)

namespace WPASupplicant {

Expand Down
6 changes: 3 additions & 3 deletions WifiControl/Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ENUM_CONVERSION_BEGIN(WPASupplicant::Network::key)
{ WPASupplicant::Network::KEY_WPS_PBC, _TXT("PBC") },
{ WPASupplicant::Network::KEY_WPS_PIN, _TXT("PIN") },

ENUM_CONVERSION_END(WPASupplicant::Network::key);
ENUM_CONVERSION_END(WPASupplicant::Network::key)

ENUM_CONVERSION_BEGIN(WPASupplicant::Network::pair)

Expand All @@ -47,14 +47,14 @@ ENUM_CONVERSION_BEGIN(WPASupplicant::Network::pair)
{ WPASupplicant::Network::PAIR_ESS, _TXT("ESS") },
{ WPASupplicant::Network::PAIR_WPS, _TXT("WPS") },

ENUM_CONVERSION_END(WPASupplicant::Network::pair);
ENUM_CONVERSION_END(WPASupplicant::Network::pair)

ENUM_CONVERSION_BEGIN(WPASupplicant::Network::mode)

{ WPASupplicant::Network::MODE_STATION, _TXT("station") },
{ WPASupplicant::Network::MODE_AP, _TXT("AP") },

ENUM_CONVERSION_END(WPASupplicant::Network::mode);
ENUM_CONVERSION_END(WPASupplicant::Network::mode)

namespace WPASupplicant {

Expand Down
2 changes: 1 addition & 1 deletion WifiControl/WifiControlImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,6 @@ namespace Plugin
Core::WorkerPool::JobType<WifiControlImplementation&> _job;
};

SERVICE_REGISTRATION(WifiControlImplementation, 1, 0);
SERVICE_REGISTRATION(WifiControlImplementation, 1, 0)
} // namespace Plugin
} // namespace WPEFramework
2 changes: 1 addition & 1 deletion examples/DynamicLoading/Yang/YangImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ namespace Plugin {
uint8_t _balance;
}; // class YangImplementation

SERVICE_REGISTRATION(YangImplementation, 1, 0);
SERVICE_REGISTRATION(YangImplementation, 1, 0)

} // namespace Plugin

Expand Down
2 changes: 1 addition & 1 deletion examples/DynamicLoading/Yin/YinImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ namespace Plugin {
uint8_t _balance;
}; // class YinImplementation

SERVICE_REGISTRATION(YinImplementation, 1, 0);
SERVICE_REGISTRATION(YinImplementation, 1, 0)

} // namespace Plugin

Expand Down
2 changes: 1 addition & 1 deletion examples/JSONRPCPlugin/JSONRPCPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Plugin
return (method != _T("checkvalidation") ? PluginHost::JSONRPC::classification::VALID : PluginHost::JSONRPC::classification::INVALID);
}

SERVICE_REGISTRATION(JSONRPCPlugin, 1, 0);
SERVICE_REGISTRATION(JSONRPCPlugin, 1, 0)

PUSH_WARNING(DISABLE_WARNING_THIS_IN_MEMBER_INITIALIZER_LIST)
JSONRPCPlugin::JSONRPCPlugin()
Expand Down
2 changes: 1 addition & 1 deletion examples/OutOfProcessPlugin/OutOfProcessImplementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ POP_WARNING()
Core::WorkerPool::JobType<OutOfProcessImplementation&> _job;
};

SERVICE_REGISTRATION(OutOfProcessImplementation, 1, 0);
SERVICE_REGISTRATION(OutOfProcessImplementation, 1, 0)

} // namespace Plugin

Expand Down
2 changes: 1 addition & 1 deletion examples/RemoteHostExample/RemoteHostExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(RemoteHostExample, 1, 0);
SERVICE_REGISTRATION(RemoteHostExample, 1, 0)

const string RemoteHostExample::Initialize(PluginHost::IShell* service)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/RemoteHostExample/RemoteHostExampleImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ namespace Exchange {
}


SERVICE_REGISTRATION(RemoteHostExampleImpl, 1, 0);
SERVICE_REGISTRATION(RemoteHostExampleImpl, 1, 0)
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace WPEFramework {

namespace Plugin {

SERVICE_REGISTRATION(SimpleCOMRPCPluginServer, 1, 0);
SERVICE_REGISTRATION(SimpleCOMRPCPluginServer, 1, 0)

//IPlugin
const string SimpleCOMRPCPluginServer::Initialize(PluginHost::IShell* service) /* override */
Expand Down
2 changes: 1 addition & 1 deletion examples/StateController/StateController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
namespace WPEFramework {
namespace Plugin {

SERVICE_REGISTRATION(StateController, 1, 0);
SERVICE_REGISTRATION(StateController, 1, 0)

/* virtual */ const string StateController::Initialize(PluginHost::IShell* service)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/TestController/TestController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace TestController {
} // namespace TestController

namespace Plugin {
SERVICE_REGISTRATION(TestController, 1, 0);
SERVICE_REGISTRATION(TestController, 1, 0)

/* virtual */ const string TestController::Initialize(PluginHost::IShell* service)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/TestController/TestControllerImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ namespace TestCore {
private:
};

SERVICE_REGISTRATION(TestControllerImp, 1, 0);
SERVICE_REGISTRATION(TestControllerImp, 1, 0)
} // namespace TestCore
} // namespace WPEFramewor
2 changes: 1 addition & 1 deletion examples/TestUtility/TestUtility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace TestUtility {
} // namespace TestUtility

namespace Plugin {
SERVICE_REGISTRATION(TestUtility, 1, 0);
SERVICE_REGISTRATION(TestUtility, 1, 0)

/* virtual */ const string TestUtility::Initialize(PluginHost::IShell* service)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/TestUtility/TestUtilityImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ namespace TestCore {
uint32_t _shutdownTimeout;
};

SERVICE_REGISTRATION(TestUtilityImp, 1, 0);
SERVICE_REGISTRATION(TestUtilityImp, 1, 0)
} // namespace TestCore
} // namespace WPEFramewor

0 comments on commit 9df488f

Please sign in to comment.