mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-19 16:11:23 +00:00
Add casts to F32 Map/MapIterator functions to get rid of double to float conversion warnings
This commit is contained in:
parent
5b3f597438
commit
92761feee1
1 changed files with 18 additions and 2 deletions
|
@ -162,7 +162,15 @@ template<typename M> void MapInsert(M * self, expand_types_vm<typename M::KeyTyp
|
|||
MAP_GC_WRITE_BARRIER(self);
|
||||
GC::WriteBarrier(value);
|
||||
}
|
||||
self->Insert(key, value);
|
||||
|
||||
if constexpr(std::is_same_v<typename M::ValueType, float>)
|
||||
{
|
||||
self->Insert(key,static_cast<float>(value));
|
||||
}
|
||||
else
|
||||
{
|
||||
self->Insert(key, value);
|
||||
}
|
||||
self->info->rev++; // invalidate iterators
|
||||
}
|
||||
|
||||
|
@ -246,7 +254,15 @@ template<typename I> void MapIteratorSetValue(I * self, expand_types_vm<typename
|
|||
GC::WriteBarrier(val);
|
||||
GC::WriteBarrier(value);
|
||||
}
|
||||
val = value;
|
||||
|
||||
if constexpr(std::is_same_v<typename I::ValueType, float>)
|
||||
{
|
||||
val = static_cast<float>(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
val = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue