Further work on replacing integer definitions, make missing sanitizer only a warning instead of an error
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2022-03-23 14:19:07 +01:00
parent 46bf10c719
commit beb2e44a0b
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
5 changed files with 15 additions and 15 deletions

View File

@ -7,14 +7,12 @@ export BattleRandom* CreatureLib_BattleRandom_ConstructWithSeed(uint_fast32_t se
export void CreatureLib_BattleRandom_Destruct(BattleRandom* p) { delete p; }
export uint8_t CreatureLib_BattleRandom_EffectChance(bool& out, BattleRandom* p, float chance, ExecutingAttack* attack,
Creature* target) {
export i8 CreatureLib_BattleRandom_EffectChance(bool& out, BattleRandom* p, float chance, ExecutingAttack* attack,
Creature* target) {
Try(out = p->EffectChance(chance, attack, target);)
}
export int32_t CreatureLib_BattleRandom_Get(BattleRandom* p) { return p->Get(); }
export int32_t CreatureLib_BattleRandom_GetMax(BattleRandom* p, int32_t max) { return p->Get(max); }
export int32_t CreatureLib_BattleRandom_GetMinMax(BattleRandom* p, int32_t min, int32_t max) {
return p->Get(min, max);
}
export i32 CreatureLib_BattleRandom_Get(BattleRandom* p) { return p->Get(); }
export i32 CreatureLib_BattleRandom_GetMax(BattleRandom* p, i32 max) { return p->Get(max); }
export i32 CreatureLib_BattleRandom_GetMinMax(BattleRandom* p, i32 min, i32 max) { return p->Get(min, max); }
export uint_fast32_t CreatureLib_BattleRandom_GetSeed(BattleRandom* p) { return p->GetSeed(); }

View File

@ -6,13 +6,12 @@ export const BattleStatCalculator* CreatureLib_BattleStatCalculator_Construct()
export void CreatureLib_BattleStatCalculator_Destruct(const BattleStatCalculator* p) { delete p; }
export uint8_t CreatureLib_BattleStatCalculator_CalculateFlatStat(uint32_t& out, const BattleStatCalculator* p,
Creature* creature,
CreatureLib::Library::Statistic stat) {
export u8 CreatureLib_BattleStatCalculator_CalculateFlatStat(u32& out, const BattleStatCalculator* p,
Creature* creature, CreatureLib::Library::Statistic stat) {
Try(out = p->CalculateFlatStat(creature, stat);)
}
export uint8_t CreatureLib_BattleStatCalculator_CalculateBoostedStat(uint32_t& out, const BattleStatCalculator* p,
Creature* creature,
CreatureLib::Library::Statistic stat) {
export u8 CreatureLib_BattleStatCalculator_CalculateBoostedStat(u32& out, const BattleStatCalculator* p,
Creature* creature,
CreatureLib::Library::Statistic stat) {
Try(out = p->CalculateBoostedStat(creature, stat);)
}

View File

@ -6,8 +6,8 @@ export const ExperienceLibrary* CreatureLib_ExperienceLibrary_Construct() { retu
export void CreatureLib_ExperienceLibrary_Destruct(const ExperienceLibrary* p) { delete p; }
export uint8_t CreatureLib_ExperienceLibrary_HandleExperienceGain(const ExperienceLibrary* p, Creature* faintedMon,
Creature* opponents[], size_t opponentsCount) {
export u8 CreatureLib_ExperienceLibrary_HandleExperienceGain(const ExperienceLibrary* p, Creature* faintedMon,
Creature* opponents[], size_t opponentsCount) {
Try(auto set = std::unordered_set<ArbUt::BorrowedPtr<Creature>>(opponentsCount);
for (size_t i = 0; i < opponentsCount;
i++) { set.insert(opponents[i]); } p->HandleExperienceGain(faintedMon, set);)

View File

@ -6,6 +6,7 @@
#include <exception>
#include <sstream>
#include <string>
#include "../src/Defines.hpp"
#define export extern "C" [[maybe_unused]]
#define CreatureLibException 2;

View File

@ -53,6 +53,8 @@ endif (SHARED)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_link_options(-fuse-ld=lld)
# Only warn for unknown sanitizers. This error is not major enough to error on.
add_compile_options(-Wno-error=unknown-sanitizers)
endif ()
if (LEVEL_SIZE STREQUAL "8")