]> source.dussan.org Git - tigervnc.git/commitdiff
Avoid shadowing variables
authorPierre Ossman <ossman@cendio.se>
Sun, 21 Apr 2024 00:18:22 +0000 (02:18 +0200)
committerPierre Ossman <ossman@cendio.se>
Mon, 24 Jun 2024 12:22:35 +0000 (14:22 +0200)
It's a source of confusion and possibly bugs to reuse the same variable
name for multiple things.

68 files changed:
CMakeLists.txt
common/network/Socket.cxx
common/network/TcpSocket.cxx
common/network/UnixSocket.cxx
common/os/Mutex.cxx
common/rdr/AESInStream.cxx
common/rdr/BufferedOutStream.cxx
common/rdr/Exception.cxx
common/rfb/CConnection.cxx
common/rfb/CMsgReader.cxx
common/rfb/CSecurityDH.cxx
common/rfb/CSecurityMSLogonII.cxx
common/rfb/CSecurityNone.h
common/rfb/CSecurityPlain.h
common/rfb/CSecurityRSAAES.cxx
common/rfb/CSecurityStack.cxx
common/rfb/CSecurityTLS.cxx
common/rfb/CSecurityVeNCrypt.cxx
common/rfb/CSecurityVncAuth.h
common/rfb/Configuration.cxx
common/rfb/Cursor.cxx
common/rfb/DecodeManager.cxx
common/rfb/Decoder.cxx
common/rfb/H264Decoder.cxx
common/rfb/H264WinDecoderContext.cxx
common/rfb/HextileDecoder.cxx
common/rfb/HextileEncoder.cxx
common/rfb/RREEncoder.cxx
common/rfb/RawEncoder.cxx
common/rfb/SConnection.cxx
common/rfb/SSecurityNone.h
common/rfb/SSecurityPlain.cxx
common/rfb/SSecurityRSAAES.cxx
common/rfb/SSecurityStack.cxx
common/rfb/SSecurityTLS.cxx
common/rfb/SSecurityVeNCrypt.cxx
common/rfb/SSecurityVncAuth.cxx
common/rfb/TightEncoder.cxx
common/rfb/TightJPEGEncoder.cxx
common/rfb/VNCServerST.cxx
common/rfb/ZRLEEncoder.cxx
tests/perf/encperf.cxx
tests/unit/pixelformat.cxx
unix/tx/TXDialog.h
unix/vncconfig/QueryConnectDialog.cxx
unix/vncconfig/vncconfig.cxx
vncviewer/DesktopWindow.cxx
vncviewer/MonitorIndicesParameter.cxx
vncviewer/MonitorIndicesParameter.h
vncviewer/OptionsDialog.cxx
vncviewer/ServerDialog.cxx
vncviewer/Surface.h
vncviewer/Surface_OSX.cxx
vncviewer/Surface_Win32.cxx
vncviewer/Surface_X11.cxx
vncviewer/UserDialog.cxx
vncviewer/Viewport.cxx
vncviewer/Win32TouchHandler.cxx
vncviewer/XInputTouchHandler.cxx
vncviewer/vncviewer.cxx
win/rfb_win32/DeviceFrameBuffer.cxx
win/rfb_win32/Dialog.cxx
win/rfb_win32/Registry.cxx
win/rfb_win32/Service.cxx
win/rfb_win32/SocketManager.cxx
win/vncconfig/vncconfig.cxx
win/winvnc/VNCServerWin32.cxx
win/wm_hooks/wm_hooks.cxx

index 9f798cca0debf920ffa1a52ae53029643c3ac45d..526c7f135f0e659765e90f01fb8522eacffcfeea 100644 (file)
@@ -10,6 +10,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
 include(CheckIncludeFiles)
 include(CheckFunctionExists)
 include(CheckLibraryExists)
+include(CheckVariableExists)
 include(CheckTypeSize)
 include(CheckCSourceCompiles)
 include(CheckCXXSourceCompiles)
@@ -185,6 +186,13 @@ if(ENABLE_H264)
     add_definitions("-DHAVE_H264")
     set(H264_LIBS "WIN")  # may be LIBAV in the future
     set(H264_LIBRARIES ole32 mfplat mfuuid wmcodecdspuuid)
+
+    set(CMAKE_REQUIRED_LIBRARIES ${H264_LIBRARIES})
+    check_variable_exists(CLSID_VideoProcessorMFT HAVE_VIDEO_PROCESSOR_MFT)
+    set(CMAKE_REQUIRED_LIBRARIES)
+    if(HAVE_VIDEO_PROCESSOR_MFT)
+      add_definitions("-DHAVE_VIDEO_PROCESSOR_MFT")
+    endif()
   else()
     find_package(Ffmpeg)
     if (AVCODEC_FOUND AND AVUTIL_FOUND AND SWSCALE_FOUND)
index 971a7170fb960716c67935b7220f94c97ab23a54..8da44366766e8a39bc5e0bb86652820ec867d16f 100644 (file)
@@ -128,8 +128,8 @@ void Socket::setFd(int fd)
   isShutdown_ = false;
 }
 
-SocketListener::SocketListener(int fd)
-  : fd(fd), filter(nullptr)
+SocketListener::SocketListener(int fd_)
+  : fd(fd_), filter(nullptr)
 {
   initSockets();
 }
index d9b376c9a4f604b9461b9408211cd0cc1ae7fe94..3f2f0f1fdc9f2fdc6ffd5076f0930a65dc411cec 100644 (file)
@@ -338,8 +338,8 @@ TcpListener::TcpListener(const struct sockaddr *listenaddr,
   listen(sock);
 }
 
-Socket* TcpListener::createSocket(int fd) {
-  return new TcpSocket(fd);
+Socket* TcpListener::createSocket(int fd_) {
+  return new TcpSocket(fd_);
 }
 
 std::list<std::string> TcpListener::getMyAddresses() {
index e7793849682ba00ce449faef83ee2cb92d90888f..3a422b6c211a5189e5ddd8e1533c41182b3623dc 100644 (file)
@@ -157,8 +157,8 @@ UnixListener::~UnixListener()
     unlink(addr.sun_path);
 }
 
-Socket* UnixListener::createSocket(int fd) {
-  return new UnixSocket(fd);
+Socket* UnixListener::createSocket(int fd_) {
+  return new UnixSocket(fd_);
 }
 
 int UnixListener::getMyPort() {
index 5e245a6d7649efb5c52dee6d5833f165e6a5e29b..2a768b4c886bbecf86082ea5b391356bf3a93c53 100644 (file)
@@ -84,9 +84,9 @@ void Mutex::unlock()
 #endif
 }
 
-Condition::Condition(Mutex* mutex)
+Condition::Condition(Mutex* mutex_)
 {
-  this->mutex = mutex;
+  this->mutex = mutex_;
 
 #ifdef WIN32
   systemCondition = new CONDITION_VARIABLE;
index de91a3dfa98372954f59d5bda44b0ad9218cdbdc..d6d944a33012cf8728b12bcd896414fe8ede1ba4 100644 (file)
@@ -45,15 +45,15 @@ bool AESInStream::fillBuffer()
 {
   if (!in->hasData(2))
     return false;
-  const uint8_t* ptr = in->getptr(2);
-  size_t length = ((int)ptr[0] << 8) | (int)ptr[1];
+  const uint8_t* buf = in->getptr(2);
+  size_t length = ((int)buf[0] << 8) | (int)buf[1];
   if (!in->hasData(2 + length + 16))
     return false;
   ensureSpace(length);
-  ptr = in->getptr(2 + length + 16);
-  const uint8_t* ad = ptr;
-  const uint8_t* data = ptr + 2;
-  const uint8_t* mac = ptr + 2 + length;
+  buf = in->getptr(2 + length + 16);
+  const uint8_t* ad = buf;
+  const uint8_t* data = buf + 2;
+  const uint8_t* mac = buf + 2 + length;
   uint8_t macComputed[16];
 
   if (keySize == 128) {
index 0ee3d644536b25fee79a2e94e858f1b5d5758be0..0d6a1eb6b084d0e998010f36751824f64473334e 100644 (file)
@@ -31,8 +31,8 @@ using namespace rdr;
 static const size_t DEFAULT_BUF_SIZE = 16384;
 static const size_t MAX_BUF_SIZE = 32 * 1024 * 1024;
 
-BufferedOutStream::BufferedOutStream(bool emulateCork)
-  : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork)
+BufferedOutStream::BufferedOutStream(bool emulateCork_)
+  : bufSize(DEFAULT_BUF_SIZE), offset(0), emulateCork(emulateCork_)
 {
   ptr = start = sentUpTo = new uint8_t[bufSize];
   end = start + bufSize;
index f5ad1819717146ef272ab81074fee8ac059e9e74..d5546274929564b14666fc21f1a90a0883f492cf 100644 (file)
@@ -51,8 +51,8 @@ Exception::Exception(const char *format, ...) {
        va_end(ap);
 }
 
-GAIException::GAIException(const char* s, int err)
-  : Exception("%s", s)
+GAIException::GAIException(const char* s, int err_)
+  : Exception("%s", s), err(err_)
 {
   strncat(str_, ": ", len-1-strlen(str_));
 #ifdef _WIN32
index 212671aa85a0761a7a9bca831cc2494a6b2560e8..0db5f4c8a7724ee313c5e3f194b04633f780c90a 100644 (file)
@@ -675,7 +675,7 @@ void CConnection::sendClipboardData(const char* data)
     // FIXME: This conversion magic should be in CMsgWriter
     std::string filtered(convertCRLF(data));
     size_t sizes[1] = { filtered.size() + 1 };
-    const uint8_t* data[1] = { (const uint8_t*)filtered.c_str() };
+    const uint8_t* datas[1] = { (const uint8_t*)filtered.c_str() };
 
     if (unsolicitedClipboardAttempt) {
       unsolicitedClipboardAttempt = false;
@@ -687,7 +687,7 @@ void CConnection::sendClipboardData(const char* data)
       }
     }
 
-    writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, data);
+    writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, datas);
   } else {
     writer()->writeClientCutText(data);
   }
index c10b7033aa79a17a98186021f5f765613c592c58..8bcdbfd04e2fa06ffbe2c8ad4a9a9bc69f6f1ff3 100644 (file)
@@ -827,31 +827,31 @@ bool CMsgReader::readExtendedDesktopSize(int x, int y, int w, int h)
 
 bool CMsgReader::readLEDState()
 {
-  uint8_t state;
+  uint8_t ledState;
 
   if (!is->hasData(1))
     return false;
 
-  state = is->readU8();
+  ledState = is->readU8();
 
-  handler->setLEDState(state);
+  handler->setLEDState(ledState);
 
   return true;
 }
 
 bool CMsgReader::readVMwareLEDState()
 {
-  uint32_t state;
+  uint32_t ledState;
 
   if (!is->hasData(4))
     return false;
 
-  state = is->readU32();
+  ledState = is->readU32();
 
   // As luck has it, this extension uses the same bit definitions,
   // so no conversion required
 
-  handler->setLEDState(state);
+  handler->setLEDState(ledState);
 
   return true;
 }
index f6e5ded437d89e8f3c8980d9e3abb324397bf5bd..6d9650bd228bf839fa0db71d1ad314398e8f6439 100644 (file)
@@ -47,8 +47,8 @@ using namespace rfb;
 const int MinKeyLength = 128;
 const int MaxKeyLength = 1024;
 
-CSecurityDH::CSecurityDH(CConnection* cc)
-  : CSecurity(cc), keyLength(0)
+CSecurityDH::CSecurityDH(CConnection* cc_)
+  : CSecurity(cc_), keyLength(0)
 {
   mpz_init(g);
   mpz_init(p);
index d7e2371510d29dd2c2d5a48813738048c8c5f319..e721cdfcfab4aebade8f4769d7ae9b9e49097b04 100644 (file)
@@ -44,8 +44,8 @@
 
 using namespace rfb;
 
-CSecurityMSLogonII::CSecurityMSLogonII(CConnection* cc)
-  : CSecurity(cc)
+CSecurityMSLogonII::CSecurityMSLogonII(CConnection* cc_)
+  : CSecurity(cc_)
 {
   mpz_init(g);
   mpz_init(p);
index 98379c73d7708852a288b8ebcbf675e2a5ab21c8..df685d0d10b6bf073af60438918037a7343c1615 100644 (file)
@@ -29,7 +29,7 @@ namespace rfb {
 
   class CSecurityNone : public CSecurity {
   public:
-    CSecurityNone(CConnection* cc) : CSecurity(cc) {}
+    CSecurityNone(CConnection* cc_) : CSecurity(cc_) {}
     bool processMsg() override { return true; }
     int getType() const override {return secTypeNone;}
   };
index 0cc9e8edfcdfb28720065a82bf1ae0c7cf5e973c..0dbf4064a2bcc97bae335f9c6211687d8f14046a 100644 (file)
@@ -26,7 +26,7 @@ namespace rfb {
 
   class CSecurityPlain : public CSecurity {
   public:
-    CSecurityPlain(CConnection* cc) : CSecurity(cc) {}
+    CSecurityPlain(CConnection* cc_) : CSecurity(cc_) {}
     bool processMsg() override;
     int getType() const override { return secTypePlain; }
   };
index 832574a0bddcb3a5a893754669c393c64adc200e..96d96b01ad9130d8063d5e027aac56cb2cb1c910 100644 (file)
@@ -56,9 +56,9 @@ const int MaxKeyLength = 8192;
 
 using namespace rfb;
 
-CSecurityRSAAES::CSecurityRSAAES(CConnection* cc, uint32_t _secType,
+CSecurityRSAAES::CSecurityRSAAES(CConnection* cc_, uint32_t _secType,
                                  int _keySize, bool _isAllEncrypted)
-  : CSecurity(cc), state(ReadPublicKey),
+  : CSecurity(cc_), state(ReadPublicKey),
     keySize(_keySize), isAllEncrypted(_isAllEncrypted), secType(_secType),
     clientKey(), clientPublicKey(), serverKey(),
     serverKeyN(nullptr), serverKeyE(nullptr),
index 6b8da8ddd0f71b3bf2208d63ddba4dc197db4b32..838d68ac66029a71e2b342b5a773d22bcd9e1704 100644 (file)
@@ -25,9 +25,9 @@
 
 using namespace rfb;
 
-CSecurityStack::CSecurityStack(CConnection* cc, int Type,
+CSecurityStack::CSecurityStack(CConnection* cc_, int Type,
                                CSecurity* s0, CSecurity* s1)
-  : CSecurity(cc), type(Type)
+  : CSecurity(cc_), type(Type)
 {
   state = 0;
   state0 = s0;
index 0633dbce86485431c63b82e78939c2c38e2cc902..8d8b58fdaae045d2df6d9aebb68f2c9242bff078 100644 (file)
@@ -82,8 +82,8 @@ static const char* configdirfn(const char* fn)
   return full_path;
 }
 
-CSecurityTLS::CSecurityTLS(CConnection* cc, bool _anon)
-  : CSecurity(cc), session(nullptr),
+CSecurityTLS::CSecurityTLS(CConnection* cc_, bool _anon)
+  : CSecurity(cc_), session(nullptr),
     anon_cred(nullptr), cert_cred(nullptr),
     anon(_anon), tlsis(nullptr), tlsos(nullptr),
     rawis(nullptr), rawos(nullptr)
index 2b74fe2941bb19a02d1035944521d6b0a646164c..19dcabc33c239d9809f279d54f63a35b1c31a688 100644 (file)
@@ -42,8 +42,9 @@ using namespace std;
 
 static LogWriter vlog("CVeNCrypt");
 
-CSecurityVeNCrypt::CSecurityVeNCrypt(CConnection* cc, SecurityClient* sec)
-  : CSecurity(cc), csecurity(nullptr), security(sec)
+CSecurityVeNCrypt::CSecurityVeNCrypt(CConnection* cc_,
+                                     SecurityClient* sec)
+  : CSecurity(cc_), csecurity(nullptr), security(sec)
 {
   haveRecvdMajorVersion = false;
   haveRecvdMinorVersion = false;
index 66a6c92d76aea52873e41d60a1a4fffcc19ffaab..9a9cf6e0150fbd94bf1c940a9dd0e476e8800cd9 100644 (file)
@@ -25,7 +25,7 @@ namespace rfb {
 
   class CSecurityVncAuth : public CSecurity {
   public:
-    CSecurityVncAuth(CConnection* cc) : CSecurity(cc) {}
+    CSecurityVncAuth(CConnection* cc_) : CSecurity(cc_) {}
     virtual ~CSecurityVncAuth() {}
     bool processMsg() override;
     int getType() const override {return secTypeVncAuth;};
index a423770d770aa1b4bed905500144876a45fa9b9f..f58a9c2f9de9536a593b5545e45d727bd17963ff 100644 (file)
@@ -76,13 +76,13 @@ bool Configuration::set(const char* n, const char* v, bool immutable) {
   return set(n, strlen(n), v, immutable);
 }
 
-bool Configuration::set(const char* name, int len,
+bool Configuration::set(const char* paramName, int len,
                              const char* val, bool immutable)
 {
   VoidParameter* current = head;
   while (current) {
     if ((int)strlen(current->getName()) == len &&
-        strncasecmp(current->getName(), name, len) == 0)
+        strncasecmp(current->getName(), paramName, len) == 0)
     {
       bool b = current->setParam(val);
       if (b && immutable) 
@@ -91,7 +91,7 @@ bool Configuration::set(const char* name, int len,
     }
     current = current->_next;
   }
-  return _next ? _next->set(name, len, val, immutable) : false;
+  return _next ? _next->set(paramName, len, val, immutable) : false;
 }
 
 bool Configuration::set(const char* config, bool immutable) {
index f0c72eed84dcd99ca2cf2a813aba19bcdd35eef8..fa596bc5b659e4b4d0304bab11bc4733599b99ca 100644 (file)
@@ -33,11 +33,11 @@ using namespace rfb;
 static LogWriter vlog("Cursor");
 
 Cursor::Cursor(int width, int height, const Point& hotspot,
-               const uint8_t* data) :
+               const uint8_t* data_) :
   width_(width), height_(height), hotspot_(hotspot)
 {
-  this->data = new uint8_t[width_*height_*4];
-  memcpy(this->data, data, width_*height_*4);
+  data = new uint8_t[width_*height_*4];
+  memcpy(data, data_, width_*height_*4);
 }
 
 Cursor::Cursor(const Cursor& other) :
index 63ab987dbd6905c90541a6e23657c2d4f7de2caf..ef415886114aa7c6ef98b4cb63d3e1311848d6c8 100644 (file)
@@ -40,8 +40,8 @@ using namespace rfb;
 
 static LogWriter vlog("DecodeManager");
 
-DecodeManager::DecodeManager(CConnection *conn) :
-  conn(conn), threadException(nullptr)
+DecodeManager::DecodeManager(CConnection *conn_) :
+  conn(conn_), threadException(nullptr)
 {
   size_t cpuCount;
 
@@ -268,12 +268,9 @@ void DecodeManager::throwThreadException()
   throw e;
 }
 
-DecodeManager::DecodeThread::DecodeThread(DecodeManager* manager)
+DecodeManager::DecodeThread::DecodeThread(DecodeManager* manager_)
+  : manager(manager_), stopRequested(false)
 {
-  this->manager = manager;
-
-  stopRequested = false;
-
   start();
 }
 
index a6d9b17c6749096c8e73ae1a6df16f2d24e06163..e9bc9a4ff5b9342c1bea2146b8028670f58409d6 100644 (file)
@@ -37,7 +37,7 @@
 
 using namespace rfb;
 
-Decoder::Decoder(enum DecoderFlags flags) : flags(flags)
+Decoder::Decoder(enum DecoderFlags flags_) : flags(flags_)
 {
 }
 
index 26bb93486e2723059a32cf61f3bfffa037bb1621..53b223db97827a02b265344ac6d734db7a6be413 100644 (file)
@@ -79,9 +79,9 @@ bool H264Decoder::readRect(const Rect& /*r*/,
 
   len = is->readU32();
   os->writeU32(len);
-  uint32_t flags = is->readU32();
+  uint32_t reset = is->readU32();
 
-  os->writeU32(flags);
+  os->writeU32(reset);
 
   if (!is->hasDataOrRestore(len))
     return false;
@@ -100,15 +100,15 @@ void H264Decoder::decodeRect(const Rect& r, const uint8_t* buffer,
 {
   rdr::MemInStream is(buffer, buflen);
   uint32_t len = is.readU32();
-  uint32_t flags = is.readU32();
+  uint32_t reset = is.readU32();
 
   H264DecoderContext* ctx = nullptr;
-  if (flags & resetAllContexts)
+  if (reset & resetAllContexts)
   {
     resetContexts();
     if (!len)
       return;
-    flags &= ~(resetContext | resetAllContexts);
+    reset &= ~(resetContext | resetAllContexts);
   } else {
     ctx = findContext(r);
   }
index e21965200b2e46d6b30d8e7f191c81a7085015c8..8422b5c4bb8d08678c648a744e9ee25a395c9c7b 100644 (file)
@@ -32,6 +32,11 @@ using namespace rfb;
 
 static LogWriter vlog("H264WinDecoderContext");
 
+// Older MinGW lacks this definition
+#ifndef HAVE_VIDEO_PROCESSOR_MFT
+static GUID CLSID_VideoProcessorMFT = { 0x88753b26, 0x5b24, 0x49bd, { 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82 } };
+#endif
+
 bool H264WinDecoderContext::initCodec() {
   os::AutoMutex lock(&mutex);
 
@@ -47,7 +52,6 @@ bool H264WinDecoderContext::initCodec() {
     return false;
   }
 
-  GUID CLSID_VideoProcessorMFT = { 0x88753b26, 0x5b24, 0x49bd, { 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82 } };
   if (FAILED(CoCreateInstance(CLSID_VideoProcessorMFT, nullptr, CLSCTX_INPROC_SERVER, IID_IMFTransform, (LPVOID*)&converter)))
   {
     vlog.error("Cannot create MediaFoundation Video Processor (available only on Windows 8+). Trying ColorConvert DMO.");
@@ -342,8 +346,8 @@ void H264WinDecoderContext::decode(const uint8_t* h264_buffer,
       vlog.debug("Frame converted to RGB");
 
       BYTE* out;
-      DWORD len;
-      converted_buffer->Lock(&out, nullptr, &len);
+      DWORD buflen;
+      converted_buffer->Lock(&out, nullptr, &buflen);
       pb->imageRect(rect, out + offset_y * stride + offset_x * 4, (int)stride / 4);
       converted_buffer->Unlock();
     }
@@ -359,20 +363,20 @@ void H264WinDecoderContext::ParseSPS(const uint8_t* buffer, int length)
     if (available == 0)              \
     {                                \
         if (length == 0) return;     \
-        byte = *buffer++;            \
+        byte_ = *buffer++;            \
         length--;                    \
         available = 8;               \
     }                                \
-    bit = (byte >> --available) & 1; \
+    bit = (byte_ >> --available) & 1; \
 } while (0)
 
 #define GET_BITS(n, var) do {      \
     var = 0;                       \
-    for (int i = n-1; i >= 0; i--) \
+    for (int b = n-1; b >= 0; b--) \
     {                              \
         unsigned bit;              \
         GET_BIT(bit);              \
-        var |= bit << i;           \
+        var |= bit << b;           \
     }                              \
 } while (0)
 
@@ -411,7 +415,7 @@ void H264WinDecoderContext::ParseSPS(const uint8_t* buffer, int length)
     length--;
 
     int available = 0;
-    uint8_t byte = 0;
+    uint8_t byte_ = 0;
 
     unsigned profile_idc;
     unsigned seq_parameter_set_id;
index 2243d67fdb22dc919cd7ebe0fde7aa557d4317a3..dc9b9be72f32730313ca72b8eb1abf5cc2f18215 100644 (file)
@@ -191,10 +191,10 @@ void HextileDecoder::hextileDecode(const Rect& r, rdr::InStream* is,
           if (x + w > 16 || y + h > 16) {
             throw rfb::Exception("HEXTILE_DECODE: Hextile out of bounds");
           }
-          T* ptr = buf + y * t.width() + x;
+          ptr = buf + y * t.width() + x;
           int rowAdd = t.width() - w;
           while (h-- > 0) {
-            int len = w;
+            len = w;
             while (len-- > 0) *ptr++ = fg;
             ptr += rowAdd;
           }
index 729043f018432fe8ad20b18de7ee42b920fb2c78..0666d02d9d5cab28b7a009aae7c0d15fe49ce862 100644 (file)
@@ -38,8 +38,8 @@ BoolParameter improvedHextile("ImprovedHextile",
                               "ratios by the cost of using more CPU time",
                               true);
 
-HextileEncoder::HextileEncoder(SConnection* conn) :
-  Encoder(conn, encodingHextile, EncoderPlain)
+HextileEncoder::HextileEncoder(SConnection* conn_) :
+  Encoder(conn_, encodingHextile, EncoderPlain)
 {
 }
 
index e73a23bfc14e1a638a3798f291cbe240a5bce6a1..f3e3b68a9fad03f1880602099c079ab6492aa744 100644 (file)
@@ -31,8 +31,8 @@
 
 using namespace rfb;
 
-RREEncoder::RREEncoder(SConnection* conn) :
-  Encoder(conn, encodingRRE, EncoderPlain)
+RREEncoder::RREEncoder(SConnection* conn_) :
+  Encoder(conn_, encodingRRE, EncoderPlain)
 {
 }
 
index 2fa1af36323f410d91e7a44cff7e84a780375f2b..eff8999d10f6e840c343ea74f39ad075605f89df 100644 (file)
@@ -29,8 +29,8 @@
 
 using namespace rfb;
 
-RawEncoder::RawEncoder(SConnection* conn) :
-  Encoder(conn, encodingRaw, EncoderPlain)
+RawEncoder::RawEncoder(SConnection* conn_) :
+  Encoder(conn_, encodingRaw, EncoderPlain)
 {
 }
 
index 98fa730bdfc22da7e6ded023d9b50d6a38e9e64d..866d19a2c9feb3c9f5386029a91c9fb94faed22c 100644 (file)
@@ -46,12 +46,12 @@ using namespace rfb;
 
 static LogWriter vlog("SConnection");
 
-SConnection::SConnection(AccessRights accessRights)
+SConnection::SConnection(AccessRights accessRights_)
   : readyForSetColourMapEntries(false), is(nullptr), os(nullptr),
     reader_(nullptr), writer_(nullptr), ssecurity(nullptr),
     authFailureTimer(this, &SConnection::handleAuthFailureTimeout),
     state_(RFBSTATE_UNINITIALISED), preferredEncoding(encodingRaw),
-    accessRights(accessRights), hasRemoteClipboard(false),
+    accessRights(accessRights_), hasRemoteClipboard(false),
     hasLocalClipboard(false),
     unsolicitedClipboardAttempt(false)
 {
@@ -587,7 +587,7 @@ void SConnection::sendClipboardData(const char* data)
     // FIXME: This conversion magic should be in SMsgWriter
     std::string filtered(convertCRLF(data));
     size_t sizes[1] = { filtered.size() + 1 };
-    const uint8_t* data[1] = { (const uint8_t*)filtered.c_str() };
+    const uint8_t* datas[1] = { (const uint8_t*)filtered.c_str() };
 
     if (unsolicitedClipboardAttempt) {
       unsolicitedClipboardAttempt = false;
@@ -599,7 +599,7 @@ void SConnection::sendClipboardData(const char* data)
       }
     }
 
-    writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, data);
+    writer()->writeClipboardProvide(rfb::clipboardUTF8, sizes, datas);
   } else {
     writer()->writeServerCutText(data);
   }
index 944edf8c743d7dbc5101ee1a1f3c8f7cf9521ccc..a10b43697df8b07d48f22b1fe60dbc0841e17500 100644 (file)
@@ -28,7 +28,7 @@ namespace rfb {
 
   class SSecurityNone : public SSecurity {
   public:
-    SSecurityNone(SConnection* sc) : SSecurity(sc) {}
+    SSecurityNone(SConnection* sc_) : SSecurity(sc_) {}
     bool processMsg() override { return true; }
     int getType() const override {return secTypeNone;}
     const char* getUserName() const override {return nullptr;}
index 9bc07cb1810fc7008888ff664aee97bbef7e7a09..73a21335db7ad8352a4a29eb315b017cf7fffd8c 100644 (file)
@@ -68,7 +68,7 @@ bool PasswordValidator::validUser(const char* username)
   return false;
 }
 
-SSecurityPlain::SSecurityPlain(SConnection* sc) : SSecurity(sc)
+SSecurityPlain::SSecurityPlain(SConnection* sc_) : SSecurity(sc_)
 {
 #ifdef WIN32
   valid = new WinPasswdValidator();
index 64a8b5231b54c32a63347fc4fd5de90f2f22798a..13e03b22d08dbced7560c83cd6275568c22913bf 100644 (file)
@@ -70,9 +70,9 @@ BoolParameter SSecurityRSAAES::requireUsername
 ("RequireUsername", "Require username for the RSA-AES security types",
  false, ConfServer);
 
-SSecurityRSAAES::SSecurityRSAAES(SConnection* sc, uint32_t _secType,
+SSecurityRSAAES::SSecurityRSAAES(SConnection* sc_, uint32_t _secType,
                                  int _keySize, bool _isAllEncrypted)
-  : SSecurity(sc), state(SendPublicKey),
+  : SSecurity(sc_), state(SendPublicKey),
     keySize(_keySize), isAllEncrypted(_isAllEncrypted), secType(_secType),
     serverKey(), clientKey(),
     serverKeyN(nullptr), serverKeyE(nullptr),
index b306cd6a885b0f223104c15920eda6502692586b..0ce6d75413c6122d1d751f43822c7fef9539b1ae 100644 (file)
@@ -24,9 +24,9 @@
 
 using namespace rfb;
 
-SSecurityStack::SSecurityStack(SConnection* sc, int Type,
+SSecurityStack::SSecurityStack(SConnection* sc_, int Type,
                                SSecurity* s0, SSecurity* s1)
-  : SSecurity(sc), state(0), state0(s0), state1(s1), type(Type)
+  : SSecurity(sc_), state(0), state0(s0), state1(s1), type(Type)
 {
 }
 
index c55f1be8ee46876ac0be61aa101520b0c246d671..e2b82f898eaee02ccabdfac3656d45c5ead40ff6 100644 (file)
@@ -66,8 +66,8 @@ StringParameter SSecurityTLS::X509_KeyFile
 
 static LogWriter vlog("TLS");
 
-SSecurityTLS::SSecurityTLS(SConnection* sc, bool _anon)
-  : SSecurity(sc), session(nullptr), anon_cred(nullptr),
+SSecurityTLS::SSecurityTLS(SConnection* sc_, bool _anon)
+  : SSecurity(sc_), session(nullptr), anon_cred(nullptr),
     cert_cred(nullptr), anon(_anon), tlsis(nullptr), tlsos(nullptr),
     rawis(nullptr), rawos(nullptr)
 {
index a6dc327ef4ae0c17de6b1fe61e0e80ed3851569f..ce160503b38e388ff011c0ae3fa55e925a7027aa 100644 (file)
@@ -38,8 +38,9 @@ using namespace std;
 
 static LogWriter vlog("SVeNCrypt");
 
-SSecurityVeNCrypt::SSecurityVeNCrypt(SConnection* sc, SecurityServer *sec)
-  : SSecurity(sc), security(sec)
+SSecurityVeNCrypt::SSecurityVeNCrypt(SConnection* sc_,
+                                     SecurityServer *sec)
+  : SSecurity(sc_), security(sec)
 {
   ssecurity = nullptr;
   haveSentVersion = false;
index 7d5b2664f459873b1c744a02e68eb22b6a47137b..1276f68a898967671f47212f8da40876407b515c 100644 (file)
@@ -52,8 +52,8 @@ VncAuthPasswdParameter SSecurityVncAuth::vncAuthPasswd
 ("Password", "Obfuscated binary encoding of the password which clients must supply to "
  "access the server", &SSecurityVncAuth::vncAuthPasswdFile);
 
-SSecurityVncAuth::SSecurityVncAuth(SConnection* sc)
-  : SSecurity(sc), sentChallenge(false),
+SSecurityVncAuth::SSecurityVncAuth(SConnection* sc_)
+  : SSecurity(sc_), sentChallenge(false),
     pg(&vncAuthPasswd), accessRights(AccessNone)
 {
 }
@@ -116,10 +116,10 @@ bool SSecurityVncAuth::processMsg()
   throw AuthFailureException();
 }
 
-VncAuthPasswdParameter::VncAuthPasswdParameter(const char* name,
+VncAuthPasswdParameter::VncAuthPasswdParameter(const char* name_,
                                                const char* desc,
                                                StringParameter* passwdFile_)
-: BinaryParameter(name, desc, nullptr, 0, ConfServer),
+: BinaryParameter(name_, desc, nullptr, 0, ConfServer),
   passwdFile(passwdFile_)
 {
 }
index 213f872ca775a1558db5bf8d7b1162b228b09720..169b74f7675cfafd9ea5daad4f2bb65f3f7556ee 100644 (file)
@@ -60,8 +60,8 @@ static const TightConf conf[10] = {
   { 9, 9, 9 }  // 9
 };
 
-TightEncoder::TightEncoder(SConnection* conn) :
-  Encoder(conn, encodingTight, EncoderPlain, 256)
+TightEncoder::TightEncoder(SConnection* conn_) :
+  Encoder(conn_, encodingTight, EncoderPlain, 256)
 {
   setCompressLevel(-1);
 }
index 5c8706eee63f2d92ba3cdf9094611bcdcfcc8a2c..de8fd77f1f0d048ad448dea28b16c7f9e6b481e7 100644 (file)
@@ -68,8 +68,8 @@ static const struct TightJPEGConfiguration conf[10] = {
 };
 
 
-TightJPEGEncoder::TightJPEGEncoder(SConnection* conn) :
-  Encoder(conn, encodingTight,
+TightJPEGEncoder::TightJPEGEncoder(SConnection* conn_) :
+  Encoder(conn_, encodingTight,
           (EncoderFlags)(EncoderUseNativePF | EncoderLossy), -1, 9),
   qualityLevel(-1), fineQuality(-1), fineSubsampling(subsampleUndefined)
 {
index d18a79833a26bca66ec5e52d29b22494d8b0f330..a8fa1739d1aeba54d5b90f18095bbb6e15170ad3 100644 (file)
@@ -182,14 +182,14 @@ void VNCServerST::removeSocket(network::Socket* sock) {
         handleClipboardAnnounce(*ci, false);
       clipboardRequestors.remove(*ci);
 
-      std::string name((*ci)->getPeerEndpoint());
+      std::string peer((*ci)->getPeerEndpoint());
 
       // - Delete the per-Socket resources
       delete *ci;
 
       clients.remove(*ci);
 
-      connectionsLog.status("closed: %s", name.c_str());
+      connectionsLog.status("closed: %s", peer.c_str());
 
       // - Check that the desktop object is still required
       if (authClientCount() == 0)
index c967733791708fce874ad0d250795acc5e754126..1e2c6ef47ad88d7f0131bf2dbfddb233a792e355 100644 (file)
@@ -36,8 +36,8 @@ static LogWriter vlog("ZRLEEncoder");
 
 IntParameter zlibLevel("ZlibLevel","[DEPRECATED] Zlib compression level",-1);
 
-ZRLEEncoder::ZRLEEncoder(SConnection* conn)
-  : Encoder(conn, encodingZRLE, EncoderPlain, 127),
+ZRLEEncoder::ZRLEEncoder(SConnection* conn_)
+  : Encoder(conn_, encodingZRLE, EncoderPlain, 127),
   zos(nullptr, 2), mos(129*1024)
 {
   if (zlibLevel != -1) {
index 904363a070d1b89c7d6eee0cae98dd78c0110686..25dca4908c01b38da83522c4efc24c3e7ba6878d 100644 (file)
@@ -279,8 +279,8 @@ void CConn::serverCutText(const char*)
 {
 }
 
-Manager::Manager(class rfb::SConnection *conn) :
-  EncodeManager(conn)
+Manager::Manager(class rfb::SConnection *conn_) :
+  EncodeManager(conn_)
 {
 }
 
@@ -388,13 +388,13 @@ static struct stats runTest(const char *fn)
   return s;
 }
 
-static void sort(double *array, int count)
+static void sort(double *array, int len)
 {
   bool sorted;
   int i;
   do {
     sorted = true;
-    for (i = 1; i < count; i++) {
+    for (i = 1; i < len; i++) {
       if (array[i-1] > array[i]) {
         double d;
         d = array[i];
index a2ca50d038bb8903c5feeea1d6f54a6d617b957a..614d12554a1f268fb84a0106c56cad469795b889 100644 (file)
@@ -36,7 +36,7 @@ static void doTest(bool should_fail, int b, int d, bool e, bool t,
 
     try {
         pf = new rfb::PixelFormat(b, d, e, t, rm, gm, bm, rs, gs, bs);
-    } catch(rfb::Exception &e) {
+    } catch(rfb::Exception&) {
         if (should_fail)
             printf("OK");
         else
index 8804e853ab65f652f619a52e4f072d23d5caed3e..720c50d0d3e51dc69174578b040b6d82e01deb9a 100644 (file)
@@ -33,9 +33,9 @@
 
 class TXDialog : public TXWindow, public TXDeleteWindowCallback {
 public:
-  TXDialog(Display* dpy, int width, int height, const char* name,
+  TXDialog(Display* dpy_, int width, int height, const char* name,
            bool modal_=false)
-    : TXWindow(dpy, width, height), done(false), ok(false), modal(modal_)
+    : TXWindow(dpy_, width, height), done(false), ok(false), modal(modal_)
   {
     toplevel(name, this);
     resize(width, height);
index e725de7d12260e4be6a28792e942e02fd3f7ad6f..aa1b78ad0c3cdce49e57911eabd1d62b44b28d31 100644 (file)
 #include "QueryConnectDialog.h"
 #include "vncExt.h"
 
-QueryConnectDialog::QueryConnectDialog(Display* dpy,
+QueryConnectDialog::QueryConnectDialog(Display* dpy_,
                                        const char* address_,
                                        const char* user_,
                                        int timeout_,
                                        QueryResultCallback* cb)
-  : TXDialog(dpy, 300, 100, "VNC Server : Accept Connection?"),
+  : TXDialog(dpy_, 300, 100, "VNC Server : Accept Connection?"),
     addressLbl(dpy, "Host:",this),
     address(dpy, address_, this),
     userLbl(dpy, "User:", this),
index 6f1f43dcd8dcdaef064ccabda35e22ec8538fe34..ab7c6315dc87b9e621e5b5b65eca5207bf15e6c7 100644 (file)
@@ -66,10 +66,10 @@ char* programName = nullptr;
 Display* dpy;
 int vncExtEventBase, vncExtErrorBase;
 
-static bool getBoolParam(Display* dpy, const char* param) {
+static bool getBoolParam(Display* dpy_, const char* param) {
   char* data;
   int len;
-  if (XVncExtGetParam(dpy, param, &data, &len)) {
+  if (XVncExtGetParam(dpy_, param, &data, &len)) {
     if (strcmp(data,"1") == 0) return true;
   }
   return false;
@@ -80,12 +80,12 @@ class VncConfigWindow : public TXWindow, public TXEventHandler,
                         public TXCheckboxCallback,
                         public QueryResultCallback {
 public:
-  VncConfigWindow(Display* dpy)
-    : TXWindow(dpy, 300, 100),
-      acceptClipboard(dpy, "Accept clipboard from viewers", this, false, this),
-      setPrimaryCB(dpy, "Also set primary selection", this, false, this),
-      sendClipboard(dpy, "Send clipboard to viewers", this, false, this),
-      sendPrimaryCB(dpy, "Send primary selection to viewers", this,false,this),
+  VncConfigWindow(Display* dpy_)
+    : TXWindow(dpy_, 300, 100),
+      acceptClipboard(dpy_, "Accept clipboard from viewers", this, false, this),
+      setPrimaryCB(dpy_, "Also set primary selection", this, false, this),
+      sendClipboard(dpy_, "Send clipboard to viewers", this, false, this),
+      sendPrimaryCB(dpy_, "Send primary selection to viewers", this,false,this),
       queryConnectDialog(nullptr)
   {
     int y = yPad;
@@ -278,8 +278,8 @@ int main(int argc, char** argv)
       } else if (strcmp(argv[i], "-list") == 0) {
         int nParams;
         char** list = XVncExtListParams(dpy, &nParams);
-        for (int i = 0; i < nParams; i++) {
-          printf("%s\n",list[i]);
+        for (int n = 0; n < nParams; n++) {
+          printf("%s\n",list[n]);
         }
         XVncExtFreeParamList(list);
       } else if (strcmp(argv[i], "-set") == 0) {
index b949b0d7f2434357f4d783148f1671f133cea2e4..b0f79933a92e639b6d7bc3542f8fd3061f4435df 100644 (file)
@@ -342,9 +342,9 @@ void DesktopWindow::resizeFramebuffer(int new_w, int new_h)
 
   XGetWindowProperty(fl_display, fl_xid(this), net_wm_state, 0, 1024, False, XA_ATOM, &type, &format, &nitems, &remain, (unsigned char**)&atoms);
 
-  for (unsigned long i = 0;i < nitems;i++) {
-    if ((atoms[i] == net_wm_state_maximized_vert) ||
-        (atoms[i] == net_wm_state_maximized_horz)) {
+  for (unsigned long n = 0;n < nitems;n++) {
+    if ((atoms[n] == net_wm_state_maximized_vert) ||
+        (atoms[n] == net_wm_state_maximized_horz)) {
       maximized = true;
       break;
     }
@@ -513,8 +513,8 @@ void DesktopWindow::draw()
       windowRect.setXYWH(x(), y(), w(), h());
 
       bool foundEnclosedScreen = false;
-      for (int i = 0; i < Fl::screen_count(); i++) {
-        Fl::screen_xywh(sx, sy, sw, sh, i);
+      for (int idx = 0; idx < Fl::screen_count(); idx++) {
+        Fl::screen_xywh(sx, sy, sw, sh, idx);
 
         // The screen with the smallest index that are enclosed by
         // the viewport will be used for showing the overlay.
@@ -632,10 +632,10 @@ void DesktopWindow::resize(int x, int y, int w, int h)
     }
 
     if (resize_req) {
-      for (int i = 0;i < Fl::screen_count();i++) {
+      for (int idx = 0;idx < Fl::screen_count();idx++) {
         int sx, sy, sw, sh;
 
-        Fl::screen_xywh(sx, sy, sw, sh, i);
+        Fl::screen_xywh(sx, sy, sw, sh, idx);
 
         // We can't trust x and y if the window isn't mapped as the
         // window manager might adjust those numbers
@@ -977,9 +977,8 @@ void DesktopWindow::fullscreen_on()
       std::set<int> selected = fullScreenSelectedMonitors.getParam();
       monitors.insert(selected.begin(), selected.end());
     } else {
-      for (int i = 0; i < Fl::screen_count(); i++) {
-        monitors.insert(i);
-      }
+      for (int idx = 0; idx < Fl::screen_count(); idx++)
+        monitors.insert(idx);
     }
 
     // If no monitors were found in the selected monitors case, we want
@@ -1332,7 +1331,6 @@ void DesktopWindow::remoteResize(int width, int height)
     layout.begin()->dimensions.br.x = width;
     layout.begin()->dimensions.br.y = height;
   } else {
-    int i;
     uint32_t id;
     int sx, sy, sw, sh;
     rfb::Rect viewport_rect, screen_rect;
@@ -1348,8 +1346,8 @@ void DesktopWindow::remoteResize(int width, int height)
     // FIXME: We should really track screens better so we can handle
     //        a resized one.
     //
-    for (i = 0;i < Fl::screen_count();i++) {
-      Fl::screen_xywh(sx, sy, sw, sh, i);
+    for (int idx = 0;idx < Fl::screen_count();idx++) {
+      Fl::screen_xywh(sx, sy, sw, sh, idx);
 
       // Check that the screen is fully inside the framebuffer
       screen_rect.setXYWH(sx, sy, sw, sh);
index fe9a54a63ccfa49b46dd10dee9547e53db6b7205..957ade06c56fb3e93cd1c089806b333917fb0b90 100644 (file)
@@ -71,11 +71,11 @@ std::set<int> MonitorIndicesParameter::getParam()
     return indices;
 }
 
-bool MonitorIndicesParameter::setParam(const char* value)
+bool MonitorIndicesParameter::setParam(const char* v)
 {
     std::set<int> indices;
 
-    if (!parseIndices(value, &indices, true)) {
+    if (!parseIndices(v, &indices, true)) {
         vlog.error(_("Invalid configuration specified for %s"), name);
         return false;
     }
@@ -86,7 +86,7 @@ bool MonitorIndicesParameter::setParam(const char* value)
             vlog.error(_("Monitor index %d does not exist"), index);
     }
 
-    return StringParameter::setParam(value);
+    return StringParameter::setParam(v);
 }
 
 bool MonitorIndicesParameter::setParam(std::set<int> indices)
index e71439a8264e6400c69cb2f88841b8f48c891126..d91c84fe5d864f0487d50b18e3c9bc98343bbc17 100644 (file)
@@ -29,7 +29,7 @@ public:
     MonitorIndicesParameter(const char* name_, const char* desc_, const char* v);
     std::set<int> getParam();
     bool setParam(std::set<int> indices);
-    bool setParam(const char* value) override;
+    bool setParam(const char* v) override;
 private:
     typedef struct {
         int x, y, w, h;
index ec274e74780950f16bd9a9a8a32bceecf1590660..e04065eceddcac6bf5efa958c3cf63dabee3de19 100644 (file)
@@ -328,9 +328,9 @@ void OptionsDialog::loadOptions(void)
   menuKeyChoice->value(0);
 
   menuKeyBuf = menuKey;
-  for (int i = 0; i < getMenuKeySymbolCount(); i++)
-    if (!strcmp(getMenuKeySymbols()[i].name, menuKeyBuf))
-      menuKeyChoice->value(i + 1);
+  for (int idx = 0; idx < getMenuKeySymbolCount(); idx++)
+    if (!strcmp(getMenuKeySymbols()[idx].name, menuKeyBuf))
+      menuKeyChoice->value(idx + 1);
 
   /* Display */
   if (!fullScreen) {
@@ -872,8 +872,8 @@ void OptionsDialog::createInputPage(int tx, int ty, int tw, int th)
     menuKeyChoice = new Fl_Choice(LBLLEFT(tx, ty, 150, CHOICE_HEIGHT, _("Menu key")));
 
     fltk_menu_add(menuKeyChoice, _("None"), 0, nullptr, nullptr, FL_MENU_DIVIDER);
-    for (int i = 0; i < getMenuKeySymbolCount(); i++)
-      fltk_menu_add(menuKeyChoice, getMenuKeySymbols()[i].name, 0, nullptr, nullptr, 0);
+    for (int idx = 0; idx < getMenuKeySymbolCount(); idx++)
+      fltk_menu_add(menuKeyChoice, getMenuKeySymbols()[idx].name, 0, nullptr, nullptr, 0);
 
     ty += CHOICE_HEIGHT + TIGHT_MARGIN;
   }
index 4827c0fbf32ed195609f338215d52ce1f8c734d0..3bce2b5100907a1d8e1d777eb6bf710fb351ad32 100644 (file)
@@ -395,8 +395,8 @@ void ServerDialog::saveServerHistory()
                     filepath, strerror(errno));
 
   // Save the last X elements to the config file.
-  for(size_t i=0; i < serverHistory.size() && i <= SERVER_HISTORY_SIZE; i++)
-    fprintf(f, "%s\n", serverHistory[i].c_str());
+  for(size_t idx=0; idx < serverHistory.size() && idx <= SERVER_HISTORY_SIZE; idx++)
+    fprintf(f, "%s\n", serverHistory[idx].c_str());
 
   fclose(f);
 }
index 1cb87f502d6c6c107934d95e672964f07044285f..60e452b16d940e774f1df4a298aa508b28e8a76b 100644 (file)
@@ -41,11 +41,15 @@ public:
 
   void clear(unsigned char r, unsigned char g, unsigned char b, unsigned char a=255);
 
-  void draw(int src_x, int src_y, int x, int y, int w, int h);
-  void draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h);
+  void draw(int src_x, int src_y, int dst_x, int dst_y,
+            int dst_w, int dst_h);
+  void draw(Surface* dst, int src_x, int src_y, int dst_x, int dst_y,
+            int dst_w, int dst_h);
 
-  void blend(int src_x, int src_y, int x, int y, int w, int h, int a=255);
-  void blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a=255);
+  void blend(int src_x, int src_y, int dst_x, int dst_y,
+             int dst_w, int dst_h, int a=255);
+  void blend(Surface* dst, int src_x, int src_y, int dst_x, int dst_y,
+             int dst_w, int dst_h, int a=255);
 
 protected:
   void alloc();
index 864e3b51ab3f8a302c30f8e65f5305e3b68003a5..673f37e995c5caa5f67883f900946fb44ac230f6 100644 (file)
@@ -137,7 +137,8 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned
   }
 }
 
-void Surface::draw(int src_x, int src_y, int x, int y, int w, int h)
+void Surface::draw(int src_x, int src_y, int dst_x, int dst_y,
+                   int dst_w, int dst_h)
 {
   CGColorSpaceRef lut;
 
@@ -148,32 +149,34 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h)
   CGContextConcatCTM(fl_gc, CGAffineTransformInvert(CGContextGetCTM(fl_gc)));
 
   // macOS Coordinates are from bottom left, not top left
-  y = Fl_Window::current()->h() - (y + h);
+  dst_y = Fl_Window::current()->h() - (dst_y + dst_h);
 
   lut = cocoa_win_color_space(Fl_Window::current());
   render(fl_gc, lut, data, kCGBlendModeCopy, 1.0,
-         src_x, src_y, width(), height(), x, y, w, h);
+         src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h);
   CGColorSpaceRelease(lut);
 
   CGContextRestoreGState(fl_gc);
 }
 
-void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h)
+void Surface::draw(Surface* dst, int src_x, int src_y,
+                   int dst_x, int dst_y, int dst_w, int dst_h)
 {
   CGContextRef bitmap;
 
   bitmap = make_bitmap(dst->width(), dst->height(), dst->data);
 
   // macOS Coordinates are from bottom left, not top left
-  y = dst->height() - (y + h);
+  dst_y = dst->height() - (dst_y + dst_h);
 
   render(bitmap, srgb, data, kCGBlendModeCopy, 1.0,
-         src_x, src_y, width(), height(), x, y, w, h);
+         src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h);
 
   CGContextRelease(bitmap);
 }
 
-void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a)
+void Surface::blend(int src_x, int src_y, int dst_x, int dst_y,
+                    int dst_w, int dst_h, int a)
 {
   CGColorSpaceRef lut;
 
@@ -184,27 +187,28 @@ void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a)
   CGContextConcatCTM(fl_gc, CGAffineTransformInvert(CGContextGetCTM(fl_gc)));
 
   // macOS Coordinates are from bottom left, not top left
-  y = Fl_Window::current()->h() - (y + h);
+  dst_y = Fl_Window::current()->h() - (dst_y + dst_h);
 
   lut = cocoa_win_color_space(Fl_Window::current());
   render(fl_gc, lut, data, kCGBlendModeNormal, (CGFloat)a/255.0,
-         src_x, src_y, width(), height(), x, y, w, h);
+         src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h);
   CGColorSpaceRelease(lut);
 
   CGContextRestoreGState(fl_gc);
 }
 
-void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a)
+void Surface::blend(Surface* dst, int src_x, int src_y,
+                    int dst_x, int dst_y, int dst_w, int dst_h, int a)
 {
   CGContextRef bitmap;
 
   bitmap = make_bitmap(dst->width(), dst->height(), dst->data);
 
   // macOS Coordinates are from bottom left, not top left
-  y = dst->height() - (y + h);
+  dst_y = dst->height() - (dst_y + dst_h);
 
   render(bitmap, srgb, data, kCGBlendModeNormal, (CGFloat)a/255.0,
-         src_x, src_y, width(), height(), x, y, w, h);
+         src_x, src_y, width(), height(), dst_x, dst_y, dst_w, dst_h);
 
   CGContextRelease(bitmap);
 }
index 1db5f7185b0ddd1d32957c02d42a688838908e26..46a2b055180570cdbdef59dd57b9a7c970260d56 100644 (file)
@@ -50,7 +50,8 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned
   }
 }
 
-void Surface::draw(int src_x, int src_y, int x, int y, int w, int h)
+void Surface::draw(int src_x, int src_y, int dst_x, int dst_y,
+                   int dst_w, int dst_h)
 {
   HDC dc;
 
@@ -61,7 +62,8 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h)
   if (!SelectObject(dc, bitmap))
     throw rdr::SystemException("SelectObject", GetLastError());
 
-  if (!BitBlt(fl_gc, x, y, w, h, dc, src_x, src_y, SRCCOPY)) {
+  if (!BitBlt(fl_gc, dst_x, dst_y, dst_w, dst_h,
+              dc, src_x, src_y, SRCCOPY)) {
     // If the desktop we're rendering to is inactive (like when the screen
     // is locked or the UAC is active), then GDI calls will randomly fail.
     // This is completely undocumented so we have no idea how best to deal
@@ -74,7 +76,8 @@ void Surface::draw(int src_x, int src_y, int x, int y, int w, int h)
   DeleteDC(dc);
 }
 
-void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h)
+void Surface::draw(Surface* dst, int src_x, int src_y,
+                   int dst_x, int dst_y, int dst_w, int dst_h)
 {
   HDC origdc, dstdc;
 
@@ -87,21 +90,23 @@ void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int
 
   origdc = fl_gc;
   fl_gc = dstdc;
-  draw(src_x, src_y, x, y, w, h);
+  draw(src_x, src_y, dst_x, dst_y, dst_w, dst_h);
   fl_gc = origdc;
 
   DeleteDC(dstdc);
 }
 
 void Surface::blend(int /*src_x*/, int /*src_y*/,
-                    int /*x*/, int /*y*/, int /*w*/, int /*h*/,
+                    int /*dst_x*/, int /*dst_y*/,
+                    int /*dst_w*/, int /*dst_h*/,
                     int /*a*/)
 {
   // Compositing doesn't work properly for window DC:s
   assert(false);
 }
 
-void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a)
+void Surface::blend(Surface* dst, int src_x, int src_y,
+                    int dst_x, int dst_y, int dst_w, int dst_h, int a)
 {
   HDC dstdc, srcdc;
   BLENDFUNCTION blend;
@@ -123,7 +128,8 @@ void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int
   blend.SourceConstantAlpha = a;
   blend.AlphaFormat = AC_SRC_ALPHA;
 
-  if (!AlphaBlend(dstdc, x, y, w, h, srcdc, src_x, src_y, w, h, blend)) {
+  if (!AlphaBlend(dstdc, dst_x, dst_y, dst_w, dst_h,
+                  srcdc, src_x, src_y, dst_w, dst_h, blend)) {
     // If the desktop we're rendering to is inactive (like when the screen
     // is locked or the UAC is active), then GDI calls will randomly fail.
     // This is completely undocumented so we have no idea how best to deal
index d4d92cf32d5c87e28914afa3698c3a620c5b5530..d27fcd262e0fb5e1737f9b6329704b0d5052506f 100644 (file)
@@ -43,20 +43,22 @@ void Surface::clear(unsigned char r, unsigned char g, unsigned char b, unsigned
                        0, 0, width(), height());
 }
 
-void Surface::draw(int src_x, int src_y, int x, int y, int w, int h)
+void Surface::draw(int src_x, int src_y, int dst_x, int dst_y,
+                   int dst_w, int dst_h)
 {
   Picture winPict;
 
   winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, nullptr);
   XRenderComposite(fl_display, PictOpSrc, picture, None, winPict,
-                   src_x, src_y, 0, 0, x, y, w, h);
+                   src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h);
   XRenderFreePicture(fl_display, winPict);
 }
 
-void Surface::draw(Surface* dst, int src_x, int src_y, int x, int y, int w, int h)
+void Surface::draw(Surface* dst, int src_x, int src_y,
+                   int dst_x, int dst_y, int dst_w, int dst_h)
 {
   XRenderComposite(fl_display, PictOpSrc, picture, None, dst->picture,
-                   src_x, src_y, 0, 0, x, y, w, h);
+                   src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h);
 }
 
 static Picture alpha_mask(int a)
@@ -86,27 +88,29 @@ static Picture alpha_mask(int a)
   return pict;
 }
 
-void Surface::blend(int src_x, int src_y, int x, int y, int w, int h, int a)
+void Surface::blend(int src_x, int src_y, int dst_x, int dst_y,
+                    int dst_w, int dst_h, int a)
 {
   Picture winPict, alpha;
 
   winPict = XRenderCreatePicture(fl_display, fl_window, visFormat, 0, nullptr);
   alpha = alpha_mask(a);
   XRenderComposite(fl_display, PictOpOver, picture, alpha, winPict,
-                   src_x, src_y, 0, 0, x, y, w, h);
+                   src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h);
   XRenderFreePicture(fl_display, winPict);
 
   if (alpha != None)
     XRenderFreePicture(fl_display, alpha);
 }
 
-void Surface::blend(Surface* dst, int src_x, int src_y, int x, int y, int w, int h, int a)
+void Surface::blend(Surface* dst, int src_x, int src_y,
+                    int dst_x, int dst_y, int dst_w, int dst_h, int a)
 {
   Picture alpha;
 
   alpha = alpha_mask(a);
   XRenderComposite(fl_display, PictOpOver, picture, alpha, dst->picture,
-                   src_x, src_y, 0, 0, x, y, w, h);
+                   src_x, src_y, 0, 0, dst_x, dst_y, dst_w, dst_h);
   if (alpha != None)
     XRenderFreePicture(fl_display, alpha);
 }
index 41df5bb4be9db4774ead6735a1e8480b635ef112..958b9d66d24aec6464384aa522e5f8c05c59ef24 100644 (file)
@@ -70,7 +70,7 @@ UserDialog::~UserDialog()
 {
 }
 
-void UserDialog::getUserPasswd(bool secure, std::string* user,
+void UserDialog::getUserPasswd(bool secure_, std::string* user,
                                std::string* password)
 {
   const char *passwordFileName(passwordFile);
@@ -121,7 +121,7 @@ void UserDialog::getUserPasswd(bool secure, std::string* user,
   banner = new Fl_Box(0, 0, win->w(), 20);
   banner->align(FL_ALIGN_CENTER|FL_ALIGN_INSIDE|FL_ALIGN_IMAGE_NEXT_TO_TEXT);
   banner->box(FL_FLAT_BOX);
-  if (secure) {
+  if (secure_) {
     banner->label(_("This connection is secure"));
     banner->color(FL_GREEN);
     banner->image(secure_icon);
index 0c2cb862ce171249a94860563700f8a0c6a8d84c..032fd32217f69f02ea69d4e3bac0a06ce401fce2 100644 (file)
@@ -329,9 +329,9 @@ void Viewport::handleClipboardData(const char* data)
   Fl::copy(data, len, 1);
 }
 
-void Viewport::setLEDState(unsigned int state)
+void Viewport::setLEDState(unsigned int ledState)
 {
-  vlog.debug("Got server LED state: 0x%08x", state);
+  vlog.debug("Got server LED state: 0x%08x", ledState);
 
   // The first message is just considered to be the server announcing
   // support for this extension. We will push our state to sync up the
@@ -355,7 +355,7 @@ void Viewport::setLEDState(unsigned int state)
   memset(input, 0, sizeof(input));
   count = 0;
 
-  if (!!(state & ledCapsLock) != !!(GetKeyState(VK_CAPITAL) & 0x1)) {
+  if (!!(ledState & ledCapsLock) != !!(GetKeyState(VK_CAPITAL) & 0x1)) {
     input[count].type = input[count+1].type = INPUT_KEYBOARD;
     input[count].ki.wVk = input[count+1].ki.wVk = VK_CAPITAL;
     input[count].ki.wScan = input[count+1].ki.wScan = SCAN_FAKE;
@@ -364,7 +364,7 @@ void Viewport::setLEDState(unsigned int state)
     count += 2;
   }
 
-  if (!!(state & ledNumLock) != !!(GetKeyState(VK_NUMLOCK) & 0x1)) {
+  if (!!(ledState & ledNumLock) != !!(GetKeyState(VK_NUMLOCK) & 0x1)) {
     input[count].type = input[count+1].type = INPUT_KEYBOARD;
     input[count].ki.wVk = input[count+1].ki.wVk = VK_NUMLOCK;
     input[count].ki.wScan = input[count+1].ki.wScan = SCAN_FAKE;
@@ -373,7 +373,7 @@ void Viewport::setLEDState(unsigned int state)
     count += 2;
   }
 
-  if (!!(state & ledScrollLock) != !!(GetKeyState(VK_SCROLL) & 0x1)) {
+  if (!!(ledState & ledScrollLock) != !!(GetKeyState(VK_SCROLL) & 0x1)) {
     input[count].type = input[count+1].type = INPUT_KEYBOARD;
     input[count].ki.wVk = input[count+1].ki.wVk = VK_SCROLL;
     input[count].ki.wScan = input[count+1].ki.wScan = SCAN_FAKE;
@@ -391,13 +391,13 @@ void Viewport::setLEDState(unsigned int state)
 #elif defined(__APPLE__)
   int ret;
 
-  ret = cocoa_set_caps_lock_state(state & ledCapsLock);
+  ret = cocoa_set_caps_lock_state(ledState & ledCapsLock);
   if (ret != 0) {
     vlog.error(_("Failed to update keyboard LED state: %d"), ret);
     return;
   }
 
-  ret = cocoa_set_num_lock_state(state & ledNumLock);
+  ret = cocoa_set_num_lock_state(ledState & ledNumLock);
   if (ret != 0) {
     vlog.error(_("Failed to update keyboard LED state: %d"), ret);
     return;
@@ -414,17 +414,17 @@ void Viewport::setLEDState(unsigned int state)
   affect = values = 0;
 
   affect |= LockMask;
-  if (state & ledCapsLock)
+  if (ledState & ledCapsLock)
     values |= LockMask;
 
   mask = getModifierMask(XK_Num_Lock);
   affect |= mask;
-  if (state & ledNumLock)
+  if (ledState & ledNumLock)
     values |= mask;
 
   mask = getModifierMask(XK_Scroll_Lock);
   affect |= mask;
-  if (state & ledScrollLock)
+  if (ledState & ledScrollLock)
     values |= mask;
 
   ret = XkbLockModifiers(fl_display, XkbUseCoreKbd, affect, values);
@@ -435,21 +435,21 @@ void Viewport::setLEDState(unsigned int state)
 
 void Viewport::pushLEDState()
 {
-  unsigned int state;
+  unsigned int ledState;
 
   // Server support?
   if (cc->server.ledState() == ledUnknown)
     return;
 
-  state = 0;
+  ledState = 0;
 
 #if defined(WIN32)
   if (GetKeyState(VK_CAPITAL) & 0x1)
-    state |= ledCapsLock;
+    ledState |= ledCapsLock;
   if (GetKeyState(VK_NUMLOCK) & 0x1)
-    state |= ledNumLock;
+    ledState |= ledNumLock;
   if (GetKeyState(VK_SCROLL) & 0x1)
-    state |= ledScrollLock;
+    ledState |= ledScrollLock;
 #elif defined(__APPLE__)
   int ret;
   bool on;
@@ -460,7 +460,7 @@ void Viewport::pushLEDState()
     return;
   }
   if (on)
-    state |= ledCapsLock;
+    ledState |= ledCapsLock;
 
   ret = cocoa_get_num_lock_state(&on);
   if (ret != 0) {
@@ -468,10 +468,10 @@ void Viewport::pushLEDState()
     return;
   }
   if (on)
-    state |= ledNumLock;
+    ledState |= ledNumLock;
 
   // No support for Scroll Lock //
-  state |= (cc->server.ledState() & ledScrollLock);
+  ledState |= (cc->server.ledState() & ledScrollLock);
 
 #else
   unsigned int mask;
@@ -486,28 +486,28 @@ void Viewport::pushLEDState()
   }
 
   if (xkbState.locked_mods & LockMask)
-    state |= ledCapsLock;
+    ledState |= ledCapsLock;
 
   mask = getModifierMask(XK_Num_Lock);
   if (xkbState.locked_mods & mask)
-    state |= ledNumLock;
+    ledState |= ledNumLock;
 
   mask = getModifierMask(XK_Scroll_Lock);
   if (xkbState.locked_mods & mask)
-    state |= ledScrollLock;
+    ledState |= ledScrollLock;
 #endif
 
-  if ((state & ledCapsLock) != (cc->server.ledState() & ledCapsLock)) {
+  if ((ledState & ledCapsLock) != (cc->server.ledState() & ledCapsLock)) {
     vlog.debug("Inserting fake CapsLock to get in sync with server");
     handleKeyPress(0x3a, XK_Caps_Lock);
     handleKeyRelease(0x3a);
   }
-  if ((state & ledNumLock) != (cc->server.ledState() & ledNumLock)) {
+  if ((ledState & ledNumLock) != (cc->server.ledState() & ledNumLock)) {
     vlog.debug("Inserting fake NumLock to get in sync with server");
     handleKeyPress(0x45, XK_Num_Lock);
     handleKeyRelease(0x45);
   }
-  if ((state & ledScrollLock) != (cc->server.ledState() & ledScrollLock)) {
+  if ((ledState & ledScrollLock) != (cc->server.ledState() & ledScrollLock)) {
     vlog.debug("Inserting fake ScrollLock to get in sync with server");
     handleKeyPress(0x46, XK_Scroll_Lock);
     handleKeyRelease(0x46);
index 5353127d06a4cd96d09040d0cd95845f3fed6c8a..e21768f926cb611f98abc09d2d6125aeaffc38d7 100644 (file)
@@ -37,8 +37,8 @@ static const DWORD MOUSEMOVE_FLAGS = MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE |
 
 static const unsigned SINGLE_PAN_THRESHOLD = 50;
 
-Win32TouchHandler::Win32TouchHandler(HWND hWnd) :
-  hWnd(hWnd), gesturesConfigured(false), gestureActive(false),
+Win32TouchHandler::Win32TouchHandler(HWND hWnd_) :
+  hWnd(hWnd_), gesturesConfigured(false), gestureActive(false),
   ignoringGesture(false), fakeButtonMask(0)
 {
   // If window is registered as touch we can not receive gestures,
index 8fdb46a3e99a5c0740260ab93b382362243832bd..2b2e02c6a3b679014f932bad226e9b60823c9cab 100644 (file)
@@ -43,8 +43,8 @@ static rfb::LogWriter vlog("XInputTouchHandler");
 
 static bool grabbed = false;
 
-XInputTouchHandler::XInputTouchHandler(Window wnd)
-  : wnd(wnd), fakeStateMask(0)
+XInputTouchHandler::XInputTouchHandler(Window wnd_)
+  : wnd(wnd_), fakeStateMask(0)
 {
   XIEventMask eventmask;
   unsigned char flags[XIMaskLen(XI_LASTEVENT)] = { 0 };
@@ -314,7 +314,7 @@ void XInputTouchHandler::preparePointerEvent(XEvent* dst, const GestureEvent src
 {
   Window root, child;
   int rootX, rootY;
-  XkbStateRec state;
+  XkbStateRec xkbState;
 
   // We don't have a real event to steal things from, so we'll have
   // to fake these events based on the current state of things
@@ -324,7 +324,7 @@ void XInputTouchHandler::preparePointerEvent(XEvent* dst, const GestureEvent src
                         src.eventX,
                         src.eventY,
                         &rootX, &rootY, &child);
-  XkbGetState(fl_display, XkbUseCoreKbd, &state);
+  XkbGetState(fl_display, XkbUseCoreKbd, &xkbState);
 
   // XButtonEvent and XMotionEvent are almost identical, so we
   // don't have to care which it is for these fields
@@ -338,8 +338,8 @@ void XInputTouchHandler::preparePointerEvent(XEvent* dst, const GestureEvent src
   dst->xbutton.y = src.eventY;
   dst->xbutton.x_root = rootX;
   dst->xbutton.y_root = rootY;
-  dst->xbutton.state = state.mods;
-  dst->xbutton.state |= ((state.ptr_buttons >> 1) & 0x1f) << 8;
+  dst->xbutton.state = xkbState.mods;
+  dst->xbutton.state |= ((xkbState.ptr_buttons >> 1) & 0x1f) << 8;
   dst->xbutton.same_screen = True;
 }
 
@@ -390,7 +390,7 @@ void XInputTouchHandler::fakeKeyEvent(bool press, int keysym,
 
   Window root, child;
   int rootX, rootY;
-  XkbStateRec state;
+  XkbStateRec xkbState;
 
   int modmask;
 
@@ -399,7 +399,7 @@ void XInputTouchHandler::fakeKeyEvent(bool press, int keysym,
                         origEvent.eventX,
                         origEvent.eventY,
                         &rootX, &rootY, &child);
-  XkbGetState(fl_display, XkbUseCoreKbd, &state);
+  XkbGetState(fl_display, XkbUseCoreKbd, &xkbState);
 
   KeyCode kc = XKeysymToKeycode(fl_display, keysym);
 
@@ -418,8 +418,8 @@ void XInputTouchHandler::fakeKeyEvent(bool press, int keysym,
   fakeEvent.xkey.y = origEvent.eventY;
   fakeEvent.xkey.x_root = rootX;
   fakeEvent.xkey.y_root = rootY;
-  fakeEvent.xkey.state = state.mods;
-  fakeEvent.xkey.state |= ((state.ptr_buttons >> 1) & 0x1f) << 8;
+  fakeEvent.xkey.state = xkbState.mods;
+  fakeEvent.xkey.state |= ((xkbState.ptr_buttons >> 1) & 0x1f) << 8;
   fakeEvent.xkey.same_screen = True;
 
   // Apply our fake mask
index 1639665958b25e8b35494de8558026792e75f4ff..6ddff947039aa96ff39a6f9560b771a3fd87adba 100644 (file)
@@ -487,17 +487,17 @@ static void usage(const char *programName)
 }
 
 static void
-potentiallyLoadConfigurationFile(char *vncServerName)
+potentiallyLoadConfigurationFile(const char *filename)
 {
-  const bool hasPathSeparator = (strchr(vncServerName, '/') != nullptr ||
-                                 (strchr(vncServerName, '\\')) != nullptr);
+  const bool hasPathSeparator = (strchr(filename, '/') != nullptr ||
+                                 (strchr(filename, '\\')) != nullptr);
 
   if (hasPathSeparator) {
 #ifndef WIN32
     struct stat sb;
 
     // This might be a UNIX socket, we need to check
-    if (stat(vncServerName, &sb) == -1) {
+    if (stat(filename, &sb) == -1) {
       // Some access problem; let loadViewerParameters() deal with it...
     } else {
       if ((sb.st_mode & S_IFMT) == S_IFSOCK)
@@ -507,7 +507,7 @@ potentiallyLoadConfigurationFile(char *vncServerName)
 
     try {
       const char* newServerName;
-      newServerName = loadViewerParameters(vncServerName);
+      newServerName = loadViewerParameters(filename);
       // This might be empty, but we still need to clear it so we
       // don't try to connect to the filename
       strncpy(vncServerName, newServerName, VNCSERVERNAMELEN-1);
index 090846f241d5acb495bb448ce62f81586ea380d4..bba1dbdb830f31d39302daae98795f97f64b81bf 100644 (file)
@@ -223,19 +223,19 @@ void DeviceFrameBuffer::setCursor(HCURSOR hCursor, VNCServer* server)
       uint8_t* rwbuffer = buffer.data();
       for (int y = 0; y < height; y++) {
         for (int x = 0; x < width; x++) {
-          int byte = y * maskInfo.bmWidthBytes + x / 8;
+          int byte_ = y * maskInfo.bmWidthBytes + x / 8;
           int bit = 7 - x % 8;
 
-          if (!(andMask[byte] & (1 << bit))) {
+          if (!(andMask[byte_] & (1 << bit))) {
             // Valid pixel, so make it opaque
             rwbuffer[3] = 0xff;
 
             // Black or white?
-            if (xorMask[byte] & (1 << bit))
+            if (xorMask[byte_] & (1 << bit))
               rwbuffer[0] = rwbuffer[1] = rwbuffer[2] = 0xff;
             else
               rwbuffer[0] = rwbuffer[1] = rwbuffer[2] = 0;
-          } else if (xorMask[byte] & (1 << bit)) {
+          } else if (xorMask[byte_] & (1 << bit)) {
             // Replace any XORed pixels with black, because RFB doesn't support
             // XORing of cursors.  XORing is used for the I-beam cursor, which is most
             // often used over a white background, but also sometimes over a black
index 7c1574e9a38b190e6458002c3bb599f5e46fb22b..432439ce82aa4d10d773aaa2c1407d896b2a181f 100644 (file)
@@ -151,7 +151,7 @@ BOOL Dialog::dialogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
 }
 
 
-PropSheetPage::PropSheetPage(HINSTANCE inst, const char* id) : Dialog(inst), propSheet(nullptr) {
+PropSheetPage::PropSheetPage(HINSTANCE inst_, const char* id) : Dialog(inst_), propSheet(nullptr) {
   page.dwSize = sizeof(page);
   page.dwFlags = 0; // PSP_USECALLBACK;
   page.hInstance = inst;
@@ -241,7 +241,7 @@ static int CALLBACK removeCtxtHelp(HWND /*hwnd*/, UINT message, LPARAM lParam) {
 }
 
 
-bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, bool capture) {
+bool PropSheet::showPropSheet(HWND owner_, bool showApply, bool showCtxtHelp, bool capture) {
   if (alreadyShowing) return false;
   alreadyShowing = true;
   int count = pages.size();
@@ -262,7 +262,7 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo
     header.dwSize = sizeof(PROPSHEETHEADER); // Requires comctl32.dll 4.71 or greater, ie IE 4 or later
     header.dwFlags = PSH_MODELESS | (showApply ? 0 : PSH_NOAPPLYNOW) | (showCtxtHelp ? 0 : PSH_USECALLBACK);
     header.pfnCallback = removeCtxtHelp;
-    header.hwndParent = owner;
+    header.hwndParent = owner_;
     header.hInstance = inst;
     header.pszCaption = title.c_str();
     header.nPages = count;
@@ -276,7 +276,7 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo
     handle = (HWND)PropertySheet(&header);
     if ((handle == nullptr) || (handle == (HWND)-1))
       throw rdr::SystemException("PropertySheet failed", GetLastError());
-    centerWindow(handle, owner);
+    centerWindow(handle, owner_);
     plog.info("created %p", handle);
 
     (void)capture;
@@ -314,8 +314,8 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo
     } else {
 #endif
       try {
-        if (owner)
-          EnableWindow(owner, FALSE);
+        if (owner_)
+          EnableWindow(owner_, FALSE);
         // Run the PropertySheet
         MSG msg;
         while (GetMessage(&msg, nullptr, 0, 0)) {
@@ -324,11 +324,11 @@ bool PropSheet::showPropSheet(HWND owner, bool showApply, bool showCtxtHelp, boo
           if (!PropSheet_GetCurrentPageHwnd(handle))
             break;
         }
-        if (owner)
-          EnableWindow(owner, TRUE);
+        if (owner_)
+          EnableWindow(owner_, TRUE);
       } catch (...) {
-        if (owner)
-          EnableWindow(owner, TRUE);
+        if (owner_)
+          EnableWindow(owner_, TRUE);
         throw;
       }
 #ifdef _DIALOG_CAPTURE
index 3b12dab9e96ce55e5d6eefcde3fc39f3f5389a27..bcb98704eae65aa8dafcfbe5ee5050ac60a37b70 100644 (file)
@@ -244,11 +244,11 @@ std::string RegKey::getRepresentation(const char* valname) const {
       DWORD required = ExpandEnvironmentStrings(str.c_str(), nullptr, 0);
       if (required==0)
         throw rdr::SystemException("ExpandEnvironmentStrings", GetLastError());
-      std::vector<char> result(required);
-      length = ExpandEnvironmentStrings(str.c_str(), result.data(), required);
+      std::vector<char> expanded(required);
+      length = ExpandEnvironmentStrings(str.c_str(), expanded.data(), required);
       if (required<length)
         throw rdr::Exception("unable to expand environment strings");
-      return result.data();
+      return expanded.data();
     } else {
       return "";
     }
index 0d6cd578facddfb55113d1a19bc4f284257e4593..dafa38b59633b02e48de4eeb6555ae87cdda59ec 100644 (file)
@@ -338,17 +338,17 @@ bool rfb::win32::registerService(const char* name,
     throw rdr::SystemException("unable to open Service Control Manager", GetLastError());
 
   // - Add the service
-  ServiceHandle service = CreateService(scm,
+  ServiceHandle handle = CreateService(scm,
     name, display, SC_MANAGER_ALL_ACCESS,
     SERVICE_WIN32_OWN_PROCESS | SERVICE_INTERACTIVE_PROCESS,
     SERVICE_AUTO_START, SERVICE_ERROR_IGNORE,
     cmdline.c_str(), nullptr, nullptr, nullptr, nullptr, nullptr);
-  if (!service)
+  if (!handle)
     throw rdr::SystemException("unable to create service", GetLastError());
 
   // - Set a description
   SERVICE_DESCRIPTION sdesc = {(LPTSTR)desc};
-  ChangeServiceConfig2(service, SERVICE_CONFIG_DESCRIPTION, &sdesc);
+  ChangeServiceConfig2(handle, SERVICE_CONFIG_DESCRIPTION, &sdesc);
 
   // - Register the event log source
   RegKey hk, hk2;
@@ -383,10 +383,10 @@ bool rfb::win32::unregisterService(const char* name) {
     throw rdr::SystemException("unable to open Service Control Manager", GetLastError());
 
   // - Create the service
-  ServiceHandle service = OpenService(scm, name, SC_MANAGER_ALL_ACCESS);
-  if (!service)
+  ServiceHandle handle = OpenService(scm, name, SC_MANAGER_ALL_ACCESS);
+  if (!handle)
     throw rdr::SystemException("unable to locate the service", GetLastError());
-  if (!DeleteService(service))
+  if (!DeleteService(handle))
     throw rdr::SystemException("unable to remove the service", GetLastError());
 
   // - Register the event log source
@@ -410,12 +410,12 @@ bool rfb::win32::startService(const char* name) {
     throw rdr::SystemException("unable to open Service Control Manager", GetLastError());
 
   // - Locate the service
-  ServiceHandle service = OpenService(scm, name, SERVICE_START);
-  if (!service)
+  ServiceHandle handle = OpenService(scm, name, SERVICE_START);
+  if (!handle)
     throw rdr::SystemException("unable to open the service", GetLastError());
 
   // - Start the service
-  if (!StartService(service, 0, nullptr))
+  if (!StartService(handle, 0, nullptr))
     throw rdr::SystemException("unable to start the service", GetLastError());
 
   Sleep(500);
@@ -430,13 +430,13 @@ bool rfb::win32::stopService(const char* name) {
     throw rdr::SystemException("unable to open Service Control Manager", GetLastError());
 
   // - Locate the service
-  ServiceHandle service = OpenService(scm, name, SERVICE_STOP);
-  if (!service)
+  ServiceHandle handle = OpenService(scm, name, SERVICE_STOP);
+  if (!handle)
     throw rdr::SystemException("unable to open the service", GetLastError());
 
   // - Start the service
   SERVICE_STATUS status;
-  if (!ControlService(service, SERVICE_CONTROL_STOP, &status))
+  if (!ControlService(handle, SERVICE_CONTROL_STOP, &status))
     throw rdr::SystemException("unable to stop the service", GetLastError());
 
   Sleep(500);
@@ -451,13 +451,13 @@ DWORD rfb::win32::getServiceState(const char* name) {
     throw rdr::SystemException("unable to open Service Control Manager", GetLastError());
 
   // - Locate the service
-  ServiceHandle service = OpenService(scm, name, SERVICE_INTERROGATE);
-  if (!service)
+  ServiceHandle handle = OpenService(scm, name, SERVICE_INTERROGATE);
+  if (!handle)
     throw rdr::SystemException("unable to open the service", GetLastError());
 
   // - Get the service status
   SERVICE_STATUS status;
-  if (!ControlService(service, SERVICE_CONTROL_INTERROGATE, (SERVICE_STATUS*)&status))
+  if (!ControlService(handle, SERVICE_CONTROL_INTERROGATE, (SERVICE_STATUS*)&status))
     throw rdr::SystemException("unable to query the service", GetLastError());
 
   return status.dwCurrentState;
index 7d6038cbc2471509efb70b14484db9b6de34f743..57b65aefb5c667cb796dd18ee500f68519cf0bf8 100644 (file)
@@ -229,11 +229,11 @@ void SocketManager::processEvent(HANDLE event) {
     try {
       // Process data from an active connection
 
-      WSANETWORKEVENTS events;
+      WSANETWORKEVENTS network_events;
       long eventMask;
 
       // Fetch why this event notification triggered
-      if (WSAEnumNetworkEvents(ci.sock->getFd(), event, &events) == SOCKET_ERROR)
+      if (WSAEnumNetworkEvents(ci.sock->getFd(), event, &network_events) == SOCKET_ERROR)
         throw rdr::SystemException("unable to get WSAEnumNetworkEvents:%u", WSAGetLastError());
 
       // Cancel event notification for this socket
@@ -245,14 +245,14 @@ void SocketManager::processEvent(HANDLE event) {
 
 
       // Call the socket server to process the event
-      if (events.lNetworkEvents & FD_WRITE) {
+      if (network_events.lNetworkEvents & FD_WRITE) {
         ci.server->processSocketWriteEvent(ci.sock);
         if (ci.sock->isShutdown()) {
           remSocket(ci.sock);
           return;
         }
       }
-      if (events.lNetworkEvents & (FD_READ | FD_CLOSE)) {
+      if (network_events.lNetworkEvents & (FD_READ | FD_CLOSE)) {
         ci.server->processSocketReadEvent(ci.sock);
         if (ci.sock->isShutdown()) {
           remSocket(ci.sock);
index b32f7607562fb40946980c274f9e9d266a3467d1..b8cb5dc838731fb03fb4f6c109df64942a7f71de 100644 (file)
@@ -86,7 +86,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE /*prev*/, char* /*cmdLine*/, int /*
   freopen("CONOUT$","wb",stderr);
   setbuf(stderr, nullptr);
   initStdIOLoggers();
-  LogWriter vlog("main");
   logParams.setParam("*:stderr:100");
   vlog.info("Starting vncconfig applet");
 #endif
index 0a7128f182548bcb11f7bcc2cbd12afa9a16f1e1..140d82ad13a8d5a23f681700793529c6e931ec87 100644 (file)
@@ -179,13 +179,12 @@ int VNCServerWin32::run() {
   // - Set the address-changed handler for the RFB socket
   rfbSock.setAddressChangeNotifier(this);
 
-  DWORD result = 0;
+  int result = 0;
   try {
     vlog.debug("Entering message loop");
 
     // - Run the server until we're told to quit
     MSG msg;
-    int result = 0;
     while (runServer) {
       result = sockMgr.getMessage(&msg, nullptr, 0, 0);
       if (result < 0)
index ecff85cbe84b9065fe7f10ee48e76b6042438957..a48a173845e3ea4f1d0748cf91a9db4ee77c286a 100644 (file)
@@ -138,8 +138,8 @@ bool NotifyRectangle(RECT* rect) {
   LPARAM l = MAKELONG((SHORT)rect->right, (SHORT)rect->bottom);
   return NotifyHookOwner(WM_HK_RectangleChanged, w, l);
 }
-bool NotifyCursor(HCURSOR cursor) {
-  return NotifyHookOwner(WM_HK_CursorChanged, 0, (LPARAM)cursor);
+bool NotifyCursor(HCURSOR cursor_) {
+  return NotifyHookOwner(WM_HK_CursorChanged, 0, (LPARAM)cursor_);
 }
 
 void ProcessWindowMessage(UINT msg, HWND wnd, WPARAM wParam, LPARAM /*lParam*/) {