got rid of the STD_SHARED_XX std/tr1 defines

This commit is contained in:
Jean-Francois Dockes
2016-07-13 15:12:25 +02:00
parent 0e0b660ebc
commit 0b0385e459
65 changed files with 219 additions and 257 deletions
+6 -6
View File
@@ -30,7 +30,7 @@
#include <zlib.h>
#include "chrono.h"
#include MEMORY_INCLUDE
#include <memory>
#ifndef _WIN32
@@ -1353,8 +1353,8 @@ static bool inflateToDynBuf(void* inp, UINT inlen, void **outpp, UINT *outlenp)
}
// Copy all entries from occ to ncc. Both are already open.
static bool copyall(STD_SHARED_PTR<CirCache> occ,
STD_SHARED_PTR<CirCache> ncc, int& nentries,
static bool copyall(std::shared_ptr<CirCache> occ,
std::shared_ptr<CirCache> ncc, int& nentries,
ostringstream& msg)
{
bool eof = false;
@@ -1399,7 +1399,7 @@ int CirCache::append(const string ddir, const string& sdir, string *reason)
{
ostringstream msg;
// Open source file
STD_SHARED_PTR<CirCache> occ(new CirCache(sdir));
std::shared_ptr<CirCache> occ(new CirCache(sdir));
if (!occ->open(CirCache::CC_OPREAD)) {
if (reason) {
msg << "Open failed in " << sdir << " : " <<
@@ -1409,7 +1409,7 @@ int CirCache::append(const string ddir, const string& sdir, string *reason)
return -1;
}
// Open dest file
STD_SHARED_PTR<CirCache> ncc(new CirCache(ddir));
std::shared_ptr<CirCache> ncc(new CirCache(ddir));
if (!ncc->open(CirCache::CC_OPWRITE)) {
if (reason) {
msg << "Open failed in " << ddir << " : " <<
@@ -1444,7 +1444,7 @@ int CirCache::append(const string ddir, const string& sdir, string *reason)
#include <string>
#include <iostream>
#include MEMORY_INCLUDE
#include <memory>
#include "circache.h"
#include "fileudi.h"
+6 -6
View File
@@ -77,10 +77,10 @@ public:
string m_stderrFile;
// Pipe for data going to the command
int m_pipein[2];
STD_SHARED_PTR<NetconCli> m_tocmd;
std::shared_ptr<NetconCli> m_tocmd;
// Pipe for data coming out
int m_pipeout[2];
STD_SHARED_PTR<NetconCli> m_fromcmd;
std::shared_ptr<NetconCli> m_fromcmd;
// Subprocess id
pid_t m_pid;
// Saved sigmask
@@ -642,14 +642,14 @@ int ExecCmd::startExec(const string& cmd, const vector<string>& args,
m->m_pipein[0] = -1;
NetconCli *iclicon = new NetconCli();
iclicon->setconn(m->m_pipein[1]);
m->m_tocmd = STD_SHARED_PTR<NetconCli>(iclicon);
m->m_tocmd = std::shared_ptr<NetconCli>(iclicon);
}
if (has_output) {
close(m->m_pipeout[1]);
m->m_pipeout[1] = -1;
NetconCli *oclicon = new NetconCli();
oclicon->setconn(m->m_pipeout[0]);
m->m_fromcmd = STD_SHARED_PTR<NetconCli>(oclicon);
m->m_fromcmd = std::shared_ptr<NetconCli>(oclicon);
}
/* Don't want to undo what we just did ! */
@@ -757,7 +757,7 @@ int ExecCmd::doexec(const string& cmd, const vector<string>& args,
LOGERR("ExecCmd::doexec: no connection from command\n");
return -1;
}
oclicon->setcallback(STD_SHARED_PTR<NetconWorker>
oclicon->setcallback(std::shared_ptr<NetconWorker>
(new ExecReader(output, m->m_advise)));
myloop.addselcon(m->m_fromcmd, Netcon::NETCONPOLL_READ);
// Give up ownership
@@ -770,7 +770,7 @@ int ExecCmd::doexec(const string& cmd, const vector<string>& args,
LOGERR("ExecCmd::doexec: no connection from command\n");
return -1;
}
iclicon->setcallback(STD_SHARED_PTR<NetconWorker>
iclicon->setcallback(std::shared_ptr<NetconWorker>
(new ExecWriter(input, m->m_provide, m)));
myloop.addselcon(m->m_tocmd, Netcon::NETCONPOLL_WRITE);
// Give up ownership
+4 -4
View File
@@ -1208,8 +1208,8 @@ int trycli(char *host, char *serv)
}
}
#else
STD_SHARED_PTR<NetconWorker> worker =
STD_SHARED_PTR<NetconWorker>(new CliNetconWorker());
std::shared_ptr<NetconWorker> worker =
std::shared_ptr<NetconWorker>(new CliNetconWorker());
clicon->setcallback(worker);
SelectLoop myloop;
myloop.addselcon(con, Netcon::NETCONPOLL_WRITE);
@@ -1274,8 +1274,8 @@ protected:
if (con == 0) {
return -1;
}
STD_SHARED_PTR<NetconWorker> worker =
STD_SHARED_PTR<NetconWorker>(new ServNetconWorker());
std::shared_ptr<NetconWorker> worker =
std::shared_ptr<NetconWorker>(new ServNetconWorker());
con->setcallback(worker);
m_loop.addselcon(NetconP(con), NETCONPOLL_READ);
return 1;
+4 -4
View File
@@ -26,7 +26,7 @@
#include <map>
#include <string>
#include MEMORY_INCLUDE
#include <memory>
/// A set of classes to manage client-server communication over a
/// connection-oriented network, or a pipe.
@@ -43,7 +43,7 @@
/// Base class for all network endpoints:
class Netcon;
typedef STD_SHARED_PTR<Netcon> NetconP;
typedef std::shared_ptr<Netcon> NetconP;
class SelectLoop;
class Netcon {
@@ -246,7 +246,7 @@ public:
virtual int getline(char *buf, int cnt, int timeo = -1);
/// Set handler to be called when the connection is placed in the
/// selectloop and an event occurs.
virtual void setcallback(STD_SHARED_PTR<NetconWorker> user) {
virtual void setcallback(std::shared_ptr<NetconWorker> user) {
m_user = user;
}
@@ -255,7 +255,7 @@ private:
char *m_bufbase; // Pointer to current 1st byte of useful data
int m_bufbytes; // Bytes of data.
int m_bufsize; // Total buffer size
STD_SHARED_PTR<NetconWorker> m_user;
std::shared_ptr<NetconWorker> m_user;
virtual int cando(Netcon::Event reason); // Selectloop slot
};
+2 -2
View File
@@ -23,7 +23,7 @@
#include <map>
#include <string>
#include MEMORY_INCLUDE
#include <memory>
extern void rclutil_init_mt();
@@ -70,7 +70,7 @@ private:
bool m_noremove;
};
typedef STD_SHARED_PTR<TempFileInternal> TempFile;
typedef std::shared_ptr<TempFileInternal> TempFile;
/// Temporary directory class. Recursively deleted by destructor.
class TempDir {
+6 -6
View File
@@ -42,8 +42,8 @@
#include <string>
#include <iostream>
#include <list>
#include UNORDERED_MAP_INCLUDE
#include UNORDERED_SET_INCLUDE
#include <unordered_map>
#include <unordered_set>
#include "smallut.h"
@@ -323,8 +323,8 @@ template bool stringToStrings<vector<string> >(const string&,
vector<string>&, const string&);
template bool stringToStrings<set<string> >(const string&,
set<string>&, const string&);
template bool stringToStrings<STD_UNORDERED_SET<string> >
(const string&, STD_UNORDERED_SET<string>&, const string&);
template bool stringToStrings<std::unordered_set<string> >
(const string&, std::unordered_set<string>&, const string&);
template <class T> void stringsToString(const T& tokens, string& s)
{
@@ -1195,14 +1195,14 @@ static const string cstr_cp1252("CP1252");
string langtocode(const string& lang)
{
static STD_UNORDERED_MAP<string, string> lang_to_code;
static std::unordered_map<string, string> lang_to_code;
if (lang_to_code.empty()) {
for (unsigned int i = 0;
i < sizeof(vlang_to_code) / sizeof(char *); i += 2) {
lang_to_code[vlang_to_code[i]] = vlang_to_code[i + 1];
}
}
STD_UNORDERED_MAP<string, string>::const_iterator it =
std::unordered_map<string, string>::const_iterator it =
lang_to_code.find(lang);
// Use cp1252 by default...