Fixed code style

Revert "Moved note into either warning or info #4745"

This reverts
commit d3a4ce1f11.

Revert "Changed note to notify #4745"

This reverts commit
5006adedfe.

Conflicts:
	src/test/unittests/ipc/IpcLogOutputterTests.cpp

Shortened transmission log #4858

Revert "Added code to throw an error if the plugin can't be deleted or
written to #4696"

This reverts commit
5696497bc0.
This commit is contained in:
Jerry (Xinyu Hou) 2015-07-08 15:46:13 -07:00
parent 41c03b8f37
commit 9483fecc42
8 changed files with 34 additions and 22 deletions

View File

@ -228,8 +228,11 @@ void
ArchMiscWindows::setValue(HKEY key, ArchMiscWindows::setValue(HKEY key,
const TCHAR* name, const std::string& value) const TCHAR* name, const std::string& value)
{ {
assert(key != NULL); assert(key != NULL);
if(key ==NULL) return; // TODO: throw exception if (key == NULL) {
// TODO: throw exception
return;
}
RegSetValueEx(key, name, 0, REG_SZ, RegSetValueEx(key, name, 0, REG_SZ,
reinterpret_cast<const BYTE*>(value.c_str()), reinterpret_cast<const BYTE*>(value.c_str()),
(DWORD)value.size() + 1); (DWORD)value.size() + 1);
@ -238,8 +241,11 @@ ArchMiscWindows::setValue(HKEY key,
void void
ArchMiscWindows::setValue(HKEY key, const TCHAR* name, DWORD value) ArchMiscWindows::setValue(HKEY key, const TCHAR* name, DWORD value)
{ {
assert(key != NULL); assert(key != NULL);
if(key ==NULL) return; // TODO: throw exception if (key == NULL) {
// TODO: throw exception
return;
}
RegSetValueEx(key, name, 0, REG_DWORD, RegSetValueEx(key, name, 0, REG_DWORD,
reinterpret_cast<CONST BYTE*>(&value), reinterpret_cast<CONST BYTE*>(&value),
sizeof(DWORD)); sizeof(DWORD));
@ -251,7 +257,10 @@ ArchMiscWindows::setValueBinary(HKEY key,
{ {
assert(key != NULL); assert(key != NULL);
assert(name != NULL); assert(name != NULL);
if(key ==NULL || name==NULL) return; // TODO: throw exception if (key == NULL || name == NULL) {
// TODO: throw exception
return;
}
RegSetValueEx(key, name, 0, REG_BINARY, RegSetValueEx(key, name, 0, REG_BINARY,
reinterpret_cast<const BYTE*>(value.data()), reinterpret_cast<const BYTE*>(value.data()),
(DWORD)value.size()); (DWORD)value.size());

View File

@ -61,16 +61,19 @@ ArchSystemWindows::getOSName() const
case VER_PLATFORM_WIN32_NT: case VER_PLATFORM_WIN32_NT:
#if WINVER >= _WIN32_WINNT_WIN2K #if WINVER >= _WIN32_WINNT_WIN2K
if (info.dwMajorVersion == 6) { if (info.dwMajorVersion == 6) {
if(info.dwMinorVersion == 0) { if (info.dwMinorVersion == 0) {
if (info.wProductType == VER_NT_WORKSTATION) { if (info.wProductType == VER_NT_WORKSTATION) {
return "Microsoft Windows Vista"; return "Microsoft Windows Vista";
} else { }
else {
return "Microsoft Windows Server 2008"; return "Microsoft Windows Server 2008";
} }
} else if(info.dwMinorVersion == 1) { }
else if (info.dwMinorVersion == 1) {
if (info.wProductType == VER_NT_WORKSTATION) { if (info.wProductType == VER_NT_WORKSTATION) {
return "Microsoft Windows 7"; return "Microsoft Windows 7";
} else { }
else {
return "Microsoft Windows Server 2008 R2"; return "Microsoft Windows Server 2008 R2";
} }
} }
@ -102,7 +105,7 @@ std::string
ArchSystemWindows::getPlatformName() const ArchSystemWindows::getPlatformName() const
{ {
#ifdef _X86_ #ifdef _X86_
if(isWOW64()) if (isWOW64())
return "x86 (WOW64)"; return "x86 (WOW64)";
else else
return "x86"; return "x86";
@ -146,7 +149,7 @@ ArchSystemWindows::isWOW64() const
(LPFN_ISWOW64PROCESS) GetProcAddress(hModule, "IsWow64Process"); (LPFN_ISWOW64PROCESS) GetProcAddress(hModule, "IsWow64Process");
BOOL bIsWow64 = FALSE; BOOL bIsWow64 = FALSE;
if(NULL != fnIsWow64Process && if (NULL != fnIsWow64Process &&
fnIsWow64Process(GetCurrentProcess(), &bIsWow64) && fnIsWow64Process(GetCurrentProcess(), &bIsWow64) &&
bIsWow64) bIsWow64)
{ {

View File

@ -566,7 +566,7 @@ EventQueue::waitForReady() const
Lock lock(m_readyMutex); Lock lock(m_readyMutex);
while (!m_readyCondVar->wait()) { while (!m_readyCondVar->wait()) {
if(ARCH->time() > timeout) { if (ARCH->time() > timeout) {
throw std::runtime_error("event queue is not ready within 5 sec"); throw std::runtime_error("event queue is not ready within 5 sec");
} }
} }

View File

@ -116,8 +116,8 @@ getDropData(IDataObject* dataObject)
STGMEDIUM stgMed; STGMEDIUM stgMed;
// See if the dataobject contains any DROP stored as a HGLOBAL // See if the dataobject contains any DROP stored as a HGLOBAL
if(dataObject->QueryGetData(&fmtEtc) == S_OK) { if (dataObject->QueryGetData(&fmtEtc) == S_OK) {
if(dataObject->GetData(&fmtEtc, &stgMed) == S_OK) { if (dataObject->GetData(&fmtEtc, &stgMed) == S_OK) {
// get data here // get data here
PVOID data = GlobalLock(stgMed.hGlobal); PVOID data = GlobalLock(stgMed.hGlobal);

View File

@ -310,7 +310,7 @@ MSWindowsScreen::enter()
// and that the screen is not in powersave mode. // and that the screen is not in powersave mode.
ArchMiscWindows::wakeupDisplay(); ArchMiscWindows::wakeupDisplay();
if(m_screensaver != NULL && m_screensaverActive) if (m_screensaver != NULL && m_screensaverActive)
{ {
m_screensaver->deactivate(); m_screensaver->deactivate();
m_screensaverActive = 0; m_screensaverActive = 0;
@ -923,7 +923,7 @@ void
MSWindowsScreen::sendClipboardEvent(Event::Type type, ClipboardID id) MSWindowsScreen::sendClipboardEvent(Event::Type type, ClipboardID id)
{ {
ClipboardInfo* info = (ClipboardInfo*)malloc(sizeof(ClipboardInfo)); ClipboardInfo* info = (ClipboardInfo*)malloc(sizeof(ClipboardInfo));
if(info == NULL) { if (info == NULL) {
LOG((CLOG_ERR "malloc failed on %s:%s", __FILE__, __LINE__ )); LOG((CLOG_ERR "malloc failed on %s:%s", __FILE__, __LINE__ ));
return; return;
} }

View File

@ -105,7 +105,7 @@ invoke(const char* command, void** args)
g_secureListenSocket = NULL; g_secureListenSocket = NULL;
} }
} }
else if(strcmp(command, "version") == 0) { else if (strcmp(command, "version") == 0) {
return (void*) kSynergyVers; return (void*) kSynergyVers;
} }

View File

@ -151,8 +151,8 @@ ClientListener::handleClientConnecting(const Event&, void*)
if (m_useSecureNetwork) { if (m_useSecureNetwork) {
LOG((CLOG_DEBUG2 "attempting sercure Connection")); LOG((CLOG_DEBUG2 "attempting sercure Connection"));
while(!socket->isReady()) { while (!socket->isReady()) {
if(socket->isFatal()) { if (socket->isFatal()) {
m_listen->deleteSocket(socket); m_listen->deleteSocket(socket);
return; return;
} }

View File

@ -334,7 +334,7 @@ doKeyboardHookHandler(WPARAM wParam, LPARAM lParam)
// map the key event to a character. we have to put the dead // map the key event to a character. we have to put the dead
// key back first and this has the side effect of removing it. // key back first and this has the side effect of removing it.
if (g_deadVirtKey != 0) { if (g_deadVirtKey != 0) {
if(ToAscii((UINT)g_deadVirtKey, (g_deadLParam & 0x10ff0000u) >> 16, if (ToAscii((UINT)g_deadVirtKey, (g_deadLParam & 0x10ff0000u) >> 16,
g_deadKeyState, &c, flags) == 2) g_deadKeyState, &c, flags) == 2)
{ {
// If ToAscii returned 2, it means that we accidentally removed // If ToAscii returned 2, it means that we accidentally removed
@ -366,7 +366,7 @@ doKeyboardHookHandler(WPARAM wParam, LPARAM lParam)
PostThreadMessage(g_threadID, SYNERGY_MSG_DEBUG, PostThreadMessage(g_threadID, SYNERGY_MSG_DEBUG,
wParam | 0x05000000, lParam); wParam | 0x05000000, lParam);
if (g_deadVirtKey != 0) { if (g_deadVirtKey != 0) {
if(ToAscii((UINT)g_deadVirtKey, (g_deadLParam & 0x10ff0000u) >> 16, if (ToAscii((UINT)g_deadVirtKey, (g_deadLParam & 0x10ff0000u) >> 16,
g_deadKeyState, &c, flags) == 2) g_deadKeyState, &c, flags) == 2)
{ {
ToAscii((UINT)g_deadVirtKey, (g_deadLParam & 0x10ff0000u) >> 16, ToAscii((UINT)g_deadVirtKey, (g_deadLParam & 0x10ff0000u) >> 16,
@ -397,7 +397,7 @@ doKeyboardHookHandler(WPARAM wParam, LPARAM lParam)
default: default:
// key is a dead key // key is a dead key
if(lParam & 0x80000000u) if (lParam & 0x80000000u)
// This handles the obscure situation where a key has been // This handles the obscure situation where a key has been
// pressed which is both a dead key and a normal character // pressed which is both a dead key and a normal character
// depending on which modifiers have been pressed. We // depending on which modifiers have been pressed. We