From a29fe72102907f4f770ad9d9a7eef7619226d355 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 14 Jun 2021 09:43:10 +0200 Subject: [PATCH] Avoid some variable aliasing --- common/rfb/CSecurity.h | 2 +- common/rfb/SSecurity.h | 2 +- unix/xserver/hw/vnc/XserverDesktop.cc | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/rfb/CSecurity.h b/common/rfb/CSecurity.h index 2e703c6d..12d1829b 100644 --- a/common/rfb/CSecurity.h +++ b/common/rfb/CSecurity.h @@ -44,7 +44,7 @@ namespace rfb { class CConnection; class CSecurity { public: - CSecurity(CConnection* cc) { this->cc = cc; } + CSecurity(CConnection* cc_) : cc(cc_) {} virtual ~CSecurity() {} virtual bool processMsg() = 0; virtual int getType() const = 0; diff --git a/common/rfb/SSecurity.h b/common/rfb/SSecurity.h index 8ae7902c..cef2027f 100644 --- a/common/rfb/SSecurity.h +++ b/common/rfb/SSecurity.h @@ -52,7 +52,7 @@ namespace rfb { class SSecurity { public: - SSecurity(SConnection* sc) { this->sc = sc; } + SSecurity(SConnection* sc_) : sc(sc_) {} virtual ~SSecurity() {} virtual bool processMsg() = 0; virtual int getType() const = 0; diff --git a/unix/xserver/hw/vnc/XserverDesktop.cc b/unix/xserver/hw/vnc/XserverDesktop.cc index 7ebad353..25dcd845 100644 --- a/unix/xserver/hw/vnc/XserverDesktop.cc +++ b/unix/xserver/hw/vnc/XserverDesktop.cc @@ -72,7 +72,7 @@ XserverDesktop::XserverDesktop(int screenIndex_, std::list listeners_, const char* name, const rfb::PixelFormat &pf, int width, int height, - void* fbptr, int stride) + void* fbptr, int stride_) : screenIndex(screenIndex_), server(0), listeners(listeners_), shadowFramebuffer(NULL), @@ -81,7 +81,7 @@ XserverDesktop::XserverDesktop(int screenIndex_, format = pf; server = new VNCServerST(name, this); - setFramebuffer(width, height, fbptr, stride); + setFramebuffer(width, height, fbptr, stride_); for (std::list::iterator i = listeners.begin(); i != listeners.end(); @@ -196,10 +196,10 @@ void XserverDesktop::announceClipboard(bool available) } } -void XserverDesktop::sendClipboardData(const char* data) +void XserverDesktop::sendClipboardData(const char* data_) { try { - server->sendClipboardData(data); + server->sendClipboardData(data_); } catch (rdr::Exception& e) { vlog.error("XserverDesktop::sendClipboardData: %s",e.str()); } @@ -503,11 +503,11 @@ void XserverDesktop::grabRegion(const rfb::Region& region) region.get_rects(&rects); for (i = rects.begin(); i != rects.end(); i++) { rdr::U8 *buffer; - int stride; + int bufStride; - buffer = getBufferRW(*i, &stride); + buffer = getBufferRW(*i, &bufStride); vncGetScreenImage(screenIndex, i->tl.x, i->tl.y, i->width(), i->height(), - (char*)buffer, stride * format.bpp/8); + (char*)buffer, bufStride * format.bpp/8); commitBufferRW(*i); } } -- 2.39.5