]> xenbits.xensource.com Git - people/pauldu/xeniface.git/commitdiff
xenagent: enable all warnings
authorPaul Durrant <paul.durrant@citrix.com>
Mon, 1 Aug 2016 14:49:41 +0000 (15:49 +0100)
committerPaul Durrant <paul.durrant@citrix.com>
Mon, 1 Aug 2016 14:51:18 +0000 (15:51 +0100)
Instead of using warning level 3 (which misses quite a lot), enable all
build warnings and disable only selected warnings that we don't want.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
src/xenagent/devicelist.cpp
src/xenagent/service.cpp
src/xenagent/service.h
vs2012/xenagent/xenagent.vcxproj
vs2013/xenagent/xenagent.vcxproj

index 7053a96a0b5faced2f06b6511a844b92eda974aa..4e86ce2ea4ee67c8921f1dcaf3af016f7c867b40 100644 (file)
@@ -239,6 +239,8 @@ void CDeviceList::OnDeviceEvent(DWORD evt, LPVOID data)
 
 void CDeviceList::OnPowerEvent(DWORD evt, LPVOID data)
 {
+    UNREFERENCED_PARAMETER(data);
+
     switch (evt) {
     case PBT_APMRESUMESUSPEND:
     for (DeviceMap::iterator it = m_devs.begin();
index 2d06008d6e6514b8f4b9785fc00498b955b20f4d..d105bc439846dde81d47e14b6f298a98c72e500a 100644 (file)
@@ -60,10 +60,14 @@ CCritSec::~CCritSec()
 
 int CALLBACK WinMain(
     _In_     HINSTANCE hInstance,
-    _In_opt_ HINSTANCE ignore,
+    _In_opt_ HINSTANCE hPrevious,
     _In_     LPSTR     lpCmdLine,
     _In_     int       nCmdShow)
 {
+    UNREFERENCED_PARAMETER(hInstance);
+    UNREFERENCED_PARAMETER(hPrevious);
+    UNREFERENCED_PARAMETER(nCmdShow);
+
     if (strlen(lpCmdLine) != 0) {
         if (!strcmp(lpCmdLine, "-i") || !strcmp(lpCmdLine, "\"-i\""))
             return CXenAgent::ServiceInstall();
@@ -104,7 +108,7 @@ static CXenAgent s_service;
 
     if (GetModuleFileNameA(NULL, path, MAX_PATH) == 0) {
         CloseServiceHandle(mgr);
-        return GetLastError();
+        return -1;
     }
     path[MAX_PATH] = 0;
 
@@ -166,7 +170,7 @@ static CXenAgent s_service;
 
     if (!StartServiceCtrlDispatcher(ServiceTable)) {
         CXenAgent::Log("Failed to start dispatcher\n");
-        return GetLastError();
+        return -1;
     }
     return 0;
 }
@@ -419,7 +423,7 @@ bool CXenAgent::RegCheckIsUTC(const char* rootpath)
     if (lr != ERROR_SUCCESS)
         goto fail1;
 
-    long size = 32;
+    DWORD size = 32;
     DWORD length;
     char* buffer = NULL;
 
@@ -572,6 +576,9 @@ void CXenAgent::SetServiceStatus(DWORD state, DWORD exit /*= 0*/, DWORD hint /*=
 
 void WINAPI CXenAgent::__ServiceMain(int argc, char** argv)
 {
+    UNREFERENCED_PARAMETER(argc);
+    UNREFERENCED_PARAMETER(argv);
+
     m_handle = RegisterServiceCtrlHandlerEx(SVC_NAME, ServiceControlHandlerEx, NULL);
     if (m_handle == NULL)
         return;
@@ -591,6 +598,8 @@ void WINAPI CXenAgent::__ServiceMain(int argc, char** argv)
 
 DWORD WINAPI CXenAgent::__ServiceControlHandlerEx(DWORD req, DWORD evt, LPVOID data, LPVOID ctxt)
 {
+    UNREFERENCED_PARAMETER(ctxt);
+
     switch (req)
     {
     case SERVICE_CONTROL_STOP:
index 77a11d741ad51a7c3580bc9a8c961967fce4deaa..ad9821a1bb39018dd4b0c208950d1401a0d4c6a1 100644 (file)
@@ -54,7 +54,7 @@ public: // statics
 
 public: // ctor/dtor
     CXenAgent();
-    ~CXenAgent();
+    virtual ~CXenAgent();
 
 public: // IDeviceCreator
     virtual CDevice* Create(const wchar_t* path);
index 67df83236b55b2486b79e600c6a741d0e2b040b5..7ae655ea890fdc67560cedb32c502304fa6131bb 100644 (file)
@@ -29,7 +29,8 @@
     <ClCompile>
       <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MODULE__="XENAGENT";%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>Level3</WarningLevel>
+      <WarningLevel>EnableAllWarnings</WarningLevel>
+      <DisableSpecificWarnings>4127;4350;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <EnablePREfast>true</EnablePREfast>
       <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>
index fe5761e70cf546a0fb37be505d3df69e60060627..a2ad3f8e8eebeb2afd4a4f9e82a471867186a469 100644 (file)
@@ -29,7 +29,8 @@
     <ClCompile>
       <AdditionalIncludeDirectories>$(SolutionDir)..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MODULE__="XENAGENT";%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <WarningLevel>Level3</WarningLevel>
+      <WarningLevel>EnableAllWarnings</WarningLevel>
+      <DisableSpecificWarnings>4127;4350;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings)</DisableSpecificWarnings>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <EnablePREfast>true</EnablePREfast>
       <RuntimeLibrary Condition="'$(UseDebugLibraries)'=='true'">MultiThreadedDebug</RuntimeLibrary>