mirror of
https://github.com/edo9300/ygopro-core
synced 2026-08-25 16:23:07 -04:00
Address various warnings raised by clang's -Weverything
They were mostly extra breaks/extra semicolons
This commit is contained in:
parent
7982ca13b9
commit
9790b552a0
13 changed files with 19 additions and 32 deletions
7
card.cpp
7
card.cpp
|
|
@ -2716,7 +2716,7 @@ int32_t card::check_summon_procedure(effect* peffect, uint8_t playerid, uint8_t
|
|||
if(new_min_tribute < min_tribute)
|
||||
new_min_tribute = min_tribute;
|
||||
if (peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM) && peffect->o_range)
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffff << 16);
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffffu << 16);
|
||||
new_zone &= zone;
|
||||
if(is_summonable(peffect, new_min_tribute, new_zone, releasable, peffect))
|
||||
return TRUE;
|
||||
|
|
@ -2808,7 +2808,7 @@ int32_t card::check_set_procedure(effect* peffect, uint8_t playerid, uint8_t ign
|
|||
releasable = static_cast<uint32_t>(retval[2]);
|
||||
}
|
||||
if (peffect->is_flag(EFFECT_FLAG_SPSUM_PARAM) && peffect->o_range)
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffff << 16);
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffffu << 16);
|
||||
if(new_min_tribute < (int32_t)min_tribute)
|
||||
new_min_tribute = min_tribute;
|
||||
new_zone &= zone;
|
||||
|
|
@ -3570,7 +3570,6 @@ int32_t card::is_destructable_by_effect(effect* peffect, uint8_t playerid) {
|
|||
pduel->lua->add_param<LuaParam::INT>(playerid);
|
||||
if(peff->check_value_condition(3)) {
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
eset.clear();
|
||||
|
|
@ -3584,7 +3583,6 @@ int32_t card::is_destructable_by_effect(effect* peffect, uint8_t playerid) {
|
|||
pduel->lua->add_param<LuaParam::INT>(playerid);
|
||||
if(peff->check_value_condition(3)) {
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
pduel->lua->add_param<LuaParam::EFFECT>(peffect);
|
||||
|
|
@ -3595,7 +3593,6 @@ int32_t card::is_destructable_by_effect(effect* peffect, uint8_t playerid) {
|
|||
auto it = indestructable_effects.emplace(peff->id, 0);
|
||||
if(it.first->second + 1 <= ct) {
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2
duel.h
2
duel.h
|
|
@ -38,7 +38,7 @@ struct card_data {
|
|||
uint32_t rscale{};
|
||||
uint32_t link_marker{};
|
||||
card_data(const OCG_CardData& data);
|
||||
card_data() {};
|
||||
card_data() = default;
|
||||
};
|
||||
|
||||
class duel {
|
||||
|
|
|
|||
|
|
@ -548,11 +548,9 @@ int32_t effect::reset(uint32_t reset_level, uint32_t reset_type) {
|
|||
if(reset_level & 0xffff0000 & reset_flag)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
case RESET_CARD: {
|
||||
return owner && (owner->data.code == reset_level);
|
||||
break;
|
||||
}
|
||||
case RESET_PHASE: {
|
||||
if(!(reset_flag & RESET_PHASE))
|
||||
|
|
@ -565,15 +563,12 @@ int32_t effect::reset(uint32_t reset_level, uint32_t reset_type) {
|
|||
if(reset_count == 0)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
break;
|
||||
}
|
||||
case RESET_CODE: {
|
||||
return (code == reset_level) && (type & EFFECT_TYPE_SINGLE) && !(type & EFFECT_TYPE_ACTIONS);
|
||||
break;
|
||||
}
|
||||
case RESET_COPY: {
|
||||
return copy_id == reset_level;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
|
|
|
|||
3
effect.h
3
effect.h
|
|
@ -58,8 +58,7 @@ public:
|
|||
uint64_t description{};
|
||||
std::vector<lua_Integer> label;
|
||||
|
||||
explicit effect(duel* pd) : lua_obj_helper(pd) {};
|
||||
~effect() = default;
|
||||
explicit effect(duel* pd) : lua_obj_helper(pd) {}
|
||||
|
||||
int32_t is_disable_related();
|
||||
int32_t is_self_destroy_related();
|
||||
|
|
|
|||
|
|
@ -1215,9 +1215,9 @@ bool field::has_separate_pzone(uint8_t p) const {
|
|||
uint32_t field::get_pzone_zones_flag() const {
|
||||
uint32_t flag = 0;
|
||||
if(!has_separate_pzone(0))
|
||||
flag |= 0xC000;
|
||||
flag |= 0xC000u;
|
||||
if(!has_separate_pzone(1))
|
||||
flag |= 0xC000 << 16;
|
||||
flag |= 0xC000u << 16;
|
||||
return flag;
|
||||
}
|
||||
uint8_t field::get_pzone_index(uint8_t seq, uint8_t p) const {
|
||||
|
|
|
|||
2
field.h
2
field.h
|
|
@ -192,7 +192,7 @@ class return_card_generic {
|
|||
public:
|
||||
bool canceled;
|
||||
std::vector<T> list;
|
||||
return_card_generic():canceled(false) {};
|
||||
return_card_generic():canceled(false) {}
|
||||
void clear() {
|
||||
canceled = false;
|
||||
list.clear();
|
||||
|
|
|
|||
|
|
@ -264,7 +264,6 @@ void interpreter::push_param(lua_State* L, bool is_coroutine) {
|
|||
}
|
||||
case LuaParam::DELETED:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
++pushed;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3487,7 +3487,7 @@ LUA_STATIC_FUNCTION(TossCoin) {
|
|||
return yieldk({
|
||||
const auto& coin_results = pduel->game_field->core.coin_results;
|
||||
luaL_checkstack(L, static_cast<int>(coin_results.size()), nullptr);
|
||||
for(const auto& result : coin_results)
|
||||
for(const auto result : coin_results)
|
||||
lua_pushinteger(L, static_cast<int8_t>(result));
|
||||
return static_cast<int32_t>(coin_results.size());
|
||||
});
|
||||
|
|
@ -3520,7 +3520,7 @@ LUA_STATIC_FUNCTION(RockPaperScissors) {
|
|||
LUA_STATIC_FUNCTION(GetCoinResult) {
|
||||
const auto& coin_results = pduel->game_field->core.coin_results;
|
||||
luaL_checkstack(L, static_cast<int>(coin_results.size()), nullptr);
|
||||
for(const auto& coin : coin_results)
|
||||
for(const auto coin : coin_results)
|
||||
lua_pushinteger(L, static_cast<int>(coin));
|
||||
return static_cast<int32_t>(coin_results.size());
|
||||
}
|
||||
|
|
@ -3960,7 +3960,6 @@ LUA_STATIC_FUNCTION(GetActivityCount) {
|
|||
break;
|
||||
default:
|
||||
lua_error(L, "Passed invalid ACTIVITY flag.");
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
int32_t ref_handle;
|
||||
duel* pduel{ nullptr };
|
||||
protected:
|
||||
lua_obj(LuaParam _lua_type, duel* _pduel) :lua_type(_lua_type), pduel(_pduel) {};
|
||||
lua_obj(LuaParam _lua_type, duel* _pduel) :lua_type(_lua_type), pduel(_pduel) {}
|
||||
};
|
||||
|
||||
template<LuaParam _Type>
|
||||
|
|
@ -37,7 +37,7 @@ class lua_obj_helper : public lua_obj {
|
|||
_Type == LuaParam::EFFECT || _Type == LuaParam::DELETED,
|
||||
"Invalid parameter type");
|
||||
public:
|
||||
lua_obj_helper(duel* pduel) : lua_obj(_Type, pduel) {};
|
||||
lua_obj_helper(duel* pduel_) : lua_obj(_Type, pduel_) {}
|
||||
};
|
||||
|
||||
#endif /* LUA_OBJ_H_ */
|
||||
|
|
|
|||
|
|
@ -1783,8 +1783,8 @@ int32_t field::summon(uint16_t step, uint8_t sumplayer, card* target, effect* pr
|
|||
if(target->current.location == LOCATION_MZONE) {
|
||||
core.units.begin()->step = 4;
|
||||
if(!ignore_count && !core.extra_summon[sumplayer]) {
|
||||
for(const auto& peff : eset) {
|
||||
core.units.begin()->ptr1 = peff;
|
||||
if(!eset.empty()) {
|
||||
core.units.begin()->ptr1 = eset.front();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
|
@ -1815,7 +1815,7 @@ int32_t field::summon(uint16_t step, uint8_t sumplayer, card* target, effect* pr
|
|||
releasable = static_cast<uint32_t>(retval[2]);
|
||||
}
|
||||
if (proc && proc->is_flag(EFFECT_FLAG_SPSUM_PARAM) && proc->o_range)
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffff << 16);
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffffu << 16);
|
||||
new_zone &= zone;
|
||||
if(proc) {
|
||||
if(new_min_tribute < min_tribute)
|
||||
|
|
@ -1865,7 +1865,7 @@ int32_t field::summon(uint16_t step, uint8_t sumplayer, card* target, effect* pr
|
|||
if(min_tribute < new_min_tribute)
|
||||
min_tribute = new_min_tribute;
|
||||
if (proc && proc->is_flag(EFFECT_FLAG_SPSUM_PARAM) && proc->o_range)
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffff << 16);
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffffu << 16);
|
||||
zone &= new_zone;
|
||||
core.units.begin()->arg1 = sumplayer + (ignore_count << 8) + (min_tribute << 16) + (zone << 24);
|
||||
}
|
||||
|
|
@ -2449,7 +2449,7 @@ int32_t field::mset(uint16_t step, uint8_t setplayer, card* target, effect* proc
|
|||
releasable = static_cast<uint32_t>(retval[2]);
|
||||
}
|
||||
if(proc && proc->is_flag(EFFECT_FLAG_SPSUM_PARAM) && proc->o_range)
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffff << 16);
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffffu << 16);
|
||||
new_zone &= zone;
|
||||
if(proc) {
|
||||
if(new_min_tribute < (int32_t)min_tribute)
|
||||
|
|
@ -2499,7 +2499,7 @@ int32_t field::mset(uint16_t step, uint8_t setplayer, card* target, effect* proc
|
|||
if(min_tribute < new_min_tribute)
|
||||
min_tribute = new_min_tribute;
|
||||
if(proc && proc->is_flag(EFFECT_FLAG_SPSUM_PARAM) && proc->o_range)
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffff << 16);
|
||||
new_zone = (new_zone >> 16) | (new_zone & 0xffffu << 16);
|
||||
zone &= new_zone;
|
||||
core.units.begin()->arg1 = setplayer + (ignore_count << 8) + (min_tribute << 16) + (zone << 24);
|
||||
}
|
||||
|
|
@ -2845,7 +2845,7 @@ int32_t field::sset_g(uint16_t step, uint8_t setplayer, uint8_t toplayer, group*
|
|||
card_set* set_cards = &core.set_group_pre_set;
|
||||
card* target = *set_cards->begin();
|
||||
target->enable_field_effect(false);
|
||||
uint32_t zone;
|
||||
uint32_t zone{};
|
||||
if(target->data.type & TYPE_FIELD) {
|
||||
zone = 1 << 5;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -3325,8 +3325,8 @@ int32_t field::process_battle_command(uint16_t step) {
|
|||
return TRUE;
|
||||
}
|
||||
core.units.begin()->step = 32;
|
||||
[[fallthrough]];
|
||||
}
|
||||
// fall through
|
||||
case 32: {
|
||||
auto message = pduel->new_message(MSG_HINT);
|
||||
message->write<uint8_t>(HINT_EVENT);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@
|
|||
class ProgressiveBuffer {
|
||||
public:
|
||||
std::vector<uint8_t> data;
|
||||
ProgressiveBuffer() {};
|
||||
void clear() {
|
||||
data.clear();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,6 @@ bool check_param(lua_State* L, LuaParam param_type, int32_t index, bool retfalse
|
|||
break;
|
||||
default:
|
||||
unreachable();
|
||||
break;
|
||||
}
|
||||
if(retfalse)
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue