From 92056dc8f4895524f999bb585de461f52f2dffe6 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 13 Aug 2024 15:36:10 +0200 Subject: [PATCH] Avoid using excessive namespaces Try to be more clear about what things are external to the current context, and what aren't. --- common/rfb/CSecurityVeNCrypt.cxx | 8 +++----- common/rfb/PixelBuffer.cxx | 1 - common/rfb/SSecurityVeNCrypt.cxx | 4 +--- common/rfb/Security.cxx | 5 ++--- common/rfb/SecurityClient.cxx | 3 +-- common/rfb/SecurityServer.cxx | 3 +-- 6 files changed, 8 insertions(+), 16 deletions(-) diff --git a/common/rfb/CSecurityVeNCrypt.cxx b/common/rfb/CSecurityVeNCrypt.cxx index d6354976..3ebb3855 100644 --- a/common/rfb/CSecurityVeNCrypt.cxx +++ b/common/rfb/CSecurityVeNCrypt.cxx @@ -37,8 +37,6 @@ #include using namespace rfb; -using namespace rdr; -using namespace std; static LogWriter vlog("CVeNCrypt"); @@ -68,8 +66,8 @@ CSecurityVeNCrypt::~CSecurityVeNCrypt() bool CSecurityVeNCrypt::processMsg() { - InStream* is = cc->getInStream(); - OutStream* os = cc->getOutStream(); + rdr::InStream* is = cc->getInStream(); + rdr::OutStream* os = cc->getOutStream(); /* get major, minor versions, send what we can support (or 0.0 for can't support it) */ if (!haveRecvdMajorVersion) { @@ -159,7 +157,7 @@ bool CSecurityVeNCrypt::processMsg() if (!haveChosenType) { chosenType = secTypeInvalid; uint8_t i; - list secTypes; + std::list secTypes; secTypes = security->GetEnabledExtSecTypes(); diff --git a/common/rfb/PixelBuffer.cxx b/common/rfb/PixelBuffer.cxx index f1354a43..0a287544 100644 --- a/common/rfb/PixelBuffer.cxx +++ b/common/rfb/PixelBuffer.cxx @@ -33,7 +33,6 @@ #include using namespace rfb; -using namespace rdr; static LogWriter vlog("PixelBuffer"); diff --git a/common/rfb/SSecurityVeNCrypt.cxx b/common/rfb/SSecurityVeNCrypt.cxx index 27ee1fe2..164ea927 100644 --- a/common/rfb/SSecurityVeNCrypt.cxx +++ b/common/rfb/SSecurityVeNCrypt.cxx @@ -33,8 +33,6 @@ #include using namespace rfb; -using namespace rdr; -using namespace std; static LogWriter vlog("SVeNCrypt"); @@ -120,7 +118,7 @@ bool SSecurityVeNCrypt::processMsg() * followed by authentication types (uint32_t:s) */ if (!haveSentTypes) { - list listSubTypes; + std::list listSubTypes; listSubTypes = security->GetEnabledExtSecTypes(); diff --git a/common/rfb/Security.cxx b/common/rfb/Security.cxx index 01191c65..3b0d95bf 100644 --- a/common/rfb/Security.cxx +++ b/common/rfb/Security.cxx @@ -30,7 +30,6 @@ #include using namespace rfb; -using namespace std; static LogWriter vlog("Security"); @@ -51,7 +50,7 @@ Security::Security(StringParameter &secTypes) const std::list Security::GetEnabledSecTypes(void) { - list result; + std::list result; /* Partial workaround for Vino's stupid behaviour. It doesn't allow * the basic authentication types as part of the VeNCrypt handshake, @@ -74,7 +73,7 @@ const std::list Security::GetEnabledSecTypes(void) const std::list Security::GetEnabledExtSecTypes(void) { - list result; + std::list result; for (uint32_t type : enabledSecTypes) if (type != secTypeVeNCrypt) /* Do not include VeNCrypt type to avoid loops */ diff --git a/common/rfb/SecurityClient.cxx b/common/rfb/SecurityClient.cxx index 63e0cadc..d1507eb5 100644 --- a/common/rfb/SecurityClient.cxx +++ b/common/rfb/SecurityClient.cxx @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #ifdef HAVE_GNUTLS #include @@ -38,7 +38,6 @@ #include #endif -using namespace rdr; using namespace rfb; UserPasswdGetter *CSecurity::upg = nullptr; diff --git a/common/rfb/SecurityServer.cxx b/common/rfb/SecurityServer.cxx index 3e23a89d..b5297736 100644 --- a/common/rfb/SecurityServer.cxx +++ b/common/rfb/SecurityServer.cxx @@ -21,7 +21,7 @@ #include #endif -#include +#include #include #include #include @@ -35,7 +35,6 @@ #include #endif -using namespace rdr; using namespace rfb; StringParameter SecurityServer::secTypes -- 2.39.5