From: Paul Durrant Date: Mon, 1 Aug 2016 14:49:41 +0000 (+0100) Subject: xenagent: enable all warnings X-Git-Tag: 8.2.0-rc1~10 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3c8952ee73e100ddf26559df9c4faaa15a27e66c;p=pvdrivers%2Fwin%2Fxeniface.git xenagent: enable all warnings 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 --- diff --git a/src/xenagent/devicelist.cpp b/src/xenagent/devicelist.cpp index 7053a96..4e86ce2 100644 --- a/src/xenagent/devicelist.cpp +++ b/src/xenagent/devicelist.cpp @@ -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(); diff --git a/src/xenagent/service.cpp b/src/xenagent/service.cpp index 2d06008..d105bc4 100644 --- a/src/xenagent/service.cpp +++ b/src/xenagent/service.cpp @@ -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: diff --git a/src/xenagent/service.h b/src/xenagent/service.h index 77a11d7..ad9821a 100644 --- a/src/xenagent/service.h +++ b/src/xenagent/service.h @@ -54,7 +54,7 @@ public: // statics public: // ctor/dtor CXenAgent(); - ~CXenAgent(); + virtual ~CXenAgent(); public: // IDeviceCreator virtual CDevice* Create(const wchar_t* path); diff --git a/vs2012/xenagent/xenagent.vcxproj b/vs2012/xenagent/xenagent.vcxproj index 67df832..7ae655e 100644 --- a/vs2012/xenagent/xenagent.vcxproj +++ b/vs2012/xenagent/xenagent.vcxproj @@ -29,7 +29,8 @@ $(SolutionDir)..\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MODULE__="XENAGENT";%(PreprocessorDefinitions) - Level3 + EnableAllWarnings + 4127;4350;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings) true true MultiThreadedDebug diff --git a/vs2013/xenagent/xenagent.vcxproj b/vs2013/xenagent/xenagent.vcxproj index fe5761e..a2ad3f8 100644 --- a/vs2013/xenagent/xenagent.vcxproj +++ b/vs2013/xenagent/xenagent.vcxproj @@ -29,7 +29,8 @@ $(SolutionDir)..\include;%(AdditionalIncludeDirectories) WIN32;_WINDOWS;_CRT_SECURE_NO_WARNINGS;__MODULE__="XENAGENT";%(PreprocessorDefinitions) - Level3 + EnableAllWarnings + 4127;4350;4711;4548;4820;4668;4255;6001;6054;28196;%(DisableSpecificWarnings) true true MultiThreadedDebug