diff --git a/include/cubescript/cubescript.hh b/include/cubescript/cubescript.hh index 0f36991f..18b8d369 100644 --- a/include/cubescript/cubescript.hh +++ b/include/cubescript/cubescript.hh @@ -6,12 +6,12 @@ #include #include +#include #include "cubescript_conf.hh" #include #include -#include #include #include #include @@ -23,9 +23,9 @@ namespace cscript { using CsString = std::string; -static_assert(ostd::IsIntegral, "CsInt must be integral"); -static_assert(ostd::IsSigned, "CsInt must be signed"); -static_assert(ostd::IsFloatingPoint, "CsFloat must be floating point"); +static_assert(std::is_integral_v, "CsInt must be integral"); +static_assert(std::is_signed_v, "CsInt must be signed"); +static_assert(std::is_floating_point_v, "CsFloat must be floating point"); enum { CsIdfPersist = 1 << 0, @@ -108,7 +108,7 @@ struct OSTD_EXPORT CsValue { bool code_is_empty() const; private: - ostd::AlignedUnion<1, CsInt, CsFloat, void *> p_stor; + std::aligned_union_t<1, CsInt, CsFloat, void *> p_stor; size_t p_len; CsValueType p_type; }; diff --git a/src/cs_gen.cc b/src/cs_gen.cc index b631d500..4da0464e 100644 --- a/src/cs_gen.cc +++ b/src/cs_gen.cc @@ -4,7 +4,7 @@ #include -#include +#include namespace cscript { @@ -354,7 +354,7 @@ lookupid: numargs++; break; case 'b': - gs.gen_int(ostd::NumericLimitMin); + gs.gen_int(std::numeric_limits::min()); numargs++; break; case 'f': @@ -942,7 +942,7 @@ static void compile_cmd( if (rep) { break; } - gs.gen_int(ostd::NumericLimitMin); + gs.gen_int(std::numeric_limits::min()); fakeargs++; } numargs++; diff --git a/src/cs_util.hh b/src/cs_util.hh index 70c3bce5..38973870 100644 --- a/src/cs_util.hh +++ b/src/cs_util.hh @@ -1,9 +1,10 @@ #ifndef LIBCUBESCRIPT_CS_UTIL_HH #define LIBCUBESCRIPT_CS_UTIL_HH +#include + #include #include -#include #include namespace cscript { @@ -29,7 +30,7 @@ struct CsScopeExit { ~CsScopeExit() { func(); } - ostd::Decay func; + std::decay_t func; }; template diff --git a/src/cs_vm.cc b/src/cs_vm.cc index 9eb73743..fc5a53d0 100644 --- a/src/cs_vm.cc +++ b/src/cs_vm.cc @@ -2,7 +2,7 @@ #include "cs_vm.hh" #include "cs_util.hh" -#include +#include namespace cscript { @@ -322,7 +322,7 @@ static inline void callcommand( if (rep) { break; } - args[i].set_int(ostd::NumericLimitMin); + args[i].set_int(std::numeric_limits::min()); fakeargs++; } else { args[i].force_int(); diff --git a/src/lib_math.cc b/src/lib_math.cc index f01f52c8..dde2cab8 100644 --- a/src/lib_math.cc +++ b/src/lib_math.cc @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -243,7 +244,7 @@ void cs_init_lib_math(CsState &cs) { cs.new_command("<<", "i1V", [](auto &, auto args, auto &res) { cs_mathop( args, res, 0, [](CsInt val1, CsInt val2) { - return (val2 < CsInt(ostd::SizeInBits)) + return (val2 < CsInt(sizeof(CsInt) * CHAR_BIT)) ? (val1 << std::max(val2, CsInt(0))) : 0; }, CsMathNoop() @@ -253,7 +254,7 @@ void cs_init_lib_math(CsState &cs) { cs_mathop( args, res, 0, [](CsInt val1, CsInt val2) { return val1 >> std::clamp( - val2, CsInt(0), CsInt(ostd::SizeInBits) + val2, CsInt(0), CsInt(sizeof(CsInt) * CHAR_BIT) ); }, CsMathNoop() );