Skip to content

Commit

Permalink
correct typename
Browse files Browse the repository at this point in the history
  • Loading branch information
MillhioreBT committed Sep 18, 2023
1 parent 0422a2e commit f8afaa0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions src/luascript.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,17 +248,17 @@ class LuaScriptInterface
if (number > 0) {
reportErrorFunc(
L, fmt::format("Argument {} has out-of-range value for {}: {}", arg, typeid(T).name(), integer));
return static_cast<T>(std::numeric_limits<std::underlying_type<T>::type>::max());
return static_cast<T>(std::numeric_limits<typename std::underlying_type<T>::type>::max());
} else if (number < 0) {
reportErrorFunc(
L, fmt::format("Argument {} has out-of-range value for {}: {}", arg, typeid(T).name(), integer));
return static_cast<T>(std::numeric_limits<std::underlying_type<T>::type>::lowest());
return static_cast<T>(std::numeric_limits<typename std::underlying_type<T>::type>::lowest());
}

return static_cast<T>(0);
}

return static_cast<T>(static_cast<std::underlying_type<T>::type>(integer));
return static_cast<T>(static_cast<typename std::underlying_type<T>::type>(integer));
}

template <typename T>
Expand Down Expand Up @@ -303,14 +303,14 @@ class LuaScriptInterface
} else if (num < std::numeric_limits<lua_Number>::lowest()) {
reportErrorFunc(L,
fmt::format("Argument {} has out-of-range value for {}: {}", arg, typeid(T).name(), num));
return static_cast<T>(std::numeric_limits<std::underlying_type<T>::type>::lowest());
return static_cast<T>(std::numeric_limits<typename std::underlying_type<T>::type>::lowest());
} else if (num > std::numeric_limits<lua_Number>::max()) {
reportErrorFunc(L,
fmt::format("Argument {} has out-of-range value for {}: {}", arg, typeid(T).name(), num));
return static_cast<T>(std::numeric_limits<std::underlying_type<T>::type>::max());
return static_cast<T>(std::numeric_limits<typename std::underlying_type<T>::type>::max());
}

return static_cast<T>(static_cast<std::underlying_type<T>::type>(num));
return static_cast<T>(static_cast<typename std::underlying_type<T>::type>(num));
}

template <typename T>
Expand All @@ -321,11 +321,11 @@ class LuaScriptInterface
lua_Number num = lua_tonumberx(L, arg, &isNum);
if (isNum == 0) {
return 0;
} else if (num < static_cast<lua_Number>(std::numeric_limits<T>::lowest())) {
} else if (num < static_cast<lua_Number>(typename std::numeric_limits<T>::lowest())) {
reportErrorFunc(L,
fmt::format("Argument {} has out-of-range value for {}: {}", arg, typeid(T).name(), num));
return std::numeric_limits<T>::lowest();
} else if (num > static_cast<lua_Number>(std::numeric_limits<T>::max())) {
} else if (num > static_cast<lua_Number>(typename std::numeric_limits<T>::max())) {
reportErrorFunc(L,
fmt::format("Argument {} has out-of-range value for {}: {}", arg, typeid(T).name(), num));
return std::numeric_limits<T>::max();
Expand Down
2 changes: 1 addition & 1 deletion src/otpch.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
#include <memory>
#include <mutex>
#include <mysql/mysql.h>
#include <pugixml.hpp>
#include <optional>
#include <pugixml.hpp>
#include <random>
#include <set>
#include <sstream>
Expand Down

0 comments on commit f8afaa0

Please sign in to comment.