From f55abd7b0074bc6db9774ed563e02b11e634aa7d Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 6 Jan 2023 15:31:24 +0100 Subject: Use operator overloading for comparison It is much more natural than custom methods for this very common operation. --- win/rfb_win32/SDisplay.cxx | 4 ++-- win/rfb_win32/SInput.cxx | 2 +- win/rfb_win32/WMCursor.h | 2 +- win/rfb_win32/WMWindowCopyRect.cxx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'win/rfb_win32') diff --git a/win/rfb_win32/SDisplay.cxx b/win/rfb_win32/SDisplay.cxx index 811b1033..612f883b 100644 --- a/win/rfb_win32/SDisplay.cxx +++ b/win/rfb_win32/SDisplay.cxx @@ -468,8 +468,8 @@ SDisplay::recreatePixelBuffer(bool force) { // If nothing has changed & a recreate has not been forced, delete // the new device context and return if (pb && !force && - newScreenRect.equals(screenRect) && - new_device->getPF().equal(pb->getPF())) { + newScreenRect == screenRect && + new_device->getPF() == pb->getPF()) { delete new_device; return; } diff --git a/win/rfb_win32/SInput.cxx b/win/rfb_win32/SInput.cxx index b76060a8..94df6e98 100644 --- a/win/rfb_win32/SInput.cxx +++ b/win/rfb_win32/SInput.cxx @@ -71,7 +71,7 @@ win32::SPointer::pointerEvent(const Point& pos, int buttonmask) DWORD flags = MOUSEEVENTF_ABSOLUTE; // - Has the pointer moved since the last event? - if (!last_position.equals(pos)) + if (last_position != pos) flags |= MOUSEEVENTF_MOVE; // - If the system swaps left and right mouse buttons then we must diff --git a/win/rfb_win32/WMCursor.h b/win/rfb_win32/WMCursor.h index 252cb056..f4366583 100644 --- a/win/rfb_win32/WMCursor.h +++ b/win/rfb_win32/WMCursor.h @@ -43,7 +43,7 @@ namespace rfb { Info() : cursor(0), visible(false) {} bool operator!=(const Info& info) { return ((cursor != info.cursor) || - (!position.equals(info.position)) || + (position != info.position) || (visible != info.visible)); } }; diff --git a/win/rfb_win32/WMWindowCopyRect.cxx b/win/rfb_win32/WMWindowCopyRect.cxx index 7655da84..4d69d54b 100644 --- a/win/rfb_win32/WMWindowCopyRect.cxx +++ b/win/rfb_win32/WMWindowCopyRect.cxx @@ -45,7 +45,7 @@ rfb::win32::WMCopyRect::processEvent() { if (IsWindow(window) && IsWindowVisible(window) && GetWindowRect(window, &wrect)) { Rect winrect(wrect.left, wrect.top, wrect.right, wrect.bottom); if (fg_window == window) { - if (!fg_window_rect.tl.equals(winrect.tl) && ut) { + if (fg_window_rect.tl != winrect.tl && ut) { // Window has moved - mark both the previous and new position as changed // (we can't use add_copied() here because we aren't that properly synced // with the actual state of the framebuffer) -- cgit v1.2.3