mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-10 00:11:43 +08:00
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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user