Added "/analyze" flag for compile in order to activate Code Analysis in Visual Studio 2008+. Resolved some of these warnings.

This commit is contained in:
Sorin Sbarnea
2009-12-21 16:52:47 +00:00
parent ba7ec582c3
commit 9face38556
12 changed files with 1419 additions and 1381 deletions

View File

@@ -758,7 +758,8 @@ CMSWindowsDesks::deskThread(void* vdesk)
// a window on the primary screen with low-level hooks
// should never activate.
EnableWindow(desk->m_window, desk->m_lowLevel ? FALSE : TRUE);
if (desk->m_window)
EnableWindow(desk->m_window, desk->m_lowLevel ? FALSE : TRUE);
}
break;

View File

@@ -868,7 +868,10 @@ void
CMSWindowsKeyState::pollPressedKeys(KeyButtonSet& pressedKeys) const
{
BYTE keyState[256];
GetKeyboardState(keyState);
if (!GetKeyboardState(keyState)) {
LOG((CLOG_ERR "GetKeyboardState returned false on pollPressedKeys"));
return;
}
for (KeyButton i = 1; i < 256; ++i) {
if ((keyState[i] & 0x80) != 0) {
pressedKeys.insert(i);

View File

@@ -370,7 +370,7 @@ CMSWindowsScreen::openScreensaver(bool notify)
if (m_screensaverNotify) {
m_desks->installScreensaverHooks(true);
}
else {
else if (m_screensaver) {
m_screensaver->disable();
}
}
@@ -393,6 +393,7 @@ void
CMSWindowsScreen::screensaver(bool activate)
{
assert(m_screensaver != NULL);
if (m_screensaver==NULL) return;
if (activate) {
m_screensaver->activate();
@@ -836,6 +837,10 @@ void
CMSWindowsScreen::sendClipboardEvent(CEvent::Type type, ClipboardID id)
{
CClipboardInfo* info = (CClipboardInfo*)malloc(sizeof(CClipboardInfo));
if(info == NULL) {
LOG((CLOG_ERR "malloc failed on %s:%s", __FILE__, __LINE__ ));
return;
}
info->m_id = id;
info->m_sequenceNumber = m_sequenceNumber;
sendEvent(type, info);