mirror of
https://github.com/edo9300/ygopro-core
synced 2026-08-25 16:23:07 -04:00
Assert various warnings when compiling x64 with msvc
This commit is contained in:
parent
b47594cecc
commit
b91dd7f752
5 changed files with 9 additions and 5 deletions
3
bit.h
3
bit.h
|
|
@ -22,7 +22,8 @@ constexpr inline uint8_t popcnt(T val) {
|
|||
|
||||
template<typename T, typename T2>
|
||||
constexpr inline bool has_invalid_bits(T value, T2 allowed) {
|
||||
return (value & (~allowed)) != 0;
|
||||
using BiggestInt = std::conditional_t<(sizeof(T) > sizeof(T2)), T, T2>;
|
||||
return (static_cast<BiggestInt>(value) & (~static_cast<BiggestInt>(allowed))) != static_cast<BiggestInt>(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,10 @@
|
|||
#if !defined(__INTELLISENSE__) || !HAS_COUNTER
|
||||
#include <array>
|
||||
#include <lauxlib.h>
|
||||
#include <type_traits>
|
||||
#if HAS_COUNTER
|
||||
#include <type_traits> //std::conditional_t
|
||||
#endif
|
||||
#include <utility> //std::index_sequence, std::make_index_sequence
|
||||
#include "common.h"
|
||||
|
||||
// use forceinline only in release builds
|
||||
|
|
|
|||
|
|
@ -1791,7 +1791,7 @@ LUA_FUNCTION(GetCounter) {
|
|||
return 1;
|
||||
}
|
||||
LUA_FUNCTION(GetAllCounters) {
|
||||
lua_createtable(L, self->counters.size(), 0);
|
||||
lua_createtable(L, static_cast<int>(self->counters.size()), 0);
|
||||
for(const auto& counter : self->counters) {
|
||||
lua_pushinteger(L, counter.first);
|
||||
lua_pushinteger(L, counter.second[0] + counter.second[1]);
|
||||
|
|
|
|||
|
|
@ -1983,7 +1983,7 @@ LUA_STATIC_FUNCTION(GetChainInfo) {
|
|||
break;
|
||||
case CHAININFO::TRIGGERING_SETCODES: {
|
||||
const auto& setcodes = ch->triggering_state.setcodes;
|
||||
lua_createtable(L, setcodes.size(), 0);
|
||||
lua_createtable(L, static_cast<int>(setcodes.size()), 0);
|
||||
int i = 1;
|
||||
for(const auto& setcode : setcodes) {
|
||||
lua_pushinteger(L, i++);
|
||||
|
|
|
|||
|
|
@ -575,7 +575,7 @@ LUA_FUNCTION(GetClass) {
|
|||
for(auto& pcard : self->container) {
|
||||
er.insert(pduel->lua->get_operation_value(pcard, findex, extraargs));
|
||||
}
|
||||
lua_createtable(L, er.size(), 0);
|
||||
lua_createtable(L, static_cast<int>(er.size()), 0);
|
||||
int i = 1;
|
||||
for(auto& val : er) {
|
||||
lua_pushinteger(L, i++);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue