1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

vcmi: reduce boost a little bit

This commit is contained in:
Konstantin 2023-04-11 17:11:14 +03:00
parent ff66592fad
commit ea3bdda047
5 changed files with 14 additions and 14 deletions

View File

@ -217,8 +217,8 @@ typedef int16_t si16; //signed int 16 bits (2 bytes)
typedef int8_t si8; //signed int 8 bits (1 byte)
// Lock typedefs
typedef boost::lock_guard<boost::mutex> TLockGuard;
typedef boost::lock_guard<boost::recursive_mutex> TLockGuardRec;
using TLockGuard = std::lock_guard<std::mutex>;
using TLockGuardRec = std::lock_guard<std::recursive_mutex>;
/* ---------------------------------------------------------------------------- */
/* Macros */
@ -565,7 +565,7 @@ namespace vstd
template<typename InputRange, typename OutputIterator, typename Predicate>
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>
@ -693,7 +693,7 @@ namespace vstd
template<typename T>
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());
}

View File

@ -15,7 +15,7 @@
VCMI_LIB_NAMESPACE_BEGIN
boost::mutex CConsoleHandler::smx;
std::mutex CConsoleHandler::smx;
DLL_LINKAGE CConsoleHandler * console = nullptr;

View File

@ -88,7 +88,7 @@ private:
/// 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
/// the logging system.
static boost::mutex smx;
static std::mutex smx;
boost::thread * thread;
};

View File

@ -85,8 +85,8 @@ bool CLoggerDomain::isGlobalDomain() const { return name == DOMAIN_GLOBAL; }
const std::string& CLoggerDomain::getName() const { return name; }
boost::recursive_mutex CLogger::smx;
boost::recursive_mutex CLogManager::smx;
std::recursive_mutex CLogger::smx;
std::recursive_mutex CLogManager::smx;
DLL_LINKAGE vstd::CLoggerBase * logGlobal = CLogger::getGlobalLogger();

View File

@ -78,8 +78,8 @@ private:
CLogger * parent;
ELogLevel::ELogLevel level;
std::vector<std::unique_ptr<ILogTarget> > targets;
mutable boost::mutex mx;
static boost::recursive_mutex smx;
mutable std::mutex mx;
static std::recursive_mutex smx;
};
/* ---------------------------------------------------------------------------- */
@ -101,8 +101,8 @@ private:
virtual ~CLogManager();
std::map<std::string, CLogger *> loggers;
mutable boost::mutex mx;
static boost::recursive_mutex smx;
mutable std::mutex mx;
static std::recursive_mutex smx;
};
/// The struct LogRecord holds the log message and additional logging information.
@ -200,7 +200,7 @@ private:
bool coloredOutputEnabled;
CLogFormatter formatter;
CColorMapping colorMapping;
mutable boost::mutex mx;
mutable std::mutex mx;
};
/// This target is a logging target which writes messages to a log file.
@ -222,7 +222,7 @@ public:
private:
FileStream file;
CLogFormatter formatter;
mutable boost::mutex mx;
mutable std::mutex mx;
};
VCMI_LIB_NAMESPACE_END