diff options
author | Pierre Ossman <ossman@cendio.se> | 2024-04-21 02:18:22 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2024-06-24 14:22:35 +0200 |
commit | 12b3f4021641537b90727b23d42de5dff59006cd (patch) | |
tree | d494cda8c019a53989099a44b05aca2e0a4fff8a /unix | |
parent | 4a71ac5bb79e3cd53499255f231c490fc9a5627b (diff) | |
download | tigervnc-12b3f4021641537b90727b23d42de5dff59006cd.tar.gz tigervnc-12b3f4021641537b90727b23d42de5dff59006cd.zip |
Avoid shadowing variables
It's a source of confusion and possibly bugs to reuse the same variable
name for multiple things.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tx/TXDialog.h | 4 | ||||
-rw-r--r-- | unix/vncconfig/QueryConnectDialog.cxx | 4 | ||||
-rw-r--r-- | unix/vncconfig/vncconfig.cxx | 20 |
3 files changed, 14 insertions, 14 deletions
diff --git a/unix/tx/TXDialog.h b/unix/tx/TXDialog.h index 8804e853..720c50d0 100644 --- a/unix/tx/TXDialog.h +++ b/unix/tx/TXDialog.h @@ -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); diff --git a/unix/vncconfig/QueryConnectDialog.cxx b/unix/vncconfig/QueryConnectDialog.cxx index e725de7d..aa1b78ad 100644 --- a/unix/vncconfig/QueryConnectDialog.cxx +++ b/unix/vncconfig/QueryConnectDialog.cxx @@ -25,12 +25,12 @@ #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), diff --git a/unix/vncconfig/vncconfig.cxx b/unix/vncconfig/vncconfig.cxx index 6f1f43dc..ab7c6315 100644 --- a/unix/vncconfig/vncconfig.cxx +++ b/unix/vncconfig/vncconfig.cxx @@ -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) { |