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 /tests | |
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 'tests')
-rw-r--r-- | tests/perf/encperf.cxx | 8 | ||||
-rw-r--r-- | tests/unit/pixelformat.cxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/perf/encperf.cxx b/tests/perf/encperf.cxx index 904363a0..25dca490 100644 --- a/tests/perf/encperf.cxx +++ b/tests/perf/encperf.cxx @@ -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]; diff --git a/tests/unit/pixelformat.cxx b/tests/unit/pixelformat.cxx index a2ca50d0..614d1255 100644 --- a/tests/unit/pixelformat.cxx +++ b/tests/unit/pixelformat.cxx @@ -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 |