move some whitespace around

This commit is contained in:
mjk 2021-03-19 21:43:00 +00:00 committed by LAGonauta
parent c3624f8490
commit 229ff697c4
4 changed files with 9 additions and 9 deletions

View file

@ -68,10 +68,10 @@ inline auto &describe_argument(OStream &s, const wchar_t * const a) = delete;
// TODO: handle wide strings maybe // TODO: handle wide strings maybe
template<typename... Arg> template<typename... Arg>
inline impl::varstring describe_arguments(const Arg &...a) noexcept try inline impl::varstring describe_arguments(const Arg &... a) noexcept try
{ {
std::ostringstream ss; std::ostringstream ss;
((describe_argument(ss,a)<<','), ...); ((describe_argument(ss,a) << ','), ...);
auto s = std::move(ss).str(); auto s = std::move(ss).str();
s.pop_back(); s.pop_back();
return {s}; return {s};
@ -84,7 +84,7 @@ catch (...)
#define FORMAT "%s(%s) failed: %s" #define FORMAT "%s(%s) failed: %s"
template<typename... Arg> template<typename... Arg>
inline void log_invocation_failure(const char *e, const char *func_name, const Arg &...a) noexcept inline void log_invocation_failure(const char *e, const char *func_name, const Arg &... a) noexcept
{ {
const auto args = describe_arguments(a...); const auto args = describe_arguments(a...);
g_warning(FORMAT, func_name, args.c_str(), e); g_warning(FORMAT, func_name, args.c_str(), e);
@ -99,7 +99,7 @@ inline void log_invocation_failure_desc(const char* e, const char* e_desc, const
template<typename Invokable, typename... Arg> template<typename Invokable, typename... Arg>
inline gboolean try_invoke(const char *func_name, Invokable &&i, const Arg &...a) noexcept try inline gboolean try_invoke(const char *func_name, Invokable &&i, const Arg &... a) noexcept try
{ {
return std::invoke(std::forward<Invokable>(i), a...); return std::invoke(std::forward<Invokable>(i), a...);
} }

View file

@ -7,7 +7,7 @@
template<std::size_t N> template<std::size_t N>
inline auto make_array(const char (&from_literal)[N]) noexcept inline auto make_array(const char (&from_literal)[N]) noexcept
{ {
static_assert( N ); static_assert(N);
std::array<char,N-1> a; std::array<char,N-1> a;
std::copy(+from_literal, from_literal+a.size(), a.begin()); std::copy(+from_literal, from_literal+a.size(), a.begin());
return a; return a;

View file

@ -4,7 +4,7 @@
template<typename... Callable> template<typename... Callable>
struct overload : Callable... struct overload : Callable...
{ {
overload( Callable &&...c ) : Callable{std::move(c)}... {} overload(Callable &&... c) : Callable{std::move(c)}... {}
using Callable::operator()...; using Callable::operator()...;
}; };
#endif #endif

View file

@ -21,14 +21,14 @@ namespace dyn
if (mod) if (mod)
return mod; return mod;
const win32_error e{}; const win32_error e{};
g_warning("failed to load %s", dbgnym ); g_warning("failed to load %s", dbgnym);
throw e; throw e;
} }
template<typename T> template<typename T>
inline T &load_symbol( inline T &load_symbol(
const wchar_t *const mod_path, const char *const mod_dbgnym, const wchar_t *const mod_path, const char *const mod_dbgnym,
const char *const symbol ) const char *const symbol)
{ {
const auto p = reinterpret_cast<T *>( const auto p = reinterpret_cast<T *>(
::GetProcAddress(load_module(mod_path, mod_dbgnym), symbol)); ::GetProcAddress(load_module(mod_path, mod_dbgnym), symbol));