diff --git a/src/scripting/backend/dynarrays.cpp b/src/scripting/backend/dynarrays.cpp index 503a59f04..bbef14a8d 100644 --- a/src/scripting/backend/dynarrays.cpp +++ b/src/scripting/backend/dynarrays.cpp @@ -72,12 +72,12 @@ template void ArrayMove(T *self, T* other) template int ArrayFind(T *self, U val) { - return self->Find(val); + return self->Find(static_cast(val)); } template int ArrayPush(T *self, U val) { - return self->Push(val); + return self->Push(static_cast(val)); } template bool ArrayPop(T *self) @@ -93,7 +93,7 @@ template void ArrayDelete(T *self, int index, int count) template void ArrayInsert(T *self, int index, U val) { //int oldSize = self->Size(); - self->Insert(index, val); + self->Insert(index, static_cast(val)); // Is this even necessary? All Insert does is inserting one defined element into the array and moving the rest. // It never creates empty tailing entries. fillcount in the macro will always be 0 //if (fill) { DYNARRAY_FILL_ITEMS_SKIP(1); } diff --git a/src/tarray.h b/src/tarray.h index c31763df1..50e37e1ec 100644 --- a/src/tarray.h +++ b/src/tarray.h @@ -108,6 +108,7 @@ public: typedef TIterator iterator; typedef TIterator const_iterator; + typedef typename T value_type; iterator begin() { diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index bd87c37dc..600287ff2 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -1450,7 +1450,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, GetSize, GetTextureSize) static void GetScaledSize(int texid, DVector2 *pvec) { auto tex = TexMan.ByIndex(texid); - int x, y; + double x, y; if (tex != nullptr) { x = tex->GetScaledWidthDouble(); @@ -1481,7 +1481,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(_TexMan, GetScaledSize, GetScaledSize) static void GetScaledOffset(int texid, DVector2 *pvec) { auto tex = TexMan.ByIndex(texid); - int x, y; + double x, y; if (tex != nullptr) { x = tex->GetScaledLeftOffsetDouble(0);