Fixed more compilation warnings.

This commit is contained in:
Gunnar Beutner 2012-05-10 13:46:04 +02:00
parent 0c8932d2d9
commit 1ec7c223d4
22 changed files with 52 additions and 46 deletions

View File

@ -226,11 +226,15 @@ Component::Ptr Application::LoadComponent(const string& path,
throw ComponentLoadException("Could not load module");
#ifdef _WIN32
pCreateComponent = (CreateComponentFunction)GetProcAddress(hModule,
"CreateComponent");
pCreateComponent = reinterpret_cast<CreateComponentFunction>(GetProcAddress(hModule,
"CreateComponent"));
#else /* _WIN32 */
pCreateComponent = (CreateComponentFunction)lt_dlsym(hModule,
"CreateComponent");
# ifdef __GNUC__
/* suppress compiler warning for void * cast */
__extension__
# endif
pCreateComponent = reinterpret_cast<CreateComponentFunction>(lt_dlsym(hModule,
"CreateComponent"));
#endif /* _WIN32 */
if (pCreateComponent == NULL)

View File

@ -105,9 +105,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_WINDLL;I2_BASE_BUILD;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -120,7 +120,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -128,6 +127,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_WINDLL;I2_BASE_BUILD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -24,6 +24,7 @@
# define HAVE_CXX11
# pragma warning(disable:4251)
# define _CRT_SECURE_NO_DEPRECATE
# define _CRT_SECURE_NO_WARNINGS
#else /* _MSC_VER */
# include "config.h"
#endif /* _MSC_VER */

View File

@ -170,10 +170,10 @@ void Socket::HandleSocketError(void)
*
* Processes errors that have occured for the socket.
*
* @param ea Event arguments for the socket error.
* @param - Event arguments for the socket error.
* @returns 0
*/
int Socket::ExceptionEventHandler(const EventArgs& ea)
int Socket::ExceptionEventHandler(const EventArgs&)
{
HandleSocketError();

View File

@ -146,10 +146,10 @@ FIFO::Ptr TCPClient::GetRecvQueue(void)
*
* Processes data that is available for this socket.
*
* @param ea Event arguments.
* @param - Event arguments.
* @returns 0
*/
int TCPClient::ReadableEventHandler(const EventArgs& ea)
int TCPClient::ReadableEventHandler(const EventArgs&)
{
int rc;
@ -183,10 +183,10 @@ int TCPClient::ReadableEventHandler(const EventArgs& ea)
*
* Processes data that can be written for this socket.
*
* @param ea Event arguments.
* @param - Event arguments.
* @returns 0
*/
int TCPClient::WritableEventHandler(const EventArgs& ea)
int TCPClient::WritableEventHandler(const EventArgs&)
{
int rc;

View File

@ -88,10 +88,10 @@ void TCPServer::Listen(void)
* Accepts a new client and creates a new client object for it
* using the client factory function.
*
* @param ea Event arguments.
* @param - Event arguments.
* @returns 0
*/
int TCPServer::ReadableEventHandler(const EventArgs& ea)
int TCPServer::ReadableEventHandler(const EventArgs&)
{
int fd;
sockaddr_storage addr;

View File

@ -57,13 +57,16 @@ static void *ThreadStartProc(void *param)
* Constructor for the thread class. Creates a new thread that begins
* executing immediately.
*/
Thread::Thread(ThreadProc callback)
Thread::Thread(ThreadProc callback, void *param)
{
threadparam_t *tparam = new threadparam_t();
if (tparam == NULL)
throw OutOfMemoryException("Out of memory");
tparam->callback = callback;
tparam->param = param;
#ifdef _WIN32
m_Thread = CreateThread(NULL, 0, ThreadStartProc, tparam, CREATE_SUSPENDED, NULL);

View File

@ -40,7 +40,7 @@ private:
#endif
public:
Thread(ThreadProc callback);
Thread(ThreadProc callback, void *param);
~Thread(void);
void Join(void);

View File

@ -118,10 +118,10 @@ void TLSClient::Start(void)
*
* Processes data that is available for this socket.
*
* @param ea Event arguments.
* @param - Event arguments.
* @returns 0
*/
int TLSClient::ReadableEventHandler(const EventArgs& ea)
int TLSClient::ReadableEventHandler(const EventArgs&)
{
int rc;
@ -164,10 +164,10 @@ int TLSClient::ReadableEventHandler(const EventArgs& ea)
*
* Processes data that can be written for this socket.
*
* @param ea Event arguments.
* @param - Event arguments.
* @returns 0
*/
int TLSClient::WritableEventHandler(const EventArgs& ea)
int TLSClient::WritableEventHandler(const EventArgs&)
{
int rc;

View File

@ -48,9 +48,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -59,7 +59,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -67,6 +66,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -56,9 +56,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -72,7 +72,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -80,6 +79,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -58,9 +58,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CONFIGCOMPONENT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -70,7 +70,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -78,6 +77,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;CONFIGCOMPONENT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -51,9 +51,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DEMO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -63,13 +63,13 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DEMO_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -74,10 +74,10 @@ void DemoComponent::Stop(void)
*
* Periodically sends a demo::HelloWorld message.
*
* @param tea Event arguments for the timer.
* @param - Event arguments for the timer.
* @returns 0
*/
int DemoComponent::DemoTimerHandler(const TimerEventArgs& tea)
int DemoComponent::DemoTimerHandler(const TimerEventArgs&)
{
Application::Log("Sending multicast 'hello world' message.");

View File

@ -51,9 +51,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;DISCOVERY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -63,13 +63,13 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;DISCOVERY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -55,9 +55,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;I2_ICINGALAUNCHER_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -67,7 +67,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -75,6 +74,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;I2_ICINGALAUNCHER_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

View File

@ -69,9 +69,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;I2_ICINGA_BUILD;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
@ -81,7 +81,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -89,6 +88,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;I2_ICINGA_BUILD;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>

View File

@ -167,11 +167,9 @@ int IcingaApplication::NewIcingaConfigHandler(const EventArgs& ea)
return 0;
}
int IcingaApplication::DeletedIcingaConfigHandler(const EventArgs& ea)
int IcingaApplication::DeletedIcingaConfigHandler(const EventArgs&)
{
throw Exception("Unsupported operation.");
return 0;
}
void IcingaApplication::SetPrivateKeyFile(string privkey)

View File

@ -108,7 +108,7 @@ int JsonRpcEndpoint::NewMessageHandler(const NewMessageEventArgs& nmea)
return 0;
}
int JsonRpcEndpoint::ClientClosedHandler(const EventArgs& ea)
int JsonRpcEndpoint::ClientClosedHandler(const EventArgs&)
{
Application::Log("Lost connection to endpoint: identity=" + GetIdentity());

View File

@ -66,9 +66,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;I2_JSONRPC_BUILD;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -82,7 +82,6 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
@ -90,6 +89,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;I2_JSONRPC_BUILD;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -36,9 +36,9 @@ void JsonRpcClient::SendMessage(const Message& message)
Netstring::WriteMessageToFIFO(GetSendQueue(), message);
}
int JsonRpcClient::DataAvailableHandler(const EventArgs& ea)
int JsonRpcClient::DataAvailableHandler(const EventArgs&)
{
while (true) {
for (;;) {
try {
Message message;

View File

@ -48,9 +48,9 @@
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -59,13 +59,13 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>Level3</WarningLevel>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>