Skip to content

Commit

Permalink
Avoid using excessive namespaces
Browse files Browse the repository at this point in the history
Try to be more clear about what things are external to the current
context, and what aren't.
  • Loading branch information
CendioOssman committed Aug 13, 2024
1 parent bcaaea7 commit 92056dc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
8 changes: 3 additions & 5 deletions common/rfb/CSecurityVeNCrypt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@
#include <rfb/LogWriter.h>

using namespace rfb;
using namespace rdr;
using namespace std;

static LogWriter vlog("CVeNCrypt");

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -159,7 +157,7 @@ bool CSecurityVeNCrypt::processMsg()
if (!haveChosenType) {
chosenType = secTypeInvalid;
uint8_t i;
list<uint32_t> secTypes;
std::list<uint32_t> secTypes;

secTypes = security->GetEnabledExtSecTypes();

Expand Down
1 change: 0 additions & 1 deletion common/rfb/PixelBuffer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <rfb/PixelBuffer.h>

using namespace rfb;
using namespace rdr;

static LogWriter vlog("PixelBuffer");

Expand Down
4 changes: 1 addition & 3 deletions common/rfb/SSecurityVeNCrypt.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
#include <rdr/OutStream.h>

using namespace rfb;
using namespace rdr;
using namespace std;

static LogWriter vlog("SVeNCrypt");

Expand Down Expand Up @@ -120,7 +118,7 @@ bool SSecurityVeNCrypt::processMsg()
* followed by authentication types (uint32_t:s)
*/
if (!haveSentTypes) {
list<uint32_t> listSubTypes;
std::list<uint32_t> listSubTypes;

listSubTypes = security->GetEnabledExtSecTypes();

Expand Down
5 changes: 2 additions & 3 deletions common/rfb/Security.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include <rfb/util.h>

using namespace rfb;
using namespace std;

static LogWriter vlog("Security");

Expand All @@ -51,7 +50,7 @@ Security::Security(StringParameter &secTypes)

const std::list<uint8_t> Security::GetEnabledSecTypes(void)
{
list<uint8_t> result;
std::list<uint8_t> result;

/* Partial workaround for Vino's stupid behaviour. It doesn't allow
* the basic authentication types as part of the VeNCrypt handshake,
Expand All @@ -74,7 +73,7 @@ const std::list<uint8_t> Security::GetEnabledSecTypes(void)

const std::list<uint32_t> Security::GetEnabledExtSecTypes(void)
{
list<uint32_t> result;
std::list<uint32_t> result;

for (uint32_t type : enabledSecTypes)
if (type != secTypeVeNCrypt) /* Do not include VeNCrypt type to avoid loops */
Expand Down
3 changes: 1 addition & 2 deletions common/rfb/SecurityClient.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include <rfb/CSecurityVeNCrypt.h>
#include <rfb/CSecurityVncAuth.h>
#include <rfb/CSecurityPlain.h>
#include <rdr/Exception.h>
#include <rfb/Exception.h>
#include <rfb/Security.h>
#ifdef HAVE_GNUTLS
#include <rfb/CSecurityTLS.h>
Expand All @@ -38,7 +38,6 @@
#include <rfb/CSecurityMSLogonII.h>
#endif

using namespace rdr;
using namespace rfb;

UserPasswdGetter *CSecurity::upg = nullptr;
Expand Down
3 changes: 1 addition & 2 deletions common/rfb/SecurityServer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <config.h>
#endif

#include <rdr/Exception.h>
#include <rfb/Exception.h>
#include <rfb/Security.h>
#include <rfb/SSecurityNone.h>
#include <rfb/SSecurityStack.h>
Expand All @@ -35,7 +35,6 @@
#include <rfb/SSecurityRSAAES.h>
#endif

using namespace rdr;
using namespace rfb;

StringParameter SecurityServer::secTypes
Expand Down

0 comments on commit 92056dc

Please sign in to comment.