mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
vcmi: reduce boost a little bit
This commit is contained in:
parent
ff66592fad
commit
ea3bdda047
8
Global.h
8
Global.h
@ -217,8 +217,8 @@ typedef int16_t si16; //signed int 16 bits (2 bytes)
|
|||||||
typedef int8_t si8; //signed int 8 bits (1 byte)
|
typedef int8_t si8; //signed int 8 bits (1 byte)
|
||||||
|
|
||||||
// Lock typedefs
|
// Lock typedefs
|
||||||
typedef boost::lock_guard<boost::mutex> TLockGuard;
|
using TLockGuard = std::lock_guard<std::mutex>;
|
||||||
typedef boost::lock_guard<boost::recursive_mutex> TLockGuardRec;
|
using TLockGuardRec = std::lock_guard<std::recursive_mutex>;
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
/* Macros */
|
/* Macros */
|
||||||
@ -565,7 +565,7 @@ namespace vstd
|
|||||||
template<typename InputRange, typename OutputIterator, typename Predicate>
|
template<typename InputRange, typename OutputIterator, typename Predicate>
|
||||||
OutputIterator copy_if(const InputRange &input, OutputIterator result, Predicate pred)
|
OutputIterator copy_if(const InputRange &input, OutputIterator result, Predicate pred)
|
||||||
{
|
{
|
||||||
return std::copy_if(boost::const_begin(input), std::end(input), result, pred);
|
return std::copy_if(std::cbegin(input), std::end(input), result, pred);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Container>
|
template <typename Container>
|
||||||
@ -693,7 +693,7 @@ namespace vstd
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
void removeDuplicates(std::vector<T> &vec)
|
void removeDuplicates(std::vector<T> &vec)
|
||||||
{
|
{
|
||||||
boost::sort(vec);
|
std::sort(vec.begin(), vec.end());
|
||||||
vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
|
vec.erase(std::unique(vec.begin(), vec.end()), vec.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
VCMI_LIB_NAMESPACE_BEGIN
|
VCMI_LIB_NAMESPACE_BEGIN
|
||||||
|
|
||||||
boost::mutex CConsoleHandler::smx;
|
std::mutex CConsoleHandler::smx;
|
||||||
|
|
||||||
DLL_LINKAGE CConsoleHandler * console = nullptr;
|
DLL_LINKAGE CConsoleHandler * console = nullptr;
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ private:
|
|||||||
/// FIXME: Implement CConsoleHandler as singleton, move some logic into CLogConsoleTarget, etc... needs to be disussed:)
|
/// FIXME: Implement CConsoleHandler as singleton, move some logic into CLogConsoleTarget, etc... needs to be disussed:)
|
||||||
/// Without static, application will crash complaining about mutex deleted. In short: CConsoleHandler gets deleted before
|
/// Without static, application will crash complaining about mutex deleted. In short: CConsoleHandler gets deleted before
|
||||||
/// the logging system.
|
/// the logging system.
|
||||||
static boost::mutex smx;
|
static std::mutex smx;
|
||||||
|
|
||||||
boost::thread * thread;
|
boost::thread * thread;
|
||||||
};
|
};
|
||||||
|
@ -85,8 +85,8 @@ bool CLoggerDomain::isGlobalDomain() const { return name == DOMAIN_GLOBAL; }
|
|||||||
|
|
||||||
const std::string& CLoggerDomain::getName() const { return name; }
|
const std::string& CLoggerDomain::getName() const { return name; }
|
||||||
|
|
||||||
boost::recursive_mutex CLogger::smx;
|
std::recursive_mutex CLogger::smx;
|
||||||
boost::recursive_mutex CLogManager::smx;
|
std::recursive_mutex CLogManager::smx;
|
||||||
|
|
||||||
DLL_LINKAGE vstd::CLoggerBase * logGlobal = CLogger::getGlobalLogger();
|
DLL_LINKAGE vstd::CLoggerBase * logGlobal = CLogger::getGlobalLogger();
|
||||||
|
|
||||||
|
@ -78,8 +78,8 @@ private:
|
|||||||
CLogger * parent;
|
CLogger * parent;
|
||||||
ELogLevel::ELogLevel level;
|
ELogLevel::ELogLevel level;
|
||||||
std::vector<std::unique_ptr<ILogTarget> > targets;
|
std::vector<std::unique_ptr<ILogTarget> > targets;
|
||||||
mutable boost::mutex mx;
|
mutable std::mutex mx;
|
||||||
static boost::recursive_mutex smx;
|
static std::recursive_mutex smx;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------------- */
|
||||||
@ -101,8 +101,8 @@ private:
|
|||||||
virtual ~CLogManager();
|
virtual ~CLogManager();
|
||||||
|
|
||||||
std::map<std::string, CLogger *> loggers;
|
std::map<std::string, CLogger *> loggers;
|
||||||
mutable boost::mutex mx;
|
mutable std::mutex mx;
|
||||||
static boost::recursive_mutex smx;
|
static std::recursive_mutex smx;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The struct LogRecord holds the log message and additional logging information.
|
/// The struct LogRecord holds the log message and additional logging information.
|
||||||
@ -200,7 +200,7 @@ private:
|
|||||||
bool coloredOutputEnabled;
|
bool coloredOutputEnabled;
|
||||||
CLogFormatter formatter;
|
CLogFormatter formatter;
|
||||||
CColorMapping colorMapping;
|
CColorMapping colorMapping;
|
||||||
mutable boost::mutex mx;
|
mutable std::mutex mx;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// This target is a logging target which writes messages to a log file.
|
/// This target is a logging target which writes messages to a log file.
|
||||||
@ -222,7 +222,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
FileStream file;
|
FileStream file;
|
||||||
CLogFormatter formatter;
|
CLogFormatter formatter;
|
||||||
mutable boost::mutex mx;
|
mutable std::mutex mx;
|
||||||
};
|
};
|
||||||
|
|
||||||
VCMI_LIB_NAMESPACE_END
|
VCMI_LIB_NAMESPACE_END
|
||||||
|
Loading…
Reference in New Issue
Block a user