Remove more "using namespace" from source files.

This commit is contained in:
dgotwisner 2014-03-31 10:32:27 +02:00 committed by Michael Iedema
parent 66a47d9bff
commit 2b6d0c6fa7
4 changed files with 11 additions and 18 deletions

View File

@ -33,8 +33,6 @@
#include <errno.h>
using namespace std;
int gMutexLogLevel = LOG_INFO; // The mutexes cannot call gConfig or gGetLoggingLevel so we have to get the log level indirectly.
@ -51,13 +49,13 @@ void lockCout()
{
gStreamLock.lock();
Timeval entryTime;
cout << entryTime << " " << pthread_self() << ": ";
std::cout << entryTime << " " << pthread_self() << ": ";
}
void unlockCout()
{
cout << dec << endl << flush;
std::cout << dec << std::endl << flush;
gStreamLock.unlock();
}
@ -71,7 +69,7 @@ void lockCerr()
void unlockCerr()
{
cerr << dec << endl << flush;
cerr << dec << std::endl << flush;
gStreamLock.unlock();
}

View File

@ -27,8 +27,6 @@
#include "Timeval.h"
using namespace std;
void Timeval::future(unsigned offset) // In msecs
{
now();
@ -79,15 +77,15 @@ long Timeval::delta(const Timeval& other) const
ostream& operator<<(ostream& os, const Timeval& tv)
std::ostream& operator<<(std::ostream& os, const Timeval& tv)
{
os.setf( ios::fixed, ios::floatfield );
os.setf( std::ios::fixed, std::ios::floatfield );
os << tv.seconds();
return os;
}
ostream& operator<<(ostream& os, const struct timespec& ts)
std::ostream& operator<<(std::ostream& os, const struct timespec& ts)
{
os << ts.tv_sec << "," << ts.tv_nsec;
return os;

View File

@ -5,13 +5,11 @@
#include <string.h>
#include <ctype.h>
using namespace std;
//based on javascript encodeURIComponent()
string URLEncode(const string &c)
std::string URLEncode(const std::string &c)
{
static const char *digits = "01234567890ABCDEF";
string retVal="";
std::string retVal="";
for (size_t i=0; i<c.length(); i++)
{
const char ch = c[i];

View File

@ -26,7 +26,6 @@
#include "MemoryLeak.h"
namespace Utils {
using namespace std;
// (pat) This definition must be in the .cpp file to anchor the class vtable.
RefCntBase::~RefCntBase() { LOG(DEBUG) << typeid(this).name(); }
@ -78,7 +77,7 @@ void MemStats::text(ostream &os)
void MemStats::memChkNew(MemoryNames memIndex, const char *id)
{
/*cout << "new " #type "\n";*/
/*std::cout << "new " #type "\n";*/
ScopedLock lock(memChkLock);
mMemNow[memIndex]++;
mMemTotal[memIndex]++;
@ -88,7 +87,7 @@ void MemStats::memChkNew(MemoryNames memIndex, const char *id)
void MemStats::memChkDel(MemoryNames memIndex, const char *id)
{
ScopedLock lock(memChkLock);
/*cout << "del " #type "\n";*/
/*std::cout << "del " #type "\n";*/
mMemNow[memIndex]--;
if (mMemNow[memIndex] < 0) {
LOG(ERR) << "Memory reference count underflow on type "<<id;
@ -445,7 +444,7 @@ void printPrettyTable(prettyTable_t &tab, ostream&os, bool tabSeparated)
}
os << "\n";
}
os << endl;
os << std::endl;
}