]> source.dussan.org Git - tigervnc.git/commitdiff
Avoid some variable aliasing
authorPierre Ossman <ossman@cendio.se>
Mon, 14 Jun 2021 07:43:10 +0000 (09:43 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 14 Jun 2021 07:43:10 +0000 (09:43 +0200)
common/rfb/CSecurity.h
common/rfb/SSecurity.h
unix/xserver/hw/vnc/XserverDesktop.cc

index 2e703c6d30d6d1f174da39f883327ea36877d4f0..12d1829b87a59c2c0aac0016ac93c6b92b1588a9 100644 (file)
@@ -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;
index 8ae7902c3bc40a0a39568303612791b24be06587..cef2027fb7780dd6cf6c60c2b1e07565e43a3ca2 100644 (file)
@@ -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;
index 7ebad353ff0d9c223cbaf4044dc848772a43765a..25dcd845b1fd086e2166b52abb0f313c5d795c71 100644 (file)
@@ -72,7 +72,7 @@ XserverDesktop::XserverDesktop(int screenIndex_,
                                std::list<network::SocketListener*> 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<SocketListener*>::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);
   }
 }