diff --git a/external/OpenGL/GL/CMakeLists.txt b/external/OpenGL/GL/CMakeLists.txt index 5af8720ab..c8048349e 100644 --- a/external/OpenGL/GL/CMakeLists.txt +++ b/external/OpenGL/GL/CMakeLists.txt @@ -23,6 +23,11 @@ # add_library(MagnumGLLoadGenObjects OBJECT gl_magnum.c) -set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -fvisibility=hidden -DGLLoadGen_EXPORTS") + +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -fvisibility=hidden -DGLLoadGen_EXPORTS") +else() + set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -DGLLoadGen_EXPORTS") +endif() install(FILES gl_magnum.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/GL) diff --git a/src/AbstractImage.cpp b/src/AbstractImage.cpp index d593752a7..4442dad7b 100644 --- a/src/AbstractImage.cpp +++ b/src/AbstractImage.cpp @@ -133,7 +133,6 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) { } CORRADE_ASSERT_UNREACHABLE(); - return 0; } } diff --git a/src/AbstractShaderProgram.cpp b/src/AbstractShaderProgram.cpp index 33705c0a7..89123cae3 100644 --- a/src/AbstractShaderProgram.cpp +++ b/src/AbstractShaderProgram.cpp @@ -764,7 +764,6 @@ std::size_t FloatAttribute::size(GLint components, DataType dataType) { } CORRADE_ASSERT_UNREACHABLE(); - return 0; } #ifndef MAGNUM_TARGET_GLES2 @@ -782,7 +781,6 @@ std::size_t IntAttribute::size(GLint components, DataType dataType) { } CORRADE_ASSERT_UNREACHABLE(); - return 0; } #endif @@ -794,7 +792,6 @@ std::size_t DoubleAttribute::size(GLint components, DataType dataType) { } CORRADE_ASSERT_UNREACHABLE(); - return 0; } #endif @@ -829,7 +826,6 @@ std::size_t Attribute>::size(GLint components, DataType d } CORRADE_ASSERT_UNREACHABLE(); - return 0; } Debug operator<<(Debug debug, SizedAttribute<1, 1>::Components value) { diff --git a/src/AbstractShaderProgram.h b/src/AbstractShaderProgram.h index 3fdfd7abb..119cee213 100644 --- a/src/AbstractShaderProgram.h +++ b/src/AbstractShaderProgram.h @@ -1321,9 +1321,9 @@ template class AbstractShaderProgram::Attribute { constexpr DataOptions dataOptions() const { return _dataOptions; } private: - const Components _components; - const DataType _dataType; - const DataOptions _dataOptions; + Components _components; + DataType _dataType; + DataOptions _dataOptions; }; #ifdef DOXYGEN_GENERATING_OUTPUT diff --git a/src/Color.h b/src/Color.h index 0eacc0c59..b3235a877 100644 --- a/src/Color.h +++ b/src/Color.h @@ -45,7 +45,7 @@ template typename std::enable_if::value, Basi std::tie(hue, saturation, value) = hsv; /* Remove repeats */ - hue -= int(hue.toUnderlyingType()/T(360))*Math::Deg(360); + hue -= Math::floor(hue.toUnderlyingType()/T(360))*Math::Deg(360); if(hue < Math::Deg(0)) hue += Math::Deg(360); int h = int(hue.toUnderlyingType()/T(60)) % 6; diff --git a/src/DebugTools/ResourceManager.cpp b/src/DebugTools/ResourceManager.cpp index 6b385af7d..8a8491f55 100644 --- a/src/DebugTools/ResourceManager.cpp +++ b/src/DebugTools/ResourceManager.cpp @@ -35,7 +35,11 @@ namespace Magnum { +#ifndef _WIN32 template class ResourceManager; +#else +template class MAGNUM_DEBUGTOOLS_EXPORT ResourceManager; +#endif namespace DebugTools { diff --git a/src/DebugTools/ResourceManager.h b/src/DebugTools/ResourceManager.h index bbccf3731..d075c51aa 100644 --- a/src/DebugTools/ResourceManager.h +++ b/src/DebugTools/ResourceManager.h @@ -55,7 +55,11 @@ namespace Magnum { /** @todo Do the listing in one place, not five thousand! */ +#ifndef _WIN32 extern template ResourceManager MAGNUM_DEBUGTOOLS_EXPORT *& ResourceManager::internalInstance(); +#else +extern template class MAGNUM_DEBUGTOOLS_EXPORT ResourceManager; +#endif namespace DebugTools { diff --git a/src/Math/Algorithms/Svd.h b/src/Math/Algorithms/Svd.h index 0f0c1a1e4..15839bcc8 100644 --- a/src/Math/Algorithms/Svd.h +++ b/src/Math/Algorithms/Svd.h @@ -49,7 +49,7 @@ template T pythagoras(T a, T b) { } template constexpr T smallestDelta(); -template<> constexpr Float smallestDelta() { return 1.0e-32; } +template<> constexpr Float smallestDelta() { return 1.0e-32f; } #ifndef MAGNUM_TARGET_GLES template<> constexpr Double smallestDelta() { return 1.0e-64; } #endif diff --git a/src/Math/Functions.h b/src/Math/Functions.h index fe9661db5..4bc1a5145 100644 --- a/src/Math/Functions.h +++ b/src/Math/Functions.h @@ -286,12 +286,12 @@ template Vector ceil(const Vector& template inline T sqrt(const T& a); #else template inline typename std::enable_if::value, T>::type sqrt(T a) { - return std::sqrt(a); + return T(std::sqrt(a)); } template Vector sqrt(const Vector& a) { Vector out; for(std::size_t i = 0; i != size; ++i) - out[i] = std::sqrt(a[i]); + out[i] = T(std::sqrt(a[i])); return out; } #endif @@ -350,7 +350,7 @@ The interpolation for vectors is done as in following, similarly for scalars: @f template inline T lerp(const T& a, const T& b, U t); #else template inline T lerp(T a, T b, U t) { - return (U(1) - t)*a + t*b; + return T((U(1) - t)*a + t*b); } template inline Vector lerp(const Vector& a, const Vector& b, U t) { return (U(1) - t)*a + t*b; @@ -472,7 +472,7 @@ template inline Integral denormalize(const template inline typename std::enable_if::value, Integral>::type denormalize(FloatingPoint value) { static_assert(std::is_floating_point::value && std::is_integral::value, "Math::denormalize(): denormalization must be done from floating-point to integral type"); - return value*std::numeric_limits::max(); + return Integral(value*std::numeric_limits::max()); } template inline typename std::enable_if::value, Integral>::type denormalize(const FloatingPoint& value) { static_assert(std::is_floating_point::value && std::is_integral::value, diff --git a/src/Math/Test/UnitTest.cpp b/src/Math/Test/UnitTest.cpp index c7dbb4472..4029d4b45 100644 --- a/src/Math/Test/UnitTest.cpp +++ b/src/Math/Test/UnitTest.cpp @@ -76,7 +76,7 @@ void UnitTest::constructDefault() { } void UnitTest::constructConversion() { - constexpr Seci a(25.0); + constexpr Seci a(25); constexpr Sec b(a); CORRADE_COMPARE(b, Sec(25.0f)); diff --git a/src/Math/Unit.h b/src/Math/Unit.h index ab2449ecb..ad1bbd6d6 100644 --- a/src/Math/Unit.h +++ b/src/Math/Unit.h @@ -51,7 +51,7 @@ template class Derived, class T> class Unit { constexpr explicit Unit(T value): value(value) {} /** @brief Construct from another underlying type */ - template constexpr explicit Unit(Unit value): value(value.value) {} + template constexpr explicit Unit(Unit value): value(T(value.value)) {} /** @brief Explicit conversion to underlying type */ constexpr T toUnderlyingType() const { return value; } diff --git a/src/Math/Vector.h b/src/Math/Vector.h index ccde04b55..a3c1e4f81 100644 --- a/src/Math/Vector.h +++ b/src/Math/Vector.h @@ -894,7 +894,7 @@ typename std::enable_if::value && std::is_floating_po #endif operator*=(Vector& vector, FloatingPoint number) { for(std::size_t i = 0; i != size; ++i) - vector[i] *= number; + vector[i] = Integral(vector[i]*number); return vector; } @@ -945,7 +945,7 @@ typename std::enable_if::value && std::is_floating_po #endif operator/=(Vector& vector, FloatingPoint number) { for(std::size_t i = 0; i != size; ++i) - vector[i] /= number; + vector[i] = Integral(vector[i]/number); return vector; } @@ -981,7 +981,7 @@ typename std::enable_if::value && std::is_floating_po #endif operator*=(Vector& a, const Vector& b) { for(std::size_t i = 0; i != size; ++i) - a[i] *= b[i]; + a[i] = Integral(a[i]*b[i]); return a; } @@ -1034,7 +1034,7 @@ typename std::enable_if::value && std::is_floating_po #endif operator/=(Vector& a, const Vector& b) { for(std::size_t i = 0; i != size; ++i) - a[i] /= b[i]; + a[i] = Integral(a[i]/b[i]); return a; } diff --git a/src/MeshTools/RemoveDuplicates.h b/src/MeshTools/RemoveDuplicates.h index 28cb1c65f..b3c08a809 100644 --- a/src/MeshTools/RemoveDuplicates.h +++ b/src/MeshTools/RemoveDuplicates.h @@ -123,7 +123,7 @@ template void RemoveDuplicates; diff --git a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp index 276784a3e..91ed60cfe 100644 --- a/src/Plugins/TgaImageConverter/TgaImageConverter.cpp +++ b/src/Plugins/TgaImageConverter/TgaImageConverter.cpp @@ -78,15 +78,15 @@ Containers::Array TgaImageConverter::doExportToData(const ImageRe } /* Initialize data buffer */ - const UnsignedByte pixelSize = image.pixelSize(); + const auto pixelSize = UnsignedByte(image.pixelSize()); auto data = Containers::Array::zeroInitialized(sizeof(TgaHeader) + pixelSize*image.size().product()); /* Fill header */ auto header = reinterpret_cast(data.begin()); header->imageType = image.format() == ColorFormat::Red ? 3 : 2; header->bpp = pixelSize*8; - header->width = Utility::Endianness::littleEndian(image.size().x()); - header->height = Utility::Endianness::littleEndian(image.size().y()); + header->width = UnsignedShort(Utility::Endianness::littleEndian(image.size().x())); + header->height = UnsignedShort(Utility::Endianness::littleEndian(image.size().y())); /* Fill data */ std::copy(image.data(), image.data()+pixelSize*image.size().product(), data.begin()+sizeof(TgaHeader)); diff --git a/src/Primitives/Capsule.cpp b/src/Primitives/Capsule.cpp index 41e3057b5..34d3efe83 100644 --- a/src/Primitives/Capsule.cpp +++ b/src/Primitives/Capsule.cpp @@ -47,7 +47,7 @@ Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt /* Bottom hemisphere */ for(UnsignedInt i = 0; i != hemisphereRings; ++i) { - const Rad angle((i+1)*angleIncrement); + const Rad angle(Float(i+1)*angleIncrement); const Float x = Math::sin(angle); const Float y = -Math::cos(angle)-halfLength; positions.insert(positions.end(), {{-x, y}, {x, y}}); @@ -61,7 +61,7 @@ Trade::MeshData2D Capsule2D::wireframe(UnsignedInt hemisphereRings, UnsignedInt /* Top hemisphere */ for(UnsignedInt i = 0; i != hemisphereRings; ++i) { - const Rad angle(i*angleIncrement); + const Rad angle(Float(i)*angleIncrement); const Float x = Math::cos(angle); const Float y = Math::sin(angle)+halfLength; positions.insert(positions.end(), {{-x, y}, {x, y}}); diff --git a/src/Primitives/Circle.cpp b/src/Primitives/Circle.cpp index 89a72142c..ffb6eec93 100644 --- a/src/Primitives/Circle.cpp +++ b/src/Primitives/Circle.cpp @@ -44,7 +44,7 @@ Trade::MeshData2D Circle::solid(UnsignedInt segments) { /* Points on circle */ const Rad angleIncrement(2*Constants::pi()/segments); for(UnsignedInt i = 0; i != segments; ++i) { - const Rad angle(i*angleIncrement); + const Rad angle(Float(i)*angleIncrement); positions.emplace_back(Math::cos(angle), Math::sin(angle)); } @@ -62,7 +62,7 @@ Trade::MeshData2D Circle::wireframe(UnsignedInt segments) { /* Points on circle */ const Rad angleIncrement(2*Constants::pi()/segments); for(UnsignedInt i = 0; i != segments; ++i) { - const Rad angle(i*angleIncrement); + const Rad angle(Float(i)*angleIncrement); positions.emplace_back(Math::cos(angle), Math::sin(angle)); } diff --git a/src/Primitives/Implementation/Spheroid.cpp b/src/Primitives/Implementation/Spheroid.cpp index 506221c73..e8a1a1cb6 100644 --- a/src/Primitives/Implementation/Spheroid.cpp +++ b/src/Primitives/Implementation/Spheroid.cpp @@ -44,12 +44,12 @@ void Spheroid::hemisphereVertexRings(UnsignedInt count, Float centerY, Rad start Rad segmentAngleIncrement(2*Constants::pi()/segments); Float x, y, z; for(UnsignedInt i = 0; i != count; ++i) { - Rad ringAngle = startRingAngle + i*ringAngleIncrement; + Rad ringAngle = startRingAngle + Float(i)*ringAngleIncrement; x = z = Math::cos(ringAngle); y = Math::sin(ringAngle); for(UnsignedInt j = 0; j != segments; ++j) { - Rad segmentAngle = j*segmentAngleIncrement; + Rad segmentAngle = Float(j)*segmentAngleIncrement; positions.push_back({x*Math::sin(segmentAngle), centerY+y, z*Math::cos(segmentAngle)}); normals.push_back({x*Math::sin(segmentAngle), y, z*Math::cos(segmentAngle)}); @@ -70,7 +70,7 @@ void Spheroid::cylinderVertexRings(UnsignedInt count, Float startY, Float yIncre Rad segmentAngleIncrement(2*Constants::pi()/segments); for(UnsignedInt i = 0; i != count; ++i) { for(UnsignedInt j = 0; j != segments; ++j) { - Rad segmentAngle = j*segmentAngleIncrement; + Rad segmentAngle = Float(j)*segmentAngleIncrement; positions.push_back({Math::sin(segmentAngle), startY, Math::cos(segmentAngle)}); normals.push_back({Math::sin(segmentAngle), 0.0f, Math::cos(segmentAngle)}); @@ -144,7 +144,7 @@ void Spheroid::capVertexRing(Float y, Float textureCoordsV, const Vector3& norma Rad segmentAngleIncrement(2*Constants::pi()/segments); for(UnsignedInt i = 0; i != segments; ++i) { - Rad segmentAngle = i*segmentAngleIncrement; + Rad segmentAngle = Float(i)*segmentAngleIncrement; positions.push_back({Math::sin(segmentAngle), y, Math::cos(segmentAngle)}); normals.push_back(normal); diff --git a/src/Primitives/Implementation/WireframeSpheroid.cpp b/src/Primitives/Implementation/WireframeSpheroid.cpp index edde8cf54..213928fe8 100644 --- a/src/Primitives/Implementation/WireframeSpheroid.cpp +++ b/src/Primitives/Implementation/WireframeSpheroid.cpp @@ -45,7 +45,7 @@ void WireframeSpheroid::bottomHemisphere(const Float endY, const UnsignedInt rin /* Hemisphere vertices and indices */ const Rad ringAngleIncrement(Constants::pi()/(2*rings)); for(UnsignedInt j = 0; j != rings-1; ++j) { - const Rad angle = (j+1)*ringAngleIncrement; + const Rad angle = Float(j+1)*ringAngleIncrement; _positions.emplace_back(0.0f, endY - Math::cos(angle), Math::sin(angle)); _positions.emplace_back(Math::sin(angle), endY - Math::cos(angle), 0.0f); @@ -66,7 +66,7 @@ void WireframeSpheroid::topHemisphere(const Float startY, const UnsignedInt ring /* Hemisphere vertices and indices */ const Rad ringAngleIncrement(Constants::pi()/(2*rings)); for(UnsignedInt j = 0; j != rings-1; ++j) { - const Rad angle = (j+1)*ringAngleIncrement; + const Rad angle = Float(j+1)*ringAngleIncrement; /* Connect previous hemisphere ring to current vertices */ if(j != 0) for(UnsignedInt i = 0; i != 4; ++i) @@ -91,7 +91,7 @@ void WireframeSpheroid::ring(const Float y) { const Rad segmentAngleIncrement(Constants::pi()/(2*_segments)); for(UnsignedInt j = 0; j != _segments; ++j) { for(UnsignedInt i = 0; i != 4; ++i) { - const Rad segmentAngle = Rad(i*Constants::pi()/2) + j*segmentAngleIncrement; + const Rad segmentAngle = Rad(Float(i)*Constants::pi()/2) + Float(j)*segmentAngleIncrement; if(j != 0) _indices.insert(_indices.end(), {UnsignedInt(_positions.size()-4), UnsignedInt(_positions.size())}); _positions.emplace_back(Math::sin(segmentAngle), y, Math::cos(segmentAngle)); } diff --git a/src/SceneGraph/DualComplexTransformation.h b/src/SceneGraph/DualComplexTransformation.h index be97fe9be..8d89c531a 100644 --- a/src/SceneGraph/DualComplexTransformation.h +++ b/src/SceneGraph/DualComplexTransformation.h @@ -129,7 +129,7 @@ template class BasicDualComplexTransformation: public AbstractBasicTran } void doRotate(Math::Rad angle, TransformationType type) override final { - doRotate(angle, type); + rotate(angle, type); } /* No assertions fired, for internal use */ diff --git a/src/SceneGraph/MatrixTransformation2D.h b/src/SceneGraph/MatrixTransformation2D.h index 6ae7a5254..78a1964b3 100644 --- a/src/SceneGraph/MatrixTransformation2D.h +++ b/src/SceneGraph/MatrixTransformation2D.h @@ -129,7 +129,7 @@ template class BasicMatrixTransformation2D: public AbstractBasicTransla } void doRotate(Math::Rad angle, TransformationType type) override final { - doRotate(angle, type); + rotate(angle, type); } void doScale(const Math::Vector2& vector, TransformationType type) override final { diff --git a/src/SceneGraph/Object.hpp b/src/SceneGraph/Object.hpp index 7c91f2b8a..abff06550 100644 --- a/src/SceneGraph/Object.hpp +++ b/src/SceneGraph/Object.hpp @@ -213,7 +213,7 @@ template std::vector Ob with different counter */ if(objects[i]->counter != 0xFFFFu) continue; - objects[i]->counter = i; + objects[i]->counter = UnsignedShort(i); objects[i]->flags |= Flag::Joint; } std::vector*> jointObjects(objects); @@ -253,7 +253,7 @@ template std::vector Ob CORRADE_ASSERT(jointObjects.size() < 0xFFFFu, "SceneGraph::Object::transformations(): too large scene", std::vector{}); CORRADE_INTERNAL_ASSERT(parent->counter == 0xFFFFu); - parent->counter = jointObjects.size(); + parent->counter = UnsignedShort(jointObjects.size()); parent->flags |= Flag::Joint; jointObjects.push_back(parent); } @@ -283,7 +283,7 @@ template std::vector Ob for(auto it = jointObjects.begin(); it != jointObjects.end(); ++it) { /* All not-already cleaned objects (...duplicate occurences) should have joint mark */ - CORRADE_INTERNAL_ASSERT((*it)->counter = 0xFFFFu || (*it)->flags & Flag::Joint); + CORRADE_INTERNAL_ASSERT((*it)->counter == 0xFFFFu || (*it)->flags & Flag::Joint); #ifndef CORRADE_GCC45_COMPATIBILITY (*it)->flags &= ~Flag::Joint; #else diff --git a/src/SceneGraph/RigidMatrixTransformation2D.h b/src/SceneGraph/RigidMatrixTransformation2D.h index 53c5a7537..caf05a7fe 100644 --- a/src/SceneGraph/RigidMatrixTransformation2D.h +++ b/src/SceneGraph/RigidMatrixTransformation2D.h @@ -146,7 +146,7 @@ template class BasicRigidMatrixTransformation2D: public AbstractBasicTr } void doRotate(Math::Rad angle, TransformationType type) override final { - doRotate(angle, type); + rotate(angle, type); } /* No assertions fired, for internal use */ diff --git a/src/Shader.cpp b/src/Shader.cpp index ca23919f2..71be9d215 100644 --- a/src/Shader.cpp +++ b/src/Shader.cpp @@ -616,7 +616,7 @@ Shader& Shader::addFile(const std::string& filename) { /* Get size of shader and initialize buffer */ file.seekg(0, std::ios::end); - std::string source(file.tellg(), '\0'); + std::string source(std::size_t(file.tellg()), '\0'); /* Read data, close */ file.seekg(0, std::ios::beg); diff --git a/src/Text/AbstractFont.cpp b/src/Text/AbstractFont.cpp index bdd3673a4..9af558c7d 100644 --- a/src/Text/AbstractFont.cpp +++ b/src/Text/AbstractFont.cpp @@ -94,7 +94,7 @@ std::pair AbstractFont::doOpenFile(const std::string& filename, co /* Create array to hold file contents */ in.seekg(0, std::ios::end); - Containers::Array data(in.tellg()); + Containers::Array data(std::size_t(in.tellg())); /* Read data, close */ in.seekg(0, std::ios::beg); diff --git a/src/Text/AbstractFontConverter.cpp b/src/Text/AbstractFontConverter.cpp index b8566e392..f78653f49 100644 --- a/src/Text/AbstractFontConverter.cpp +++ b/src/Text/AbstractFontConverter.cpp @@ -249,7 +249,7 @@ std::unique_ptr AbstractFontConverter::doImportGlyphCacheFromFile(co /* Create array to hold file contents */ in.seekg(0, std::ios::end); - Containers::Array data(in.tellg()); + Containers::Array data(std::size_t(in.tellg())); /* Read data, close */ in.seekg(0, std::ios::beg); diff --git a/src/Text/Renderer.cpp b/src/Text/Renderer.cpp index 8effda67e..8269357a9 100644 --- a/src/Text/Renderer.cpp +++ b/src/Text/Renderer.cpp @@ -43,8 +43,8 @@ template void createIndices(void* output, const UnsignedInt glyphCount) | | |/ / | 1---3 1 3---4 */ - const T vertex = i*4; - const T pos = i*6; + const T vertex = T(i)*4; + const T pos = T(i)*6; out[pos] = vertex; out[pos+1] = vertex+1; out[pos+2] = vertex+2; diff --git a/src/Timeline.cpp b/src/Timeline.cpp index 94cecc19f..6d6c2b65e 100644 --- a/src/Timeline.cpp +++ b/src/Timeline.cpp @@ -51,11 +51,11 @@ void Timeline::nextFrame() { if(!running) return; auto now = high_resolution_clock::now(); - UnsignedInt duration = duration_cast(now-_previousFrameTime).count(); + auto duration = UnsignedInt(duration_cast(now-_previousFrameTime).count()); _previousFrameDuration = duration/1e6f; if(_previousFrameDuration < _minimalFrameTime) { - Utility::sleep(_minimalFrameTime*1000 - duration/1000); + Utility::sleep(std::size_t(_minimalFrameTime*1000) - duration/1000); now = high_resolution_clock::now(); _previousFrameDuration = duration_cast(now-_previousFrameTime).count()/1e6f; } diff --git a/src/Trade/AbstractImporter.cpp b/src/Trade/AbstractImporter.cpp index 746131086..36f1b247e 100644 --- a/src/Trade/AbstractImporter.cpp +++ b/src/Trade/AbstractImporter.cpp @@ -76,7 +76,7 @@ void AbstractImporter::doOpenFile(const std::string& filename) { /* Create array to hold file contents */ in.seekg(0, std::ios::end); - Containers::Array data(in.tellg()); + Containers::Array data(std::size_t(in.tellg())); /* Read data, close */ in.seekg(0, std::ios::beg); diff --git a/src/Trade/Test/AbstractImageConverterTest.cpp b/src/Trade/Test/AbstractImageConverterTest.cpp index 2a4f53776..fd0ef8864 100644 --- a/src/Trade/Test/AbstractImageConverterTest.cpp +++ b/src/Trade/Test/AbstractImageConverterTest.cpp @@ -53,8 +53,8 @@ void AbstractImageConverterTest::exportToFile() { Containers::Array doExportToData(const ImageReference2D& image) const override { Containers::Array out(2); - out[0] = image.size().x(); - out[1] = image.size().y(); + out[0] = static_cast(image.size().x()); + out[1] = static_cast(image.size().y()); return out; }; };