1
0
Fork 0

removed `using namespace std`

This commit is contained in:
jsteemann 2016-01-31 18:22:00 +01:00
parent 4b13da836c
commit ae25d2b53b
67 changed files with 80 additions and 142 deletions

View File

@ -30,7 +30,6 @@
#include "Basics/Logger.h"
#include "Rest/HttpRequest.h"
using namespace std;
using namespace arangodb::basics;
////////////////////////////////////////////////////////////////////////////////

View File

@ -25,7 +25,6 @@
using namespace arangodb;
using namespace arangodb::rest;
using namespace std;
ApplicationFeature::ApplicationFeature(std::string const& name)
: _disabled(false), _name(name) {}

View File

@ -45,7 +45,6 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
static std::string DeprecatedParameter;

View File

@ -162,7 +162,15 @@ typedef void* yyscan_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@ -845,7 +853,12 @@ static int input (yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */

View File

@ -37,7 +37,6 @@
#include <velocypack/Iterator.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -32,7 +32,6 @@
#include "Scheduler/Scheduler.h"
#include "Scheduler/PeriodicTask.h"
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -29,7 +29,6 @@
#include "Dispatcher/DispatcherThread.h"
#include "Dispatcher/Job.h"
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -29,7 +29,6 @@
#include "Dispatcher/DispatcherThread.h"
#include "Dispatcher/Job.h"
using namespace std;
using namespace arangodb::rest;
////////////////////////////////////////////////////////////////////////////////
@ -65,7 +64,7 @@ DispatcherQueue::DispatcherQueue(Scheduler* scheduler, Dispatcher* dispatcher,
_jobs(),
_jobPositions(_maxSize) {
// keep a list of all jobs
_jobs = new atomic<Job*>[maxSize];
_jobs = new std::atomic<Job*>[maxSize];
// and a list of positions into this array
for (size_t i = 0; i < maxSize; ++i) {
@ -407,19 +406,18 @@ void DispatcherQueue::removeStartedThread(DispatcherThread* thread) {
////////////////////////////////////////////////////////////////////////////////
bool DispatcherQueue::tooManyThreads() {
size_t nrRunning = _nrRunning.load(memory_order_relaxed);
size_t nrBlocked = (size_t)_nrBlocked.load(memory_order_relaxed);
size_t nrRunning = _nrRunning.load(std::memory_order_relaxed);
size_t nrBlocked = (size_t)_nrBlocked.load(std::memory_order_relaxed);
if ((_nrThreads + nrBlocked) < nrRunning) {
double now = TRI_microtime();
double lastChanged = _lastChanged.load(memory_order_relaxed);
double lastChanged = _lastChanged.load(std::memory_order_relaxed);
if (lastChanged + _gracePeriod < now) {
_lastChanged.store(now, memory_order_relaxed);
_lastChanged.store(now, std::memory_order_relaxed);
return true;
}
return false;
// fall-through
}
return false;
@ -430,8 +428,8 @@ bool DispatcherQueue::tooManyThreads() {
////////////////////////////////////////////////////////////////////////////////
bool DispatcherQueue::notEnoughThreads() {
size_t nrRunning = _nrRunning.load(memory_order_relaxed);
size_t nrBlocked = (size_t)_nrBlocked.load(memory_order_relaxed);
size_t nrRunning = _nrRunning.load(std::memory_order_relaxed);
size_t nrBlocked = (size_t)_nrBlocked.load(std::memory_order_relaxed);
return nrRunning <= _nrThreads - 1 || nrRunning <= nrBlocked;
}

View File

@ -33,7 +33,6 @@
#include <velocypack/Builder.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;
@ -54,7 +53,7 @@ DispatcherThread::DispatcherThread(DispatcherQueue* queue)
? std::string("Std")
: (queue->_id == Dispatcher::AQL_QUEUE
? std::string("Aql")
: ("_" + to_string(queue->_id))))),
: ("_" + std::to_string(queue->_id))))),
_queue(queue) {
allowAsynchronousCancelation();
}
@ -65,7 +64,7 @@ void DispatcherThread::run() {
double grace = 0.2;
// iterate until we are shutting down
while (!_queue->_stopping.load(memory_order_relaxed)) {
while (!_queue->_stopping.load(std::memory_order_relaxed)) {
double now = TRI_microtime();
// drain the job queue
@ -188,7 +187,7 @@ void DispatcherThread::handleJob(Job* job) {
}
} catch (...) {
#ifdef TRI_HAVE_POSIX_THREADS
if (_queue->_stopping.load(memory_order_relaxed)) {
if (_queue->_stopping.load(std::memory_order_relaxed)) {
LOG(WARNING) << "caught cancelation exception during work";
throw;
}
@ -210,7 +209,7 @@ void DispatcherThread::handleJob(Job* job) {
job->cleanup(_queue);
} catch (...) {
#ifdef TRI_HAVE_POSIX_THREADS
if (_queue->_stopping.load(memory_order_relaxed)) {
if (_queue->_stopping.load(std::memory_order_relaxed)) {
LOG(WARNING) << "caught cancelation exception during cleanup";
throw;
}

View File

@ -27,7 +27,6 @@
#include "Dispatcher/Dispatcher.h"
using namespace arangodb::rest;
using namespace std;
namespace {
std::atomic_uint_fast64_t NEXT_JOB_ID(static_cast<uint64_t>(TRI_microtime() *
@ -39,7 +38,7 @@ std::atomic_uint_fast64_t NEXT_JOB_ID(static_cast<uint64_t>(TRI_microtime() *
////////////////////////////////////////////////////////////////////////////////
Job::Job(std::string const& name)
: _jobId(NEXT_JOB_ID.fetch_add(1, memory_order_seq_cst)),
: _jobId(NEXT_JOB_ID.fetch_add(1, std::memory_order_seq_cst)),
_name(name),
_queuePosition((size_t)-1) {}

View File

@ -44,7 +44,6 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
namespace {
class BIOGuard {

View File

@ -29,7 +29,6 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
namespace {
sig_atomic_t MaintenanceMode = 0;
@ -229,7 +228,7 @@ HttpHandler* HttpHandlerFactory::createHandler(HttpRequest* request) {
size_t l = 1;
size_t n = path.find_first_of('/', l);
while (n != string::npos) {
while (n != std::string::npos) {
request->addSuffix(path.substr(l, n - l));
l = n + 1;
n = path.find_first_of('/', l);
@ -250,7 +249,7 @@ HttpHandler* HttpHandlerFactory::createHandler(HttpRequest* request) {
size_t l = prefix.size() + 1;
size_t n = path.find_first_of('/', l);
while (n != string::npos) {
while (n != std::string::npos) {
request->addSuffix(path.substr(l, n - l));
l = n + 1;
n = path.find_first_of('/', l);

View File

@ -35,7 +35,6 @@
using namespace arangodb;
using namespace arangodb::rest;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief constructs a new server job

View File

@ -1339,7 +1339,7 @@ int ContinuousSyncer::followMasterLog(std::string& errorMsg,
bool checkMore = false;
bool active = false;
bool fromIncluded = false;
TRI_voc_tick_t tick;
TRI_voc_tick_t tick = 0;
bool found;
std::string header =

View File

@ -38,7 +38,6 @@
#include <fstream>
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;
using namespace arangodb::rest;
@ -48,7 +47,7 @@ using namespace arangodb::rest;
////////////////////////////////////////////////////////////////////////////////
static void WritePidFile(std::string const& pidFile, int pid) {
ofstream out(pidFile.c_str(), ios::trunc);
std::ofstream out(pidFile.c_str(), std::ios::trunc);
if (!out) {
LOG(FATAL) << "cannot write pid-file '" << pidFile.c_str() << "'"; FATAL_ERROR_EXIT();
@ -69,7 +68,7 @@ static void CheckPidFile(std::string const& pidFile) {
} else if (FileUtils::exists(pidFile) && FileUtils::size(pidFile) > 0) {
LOG(INFO) << "pid-file '" << pidFile.c_str() << "' already exists, verifying pid";
ifstream f(pidFile.c_str());
std::ifstream f(pidFile.c_str());
// file can be opened
if (f) {

View File

@ -31,7 +31,6 @@
#include <velocypack/Dumper.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace arangodb::admin;

View File

@ -33,8 +33,6 @@ using namespace arangodb;
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
RestBatchHandler::RestBatchHandler(HttpRequest* request)
: RestVocbaseBaseHandler(request) {}

View File

@ -35,7 +35,6 @@
using namespace arangodb::admin;
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
RestJobHandler::RestJobHandler(HttpRequest* request,
std::pair<Dispatcher*, AsyncJobManager*>* data)

View File

@ -28,7 +28,6 @@
#include <velocypack/Builder.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::admin;
using namespace arangodb::rest;

View File

@ -94,8 +94,6 @@ using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace arangodb::admin;
using namespace std;
bool ALLOW_USE_DATABASE_IN_REST_ACTIONS;
bool IGNORE_DATAFILE_ERRORS;
@ -432,7 +430,7 @@ void ArangoServer::buildApplicationServer() {
// arangod allows defining a user-specific configuration file. arangosh and
// the other binaries don't
_applicationServer->setUserConfigFile(
".arango" + string(1, TRI_DIR_SEPARATOR_CHAR) + string(conf));
".arango" + std::string(1, TRI_DIR_SEPARATOR_CHAR) + std::string(conf));
// initialize the server's write ahead log
wal::LogfileManager::initialize(&_databasePath, _server);
@ -1235,8 +1233,8 @@ int ArangoServer::startupServer() {
closeDatabases();
if (mode == OperationMode::MODE_CONSOLE) {
cout << endl
<< TRI_BYE_MESSAGE << endl;
std::cout << std::endl
<< TRI_BYE_MESSAGE << std::endl;
}
TRI_ShutdownStatistics();

View File

@ -38,9 +38,7 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace arangodb;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief the line editor object for use in debugging

View File

@ -35,7 +35,6 @@
#include "Scheduler/SchedulerLibev.h"
#include "Scheduler/SignalTask.h"
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;
@ -397,7 +396,7 @@ bool ApplicationScheduler::afterOptionParsing(
// show io backends
if (options.has("show-io-backends")) {
std::cout << "available io backends are: "
<< SchedulerLibev::availableBackends() << endl;
<< SchedulerLibev::availableBackends() << std::endl;
TRI_EXIT_FUNCTION(EXIT_SUCCESS, nullptr);
}

View File

@ -29,7 +29,6 @@
#include <velocypack/Builder.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::rest;
PeriodicTask::PeriodicTask(std::string const& id, double offset,

View File

@ -40,7 +40,6 @@
#include <velocypack/Builder.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -31,7 +31,6 @@
#include <velocypack/velocypack-aliases.h>
using namespace arangodb::rest;
using namespace std;
namespace {
std::atomic_uint_fast64_t NEXT_TASK_ID(static_cast<uint64_t>(TRI_microtime() *
@ -44,7 +43,7 @@ std::atomic_uint_fast64_t NEXT_TASK_ID(static_cast<uint64_t>(TRI_microtime() *
Task::Task(std::string const& id, std::string const& name)
: _scheduler(nullptr),
_taskId(NEXT_TASK_ID.fetch_add(1, memory_order_seq_cst)),
_taskId(NEXT_TASK_ID.fetch_add(1, std::memory_order_seq_cst)),
_loop(0), // TODO(fc) XXX this should be an "invalid" marker!
_id(id),
_name(name) {}

View File

@ -31,7 +31,6 @@
#include <velocypack/Builder.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -62,9 +62,7 @@
using namespace arangodb;
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief reload the routing cache

View File

@ -32,7 +32,6 @@
#include "VocBase/KeyGenerator.h"
#include "VocBase/VocShaper.h"
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;
using namespace arangodb::traverser;
@ -78,20 +77,20 @@ class MultiCollectionEdgeExpander {
/// @brief function to check if the edge passes the filter
//////////////////////////////////////////////////////////////////////////////
function<bool(EdgeId&, TRI_doc_mptr_copy_t*)> _isAllowed;
std::function<bool(EdgeId&, TRI_doc_mptr_copy_t*)> _isAllowed;
//////////////////////////////////////////////////////////////////////////////
/// @brief function to check if the vertex passes the filter
//////////////////////////////////////////////////////////////////////////////
function<bool(VertexId&)> _isAllowedVertex;
std::function<bool(VertexId&)> _isAllowedVertex;
public:
MultiCollectionEdgeExpander(
TRI_edge_direction_e const& direction,
std::vector<EdgeCollectionInfo*> const& edgeCollections,
function<bool(EdgeId&, TRI_doc_mptr_copy_t*)> isAllowed,
function<bool(VertexId&)> isAllowedVertex)
std::function<bool(EdgeId&, TRI_doc_mptr_copy_t*)> isAllowed,
std::function<bool(VertexId&)> isAllowedVertex)
: _direction(direction),
_edgeCollections(edgeCollections),
_isAllowed(isAllowed),
@ -99,7 +98,7 @@ class MultiCollectionEdgeExpander {
void operator()(VertexId& source,
std::vector<ArangoDBPathFinder::Step*>& result) {
equal_to<VertexId> eq;
std::equal_to<VertexId> eq;
for (auto const& edgeCollection : _edgeCollections) {
TRI_ASSERT(edgeCollection != nullptr);
@ -164,7 +163,7 @@ class SimpleEdgeExpander {
TRI_ASSERT(_edgeCollection != nullptr);
auto edges = _edgeCollection->getEdges(_direction, source);
equal_to<VertexId> eq;
std::equal_to<VertexId> eq;
std::unordered_map<VertexId, size_t> candidates;
for (size_t j = 0; j < edges.size(); ++j) {
VertexId from = ExtractFromId(edges[j]);
@ -424,8 +423,8 @@ TRI_RunSimpleShortestPathSearch(
auto fwExpander =
[&collectionInfos, forward](VertexId& v, std::vector<EdgeId>& res_edges,
vector<VertexId>& neighbors) {
equal_to<VertexId> eq;
std::vector<VertexId>& neighbors) {
std::equal_to<VertexId> eq;
for (auto const& edgeCollection : collectionInfos) {
TRI_ASSERT(edgeCollection != nullptr);
auto edges = edgeCollection->getEdges(forward, v);
@ -447,8 +446,8 @@ TRI_RunSimpleShortestPathSearch(
};
auto bwExpander =
[&collectionInfos, backward](VertexId& v, std::vector<EdgeId>& res_edges,
vector<VertexId>& neighbors) {
equal_to<VertexId> eq;
std::vector<VertexId>& neighbors) {
std::equal_to<VertexId> eq;
for (auto const& edgeCollection : collectionInfos) {
TRI_ASSERT(edgeCollection != nullptr);
auto edges = edgeCollection->getEdges(backward, v);

View File

@ -32,7 +32,6 @@
#include "V8/v8-utils.h"
#include "VocBase/VocShaper.h"
using namespace std;
using namespace arangodb::basics;
// #define DEBUG_JSON_SHAPER 1

View File

@ -23,7 +23,6 @@
#include "Legends.h"
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;

View File

@ -38,8 +38,6 @@
// #define DEBUG_DATAFILE 1
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief return whether the datafile is a physical file (true) or an
/// anonymous mapped region (false)

View File

@ -61,8 +61,6 @@
#include <velocypack/Parser.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief sleep interval used when polling for a loading collection's status
////////////////////////////////////////////////////////////////////////////////

View File

@ -23,7 +23,6 @@
#include "Exceptions.h"
using namespace std;
using namespace arangodb::basics;
////////////////////////////////////////////////////////////////////////////////

View File

@ -47,8 +47,6 @@
#endif
using namespace std;
namespace arangodb {
namespace basics {
namespace FileUtils {
@ -539,7 +537,7 @@ off_t size(std::string const& path) {
std::string stripExtension(std::string const& path,
std::string const& extension) {
size_t pos = path.rfind(extension);
if (pos == string::npos) {
if (pos == std::string::npos) {
return path;
}

View File

@ -25,7 +25,6 @@
#include "Basics/conversions.h"
#include "Basics/StringBuffer.h"
using namespace std;
using namespace arangodb::basics;
////////////////////////////////////////////////////////////////////////////////

View File

@ -31,7 +31,6 @@
#include "Basics/RandomGenerator.h"
#include "Basics/StringUtils.h"
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;
@ -188,7 +187,7 @@ bool checkAndMark(uint32_t timestamp, uint64_t random) {
return 0 < proofs;
}
vector<Statistics> statistics() {
std::vector<Statistics> statistics() {
MUTEX_LOCKER(mutexLocker, MutexNonce);
int const N = 4;

View File

@ -28,7 +28,6 @@
#include "Basics/tri-strings.h"
#include "ProgramOptions/program-options.h"
using namespace std;
using namespace arangodb::basics;
////////////////////////////////////////////////////////////////////////////////

View File

@ -29,7 +29,6 @@
#include <iterator>
using namespace std;
using namespace arangodb::basics;
ProgramOptionsDescription::ProgramOptionsDescription()
@ -201,7 +200,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_stringOptions[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = (value->empty()) ? "" : ("\"" + *value + "\"");
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return ((std::string*)p)->empty() ? "" : "\"" + (*(std::string*)p) + "\"";
};
_values[name] = (void*)value;
@ -223,7 +222,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_vectorStringOptions[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = value->empty() ? "" : StringUtils::join(*value, ", ");
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return ((std::vector<std::string>*)p)->empty()
? ""
: "\"" + StringUtils::join(*(std::vector<std::string>*)p, " ,") +
@ -247,7 +246,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_int32Options[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = StringUtils::itoa(*value);
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : StringUtils::itoa(*(int32_t*)p);
};
_values[name] = (void*)value;
@ -286,7 +285,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_int64Options[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = StringUtils::itoa(*value);
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : StringUtils::itoa(*(int64_t*)p);
};
_values[name] = (void*)value;
@ -325,7 +324,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_uint32Options[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = StringUtils::itoa(*value);
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : StringUtils::itoa(*(uint32_t*)p);
};
_values[name] = (void*)value;
@ -364,7 +363,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_uint64Options[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = StringUtils::itoa(*value);
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : StringUtils::itoa(*(uint64_t*)p);
};
_values[name] = (void*)value;
@ -403,7 +402,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_doubleOptions[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = StringUtils::ftoa(*value);
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : StringUtils::ftoa(*(double*)p);
};
_values[name] = (void*)value;
@ -442,8 +441,8 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_boolOptions[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = (*value ? "true" : "false");
_currentTexts[name] = [](void* p) -> string {
return p == nullptr ? "" : string(((*(bool*)p) ? "true" : "false"));
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : std::string(((*(bool*)p) ? "true" : "false"));
};
_values[name] = (void*)value;
@ -465,7 +464,7 @@ ProgramOptionsDescription& ProgramOptionsDescription::operator()(
_timeOptions[name] = value;
_helpTexts[name] = text;
_defaultTexts[name] = StringUtils::itoa((int64_t)*value);
_currentTexts[name] = [](void* p) -> string {
_currentTexts[name] = [](void* p) -> std::string {
return p == nullptr ? "" : StringUtils::itoa((int64_t)(*(time_t*)p));
};
_values[name] = (void*)value;

View File

@ -32,7 +32,6 @@
#include <random>
#include <chrono>
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;

View File

@ -31,8 +31,6 @@
#include "Basics/tri-strings.h"
#include "Basics/StringBuffer.h"
using namespace std;
// -----------------------------------------------------------------------------
// helper functions
// -----------------------------------------------------------------------------
@ -1127,7 +1125,7 @@ std::string replace(std::string const& sourceStr, std::string const& fromStr,
}
// the max amount of memory is:
size_t mt = max(static_cast<size_t>(1), toLength);
size_t mt = (std::max)(static_cast<size_t>(1), toLength);
if ((sourceLength / fromLength) + 1 >= (SIZE_MAX - toLength) / mt) {
THROW_ARANGO_EXCEPTION(TRI_ERROR_OUT_OF_MEMORY);
@ -1137,7 +1135,7 @@ std::string replace(std::string const& sourceStr, std::string const& fromStr,
// the min amount of memory we have to allocate for the "replace" (new) string
// is length of sourceStr
maxLength = max(maxLength, sourceLength) + 1;
maxLength = (std::max)(maxLength, sourceLength) + 1;
char* result = new char[maxLength];
size_t k = 0;

View File

@ -37,7 +37,6 @@
#endif
using namespace arangodb::basics;
using namespace std;
Utf8Helper Utf8Helper::DefaultUtf8Helper;

View File

@ -27,7 +27,6 @@
#include <openssl/err.h>
using namespace arangodb::basics;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief creates an SSL context

View File

@ -37,7 +37,6 @@
#include "Basics/StringUtils.h"
#include "Basics/tri-strings.h"
using namespace std;
using namespace arangodb::basics;
// .............................................................................

View File

@ -31,8 +31,6 @@
#include "Basics/StringBuffer.h"
#include "Basics/tri-strings.h"
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief description of a double
////////////////////////////////////////////////////////////////////////////////

View File

@ -33,7 +33,6 @@
#include "Rest/EndpointIpV4.h"
#include "Rest/EndpointIpV6.h"
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;
@ -41,9 +40,9 @@ using namespace arangodb::rest;
/// @brief create an endpoint
////////////////////////////////////////////////////////////////////////////////
Endpoint::Endpoint(const Endpoint::EndpointType type,
const Endpoint::DomainType domainType,
const Endpoint::EncryptionType encryption,
Endpoint::Endpoint(Endpoint::EndpointType type,
Endpoint::DomainType domainType,
Endpoint::EncryptionType encryption,
std::string const& specification, int listenBacklog)
: _connected(false),
_type(type),
@ -117,13 +116,13 @@ std::string Endpoint::getUnifiedForm(std::string const& specification) {
if (temp[0] == '[') {
// ipv6
found = temp.find("]:", 1);
if (found != string::npos && found > 2 && found + 2 < temp.size()) {
if (found != std::string::npos && found > 2 && found + 2 < temp.size()) {
// hostname and port (e.g. [address]:port)
return copy;
}
found = temp.find("]", 1);
if (found != string::npos && found > 2 && found + 1 == temp.size()) {
if (found != std::string::npos && found > 2 && found + 1 == temp.size()) {
// hostname only (e.g. [address])
return copy + ":" + StringUtils::itoa(EndpointIp::_defaultPort);
}
@ -135,7 +134,7 @@ std::string Endpoint::getUnifiedForm(std::string const& specification) {
// ipv4
found = temp.find(':');
if (found != string::npos && found + 1 < temp.size()) {
if (found != std::string::npos && found + 1 < temp.size()) {
// hostname and port
return copy;
}
@ -191,7 +190,7 @@ Endpoint* Endpoint::factory(const Endpoint::EndpointType type,
// read protocol from string
size_t found = copy.find('@');
if (found != string::npos) {
if (found != std::string::npos) {
std::string protoString = StringUtils::tolower(copy.substr(0, found));
if (protoString == "http") {
copy = copy.substr(strlen("http@"));
@ -233,7 +232,7 @@ Endpoint* Endpoint::factory(const Endpoint::EndpointType type,
if (copy[0] == '[') {
// ipv6
found = copy.find("]:", 1);
if (found != string::npos && found > 2 && found + 2 < copy.size()) {
if (found != std::string::npos && found > 2 && found + 2 < copy.size()) {
// hostname and port (e.g. [address]:port)
uint16_t port = (uint16_t)StringUtils::uint32(copy.substr(found + 2));
std::string portStr = copy.substr(1, found - 1);
@ -242,7 +241,7 @@ Endpoint* Endpoint::factory(const Endpoint::EndpointType type,
}
found = copy.find("]", 1);
if (found != string::npos && found > 2 && found + 1 == copy.size()) {
if (found != std::string::npos && found > 2 && found + 1 == copy.size()) {
// hostname only (e.g. [address])
std::string portStr = copy.substr(1, found - 1);
return new EndpointIpV6(type, encryption, specification, listenBacklog,
@ -256,7 +255,7 @@ Endpoint* Endpoint::factory(const Endpoint::EndpointType type,
// ipv4
found = copy.find(':');
if (found != string::npos && found + 1 < copy.size()) {
if (found != std::string::npos && found + 1 < copy.size()) {
// hostname and port
uint16_t port = (uint16_t)StringUtils::uint32(copy.substr(found + 1));
std::string portStr = copy.substr(0, found);

View File

@ -74,7 +74,7 @@ class Endpoint {
/// @brief creates an endpoint
//////////////////////////////////////////////////////////////////////////////
Endpoint(const EndpointType, const DomainType, const EncryptionType,
Endpoint(EndpointType, DomainType, EncryptionType,
std::string const&, int);
public:

View File

@ -25,7 +25,6 @@
#include "Basics/Logger.h"
#include "Basics/StringUtils.h"
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -35,7 +35,6 @@
#include <velocypack/Parser.h>
#include <velocypack/velocypack-aliases.h>
using namespace std;
using namespace arangodb::basics;
using namespace arangodb::rest;

View File

@ -28,7 +28,6 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief batch error count header

View File

@ -32,7 +32,6 @@
#include "Basics/RandomGenerator.h"
#include "Basics/StringUtils.h"
using namespace std;
using namespace arangodb::basics;
// -----------------------------------------------------------------------------

View File

@ -34,6 +34,7 @@
#include <openssl/ssl.h>
#include <sstream>
#include <velocypack/Builder.h>
#include <velocypack/Version.h>
#include <velocypack/velocypack-aliases.h>

View File

@ -54,7 +54,6 @@
using namespace arangodb::basics;
using namespace arangodb::httpclient;
using namespace arangodb::rest;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new client connection

View File

@ -25,7 +25,6 @@
#include "Basics/ReadLocker.h"
#include "Basics/WriteLocker.h"
using namespace std;
using namespace arangodb::httpclient;
using namespace arangodb::rest;

View File

@ -28,7 +28,6 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace arangodb::httpclient;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new client connection

View File

@ -31,7 +31,6 @@
using namespace arangodb::basics;
using namespace arangodb::rest;
using namespace std;
namespace arangodb {
namespace httpclient {

View File

@ -29,7 +29,6 @@
#include <velocypack/velocypack-aliases.h>
using namespace arangodb::basics;
using namespace std;
namespace arangodb {
namespace httpclient {

View File

@ -61,7 +61,6 @@
using namespace arangodb::basics;
using namespace arangodb::httpclient;
using namespace arangodb::rest;
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new client connection

View File

@ -25,7 +25,6 @@
#include <iostream>
using namespace std;
using namespace arangodb;
DummyShell::DummyShell(std::string const& history, Completer* completer)
@ -52,12 +51,12 @@ void DummyShell::addHistory(std::string const&) {}
bool DummyShell::writeHistory() { return true; }
std::string DummyShell::getLine(std::string const& prompt, bool& eof) {
std::cout << prompt << flush;
std::cout << prompt << std::flush;
std::string line;
getline(cin, line);
std::getline(std::cin, line);
if (cin.eof()) {
if (std::cin.eof()) {
eof = true;
return "";
}

View File

@ -25,8 +25,6 @@
#include "Utilities/ShellBase.h"
using namespace std;
using namespace arangodb;
using namespace arangodb;
////////////////////////////////////////////////////////////////////////////////

View File

@ -29,7 +29,6 @@ extern "C" {
#include "Utilities/Completer.h"
using namespace std;
using namespace arangodb;
////////////////////////////////////////////////////////////////////////////////

View File

@ -28,7 +28,6 @@
#include "Basics/tri-strings.h"
#include "Basics/StringUtils.h"
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;

View File

@ -32,7 +32,6 @@
#include "Utilities/LinenoiseShell.h"
#endif
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;
@ -137,7 +136,7 @@ std::string ShellBase::prompt(std::string const& prompt,
++lineno;
// remove any prompt at the beginning of the line
size_t pos = string::npos;
size_t pos = std::string::npos;
if (StringUtils::isPrefix(line, plain)) {
pos = line.find('>');
@ -145,10 +144,10 @@ std::string ShellBase::prompt(std::string const& prompt,
pos = line.find('>');
}
if (pos != string::npos) {
if (pos != std::string::npos) {
pos = line.find_first_not_of(" \t", pos + 1);
if (pos != string::npos) {
if (pos != std::string::npos) {
line = line.substr(pos);
} else {
line.clear();

View File

@ -27,7 +27,6 @@
#include "Basics/StringUtils.h"
#include "V8/v8-utils.h"
using namespace std;
using namespace arangodb;
using namespace arangodb::basics;

View File

@ -29,7 +29,6 @@
#include "Utilities/ShellBase.h"
#include "V8/v8-utils.h"
using namespace std;
using namespace arangodb;
using namespace arangodb;

View File

@ -53,8 +53,6 @@
#include "V8/v8-globals.h"
#include "V8/v8-utils.h"
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief safety overhead for buffer allocations
////////////////////////////////////////////////////////////////////////////////

View File

@ -29,7 +29,6 @@
#include "Basics/tri-strings.h"
#include "V8/v8-utils.h"
using namespace std;
using namespace arangodb::basics;
////////////////////////////////////////////////////////////////////////////////

View File

@ -34,8 +34,6 @@
#include <fstream>
using namespace std;
////////////////////////////////////////////////////////////////////////////////
/// @brief begins a new CSV line
////////////////////////////////////////////////////////////////////////////////
@ -241,13 +239,13 @@ static void JS_ProcessJsonFile(
// read and convert
std::string line;
ifstream file(*filename);
std::ifstream file(*filename);
if (file.is_open()) {
size_t row = 0;
while (file.good()) {
getline(file, line);
std::getline(file, line);
char const* ptr = line.c_str();
char const* end = ptr + line.length();