Formatting fixes, ToBE() replaced with data()

This commit is contained in:
Nekotekina 2015-01-13 17:54:36 +03:00
parent f4c712dafc
commit 1c4e89d2bf
32 changed files with 166 additions and 158 deletions

View file

@ -551,12 +551,12 @@ private:
}
};
public:
const stype& ToBE() const
{
return m_data;
}
public:
type ToLE() const
{
return se_t<type, sizeof(T2)>::from_be(m_data);
@ -605,11 +605,7 @@ public:
const stype& data() const
{
#ifdef IS_LE_MACHINE
return ToBE();
#else
return ToLE();
#endif
}
be_t& operator = (const be_t& value) = default;

View file

@ -131,13 +131,19 @@ inline void log_message(Log::LogType type, Log::LogSeverity sev, const char* tex
//another msvc bug makes this not work, uncomment this and delete everything else in this function when it's fixed
//Log::LogManager::getInstance().log({logType, severity, text})
Log::LogMessage msg{type, sev, text};
Log::LogMessage msg{ type, sev, text };
Log::LogManager::getInstance().log(msg);
}
inline void log_message(Log::LogType type, Log::LogSeverity sev, const std::string& text)
{
Log::LogMessage msg{ type, sev, text };
Log::LogManager::getInstance().log(msg);
}
template<typename T, typename... Ts>
inline void log_message(Log::LogType type, Log::LogSeverity sev, const char* text, T arg, Ts... args)
{
Log::LogMessage msg{type, sev, fmt::format(text, arg, args...)};
Log::LogMessage msg{ type, sev, fmt::format(text, arg, args...) };
Log::LogManager::getInstance().log(msg);
}

View file

@ -300,7 +300,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (u8)";
throw "Invalid formatting (u8): " + std::string(fmt, len);
}
return{};
@ -322,7 +322,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (u16)";
throw "Invalid formatting (u16): " + std::string(fmt, len);
}
return{};
@ -344,7 +344,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (u32)";
throw "Invalid formatting (u32): " + std::string(fmt, len);
}
return{};
@ -366,7 +366,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (u64)";
throw "Invalid formatting (u64): " + std::string(fmt, len);
}
return{};
@ -388,7 +388,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (s8)";
throw "Invalid formatting (s8): " + std::string(fmt, len);
}
return{};
@ -410,7 +410,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (s16)";
throw "Invalid formatting (s16): " + std::string(fmt, len);
}
return{};
@ -432,7 +432,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (s32)";
throw "Invalid formatting (s32): " + std::string(fmt, len);
}
return{};
@ -454,7 +454,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (s64)";
throw "Invalid formatting (s64): " + std::string(fmt, len);
}
return{};
@ -476,7 +476,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (float)";
throw "Invalid formatting (float): " + std::string(fmt, len);
}
return{};
@ -498,7 +498,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (double)";
throw "Invalid formatting (double): " + std::string(fmt, len);
}
return{};
@ -524,7 +524,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (bool)";
throw "Invalid formatting (bool): " + std::string(fmt, len);
}
return{};
@ -542,7 +542,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (char*)";
throw "Invalid formatting (char*): " + std::string(fmt, len);
}
return{};
@ -560,7 +560,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (const char*)";
throw "Invalid formatting (const char*): " + std::string(fmt, len);
}
return{};
@ -578,7 +578,7 @@ namespace fmt
// }
// else
// {
// throw "Invalid formatting (char[size])";
// throw "Invalid formatting (char[size]): " + std::string(fmt, len);
// }
// return{};
@ -596,7 +596,7 @@ namespace fmt
// }
// else
// {
// throw "Invalid formatting (const char[size])";
// throw "Invalid formatting (const char[size]): " + std::string(fmt, len);
// }
// return{};
@ -614,7 +614,7 @@ namespace fmt
}
else
{
throw "Invalid formatting (std::string)";
throw "Invalid formatting (std::string): " + std::string(fmt, len);
}
return{};