From 6ce7466b21030b85e68f46ae1c56e00d667b9732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 30 Jan 2014 22:39:17 +0100 Subject: [PATCH] Use UnsignedInt instead of std::size_t for attribute sizes/offsets. --- src/Magnum/AbstractShaderProgram.cpp | 8 ++++---- src/Magnum/AbstractShaderProgram.h | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/AbstractShaderProgram.cpp index 5ffcaa358..b3bc39a7e 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/AbstractShaderProgram.cpp @@ -806,7 +806,7 @@ void AbstractShaderProgram::uniformImplementationDSA(const GLint location, const namespace Implementation { -std::size_t FloatAttribute::size(GLint components, DataType dataType) { +UnsignedInt FloatAttribute::size(GLint components, DataType dataType) { switch(dataType) { case DataType::UnsignedByte: case DataType::Byte: @@ -829,7 +829,7 @@ std::size_t FloatAttribute::size(GLint components, DataType dataType) { } #ifndef MAGNUM_TARGET_GLES2 -std::size_t IntAttribute::size(GLint components, DataType dataType) { +UnsignedInt IntAttribute::size(GLint components, DataType dataType) { switch(dataType) { case DataType::UnsignedByte: case DataType::Byte: @@ -847,7 +847,7 @@ std::size_t IntAttribute::size(GLint components, DataType dataType) { #endif #ifndef MAGNUM_TARGET_GLES -std::size_t DoubleAttribute::size(GLint components, DataType dataType) { +UnsignedInt DoubleAttribute::size(GLint components, DataType dataType) { switch(dataType) { case DataType::Double: return 8*components; @@ -857,7 +857,7 @@ std::size_t DoubleAttribute::size(GLint components, DataType dataType) { } #endif -std::size_t Attribute>::size(GLint components, DataType dataType) { +UnsignedInt Attribute>::size(GLint components, DataType dataType) { #ifndef MAGNUM_TARGET_GLES if(components == GL_BGRA) components = 4; #endif diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/AbstractShaderProgram.h index 7186b692e..fcf00d4bf 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/AbstractShaderProgram.h @@ -1195,7 +1195,7 @@ struct FloatAttribute { }; typedef Containers::EnumSet DataOptions; - static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; CORRADE_ENUMSET_OPERATORS(FloatAttribute::DataOptions) @@ -1220,7 +1220,7 @@ struct IntAttribute { enum class DataOption: UnsignedByte {}; typedef Containers::EnumSet DataOptions; - static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; Debug MAGNUM_EXPORT operator<<(Debug debug, IntAttribute::DataType value); @@ -1235,7 +1235,7 @@ struct UnsignedIntAttribute { typedef IntAttribute::DataOption DataOption; typedef Containers::EnumSet DataOptions; - static std::size_t size(GLint components, DataType dataType) { + static UnsignedInt size(GLint components, DataType dataType) { return IntAttribute::size(components, dataType); } }; @@ -1254,7 +1254,7 @@ struct DoubleAttribute { enum class DataOption: UnsignedByte {}; typedef Containers::EnumSet DataOptions; - static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; Debug MAGNUM_EXPORT operator<<(Debug debug, DoubleAttribute::DataType value); @@ -1308,7 +1308,7 @@ template<> struct Attribute> { enum: UnsignedInt { VectorCount = 1 }; - static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); }; typedef Math::Vector<4, Float> _Vector4;