diff --git a/src/lib/arch/win32/ArchNetworkWinsock.cpp b/src/lib/arch/win32/ArchNetworkWinsock.cpp index 265924d5..c6f0a179 100644 --- a/src/lib/arch/win32/ArchNetworkWinsock.cpp +++ b/src/lib/arch/win32/ArchNetworkWinsock.cpp @@ -754,7 +754,7 @@ ArchNetworkWinsock::addrToName(ArchNetAddress addr) // name lookup struct hostent* info = gethostbyaddr_winsock( - static_cast(&addr->m_addr), + reinterpret_cast(&addr->m_addr), addr->m_len, addr->m_addr.sa_family); if (info == NULL) { throwNameError(getsockerror_winsock()); @@ -772,7 +772,7 @@ ArchNetworkWinsock::addrToString(ArchNetAddress addr) switch (getAddrFamily(addr)) { case kINET: { struct sockaddr_in* ipAddr = - static_cast(&addr->m_addr); + reinterpret_cast(&addr->m_addr); return inet_ntoa_winsock(ipAddr->sin_addr); } @@ -804,8 +804,8 @@ ArchNetworkWinsock::setAddrPort(ArchNetAddress addr, int port) switch (getAddrFamily(addr)) { case kINET: { struct sockaddr_in* ipAddr = - static_cast(&addr->m_addr); - ipAddr->sin_port = htons_winsock(static_cast(port)); + reinterpret_cast(&addr->m_addr); + ipAddr->sin_port = htons_winsock(reinterpret_cast(port)); break; } @@ -823,7 +823,7 @@ ArchNetworkWinsock::getAddrPort(ArchNetAddress addr) switch (getAddrFamily(addr)) { case kINET: { struct sockaddr_in* ipAddr = - static_cast(&addr->m_addr); + reinterpret_cast(&addr->m_addr); return ntohs_winsock(ipAddr->sin_port); } @@ -841,7 +841,7 @@ ArchNetworkWinsock::isAnyAddr(ArchNetAddress addr) switch (getAddrFamily(addr)) { case kINET: { struct sockaddr_in* ipAddr = - static_cast(&addr->m_addr); + reinterpret_cast(&addr->m_addr); return (addr->m_len == sizeof(struct sockaddr_in) && ipAddr->sin_addr.s_addr == INADDR_ANY); } diff --git a/src/lib/arch/win32/ArchTaskBarWindows.cpp b/src/lib/arch/win32/ArchTaskBarWindows.cpp index eac283a8..7de57de2 100644 --- a/src/lib/arch/win32/ArchTaskBarWindows.cpp +++ b/src/lib/arch/win32/ArchTaskBarWindows.cpp @@ -414,17 +414,16 @@ ArchTaskBarWindows::staticWndProc(HWND hwnd, UINT msg, ArchTaskBarWindows* self = NULL; if (msg == WM_NCCREATE) { CREATESTRUCT* createInfo; - createInfo = static_cast(lParam); + createInfo = reinterpret_cast(lParam); self = static_cast( createInfo->lpCreateParams); - SetWindowLong(hwnd, 0, static_cast(self)); + SetWindowLongPtr(hwnd, 0, self); } else { // get the extra window data and forward the call - LONG data = GetWindowLong(hwnd, 0); + LONG_PTR data = GetWindowLongPtr(hwnd, 0); if (data != 0) { - self = static_cast( - static_cast(data)); + self = static_cast(reinterpret_cast(data)); } } @@ -444,6 +443,7 @@ ArchTaskBarWindows::threadMainLoop() m_taskBarRestart = RegisterWindowMessage(TEXT("TaskbarCreated")); // register a window class + LPCTSTR className = TEXT("SynergyTaskBar"); WNDCLASSEX classInfo; classInfo.cbSize = sizeof(classInfo); classInfo.style = CS_NOCLOSE; @@ -455,13 +455,13 @@ ArchTaskBarWindows::threadMainLoop() classInfo.hCursor = NULL; classInfo.hbrBackground = NULL; classInfo.lpszMenuName = NULL; - classInfo.lpszClassName = TEXT("SynergyTaskBar"); + classInfo.lpszClassName = className; classInfo.hIconSm = NULL; ATOM windowClass = RegisterClassEx(&classInfo); // create window m_hwnd = CreateWindowEx(WS_EX_TOOLWINDOW, - static_cast(windowClass), + className, TEXT("Synergy Task Bar"), WS_POPUP, 0, 0, 1, 1, @@ -478,7 +478,7 @@ ArchTaskBarWindows::threadMainLoop() // handle failure if (m_hwnd == NULL) { - UnregisterClass(static_cast(windowClass), instanceWin32()); + UnregisterClass(className, instanceWin32()); return; } @@ -494,7 +494,7 @@ ArchTaskBarWindows::threadMainLoop() // clean up removeAllIcons(); DestroyWindow(m_hwnd); - UnregisterClass(static_cast(windowClass), instanceWin32()); + UnregisterClass(className, instanceWin32()); } void*