Butcher narrow cast a little (don't print value).

Also remove some forward declarations from util/types.hpp
If they don't work properly, it's easier to remove them.
This commit is contained in:
Nekotekina
2020-12-22 14:05:05 +03:00
parent b7bf316c1a
commit 43a58df8a0
8 changed files with 15 additions and 29 deletions
+1
View File
@@ -1,6 +1,7 @@
#pragma once
#include "util/types.hpp"
#include "Utilities/StrFmt.h"
template<typename T, uint N>
struct bf_base
+3 -11
View File
@@ -294,29 +294,21 @@ void fmt_class_string<src_loc>::format(std::string& out, u64 arg)
namespace fmt
{
void raw_verify_error(const src_loc& loc)
[[noreturn]] void raw_verify_error(const src_loc& loc)
{
std::string out{"Verification failed"};
fmt::append(out, "%s", loc);
thread_ctrl::emergency_exit(out);
}
void raw_narrow_error(const src_loc& loc, const fmt_type_info* sup, u64 arg)
[[noreturn]] void raw_narrow_error(const src_loc& loc)
{
std::string out{"Narrowing error"};
if (sup)
{
out += " (";
sup->fmt_string(out, arg); // Print value
out += ")";
}
fmt::append(out, "%s", loc);
thread_ctrl::emergency_exit(out);
}
void raw_throw_exception(const src_loc& loc, const char* fmt, const fmt_type_info* sup, const u64* args)
[[noreturn]] void raw_throw_exception(const src_loc& loc, const char* fmt, const fmt_type_info* sup, const u64* args)
{
std::string out;
raw_append(out, fmt, sup, args);
+4 -1
View File
@@ -10,7 +10,7 @@ namespace fmt
static std::string format(const CharT(&)[N], const Args&...);
}
template <typename T, typename>
template <typename T, typename = void>
struct fmt_unveil
{
static_assert(sizeof(T) > 0, "fmt_unveil<> error: incomplete type");
@@ -245,6 +245,9 @@ struct fmt_type_info
template <typename... Args>
using fmt_args_t = const u64(&&)[sizeof...(Args) + 1];
template <typename Arg>
using fmt_unveil_t = typename fmt_unveil<Arg>::type;
namespace fmt
{
// Base-57 format helper
+1
View File
@@ -23,6 +23,7 @@ Intersection (&) and symmetric difference (^) is also available.
#include "util/types.hpp"
#include "util/atomic.hpp"
#include "Utilities/StrFmt.h"
template <typename T>
class atomic_bs_t;