diff --git a/cmake/CMakePackageConfigHelpers.cmake b/cmake/CMakePackageConfigHelpers.cmake
index 48039e52..d5bf4a2f 100644
--- a/cmake/CMakePackageConfigHelpers.cmake
+++ b/cmake/CMakePackageConfigHelpers.cmake
@@ -97,7 +97,7 @@
# own custom ConfigVersion.cmake file instead of using this macro.
#
# Internally, this macro executes configure_file() to create the resulting
-# version file. Depending on the COMPATIBLITY, either the file
+# version file. Depending on the COMPATIBILITY, either the file
# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
# is used. Please note that these two files are internal to CMake and you should
# not call configure_file() on them yourself, but they can be used as starting
diff --git a/copying.txt b/copying.txt
index 4ff49c7a..7c20b4a6 100644
--- a/copying.txt
+++ b/copying.txt
@@ -7,7 +7,7 @@ a) The Happy Bunny License, or b) the MIT License.
================================================================================
The Happy Bunny License (Modified MIT License)
--------------------------------------------------------------------------------
-Copyright (c) 2005 - 2015 G-Truc Creation
+Copyright (c) 2005 - 2016 G-Truc Creation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@ THE SOFTWARE.
================================================================================
The MIT License
--------------------------------------------------------------------------------
-Copyright (c) 2005 - 2015 G-Truc Creation
+Copyright (c) 2005 - 2016 G-Truc Creation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/doc/api/a00015_source.html b/doc/api/a00015_source.html
index 63e4f58e..f5a2359a 100644
--- a/doc/api/a00015_source.html
+++ b/doc/api/a00015_source.html
@@ -75,7 +75,7 @@
GLM_FUNC_DECL genType::bool_type isdenormal(genType const &x)
Returns true if x is a denormalized number Numbers whose absolute value is too small to be represente...
-GLM_FUNC_DECL vecType< T, P > fmod(vecType< T, P > const &v)
Similiar to 'mod' but with a different rounding and integer support.
+GLM_FUNC_DECL vecType< T, P > fmod(vecType< T, P > const &v)
Similar to 'mod' but with a different rounding and integer support.
diff --git a/doc/api/a00105_source.html b/doc/api/a00105_source.html
index b76b1c91..f08df23b 100644
--- a/doc/api/a00105_source.html
+++ b/doc/api/a00105_source.html
@@ -501,7 +501,7 @@
486 # define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG)
- 489 # else // Unkown compiler
+ 489 # else // Unknown compiler
490 # if __cplusplus >= 201402L
491 # define GLM_LANG GLM_LANG_CXX14
492 # elif __cplusplus >= 201103L
diff --git a/doc/api/a00119_source.html b/doc/api/a00119_source.html
index 50d2b438..559bc9f4 100644
--- a/doc/api/a00119_source.html
+++ b/doc/api/a00119_source.html
@@ -275,7 +275,7 @@
287 #elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
288 typedef lowp_int int_t;
- 290 # error "GLM error: multiple default precision requested for signed interger types"
+ 290 # error "GLM error: multiple default precision requested for signed integer types"
293 #if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
@@ -287,7 +287,7 @@
299 #elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
300 typedef lowp_uint uint_t;
- 302 # error "GLM error: multiple default precision requested for unsigned interger types"
+ 302 # error "GLM error: multiple default precision requested for unsigned integer types"
diff --git a/doc/api/a00163.html b/doc/api/a00163.html
index 9927b222..74a42359 100644
--- a/doc/api/a00163.html
+++ b/doc/api/a00163.html
@@ -132,7 +132,7 @@ Typedefs
The standard types defined by the specification.
-These types are all typedefs of more generalized, template types. To see the definiton of these template types, go to Template types.
+These types are all typedefs of more generalized, template types. To see the definition of these template types, go to Template types.
diff --git a/doc/api/a00190.html b/doc/api/a00190.html
index f107b3de..61bd069d 100644
--- a/doc/api/a00190.html
+++ b/doc/api/a00190.html
@@ -70,7 +70,7 @@ Functions
-
Similiar to 'mod' but with a different rounding and integer support.
+
Similar to 'mod' but with a different rounding and integer support.
Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'
- See also
- GLSL mod vs HLSL fmod
-
diff --git a/doc/api/index.html b/doc/api/index.html
index 505b17dd..f0e5be72 100644
--- a/doc/api/index.html
+++ b/doc/api/index.html
@@ -54,7 +54,7 @@
- Any conform C++98 compiler
- Note
- The Doxygen-generated documentation will often state that a type or function is defined in a namespace that is a child of the glm namespace. Please ignore this; All publicly available types and functions can be accessed as a direct children of the glm namespace.
-The source code is licenced under the Happy Bunny License (Modified MIT) and MIT license.
+The source code is licensed under the Happy Bunny License (Modified MIT) and MIT license.
These pages are the API reference only. For more information about how to use GLM, please have a look at the manual.
Thanks for contributing to the project by submitting tickets for bug reports and feature requests. Any feedback is welcome at glm@g.nosp@m.-tru.nosp@m.c.net.
diff --git a/doc/pages.doxy b/doc/pages.doxy
index d91b5939..579b56f7 100644
--- a/doc/pages.doxy
+++ b/doc/pages.doxy
@@ -23,7 +23,7 @@
Please ignore this; All publicly available types and functions can be accessed as a direct children
of the glm namespace.
- The source code is licenced under the Happy Bunny License (Modified MIT) and MIT license.
+ The source code is licensed under the Happy Bunny License (Modified MIT) and MIT license.
These pages are the API reference only. For more information about how to use GLM, please have a look at the manual.
diff --git a/glm/detail/func_integer.inl b/glm/detail/func_integer.inl
index 20e29d6f..e0d5c739 100644
--- a/glm/detail/func_integer.inl
+++ b/glm/detail/func_integer.inl
@@ -208,7 +208,7 @@ namespace detail
{
uint64 const Value64(static_cast(x) + static_cast(y));
uint64 const Max32((static_cast(1) << static_cast(32)) - static_cast(1));
- Carry = Value64 > Max32 ? 1 : 0;
+ Carry = Value64 > Max32 ? 1u : 0u;
return static_cast(Value64 % (Max32 + static_cast(1)));
}
diff --git a/glm/detail/setup.hpp b/glm/detail/setup.hpp
index b4688035..2d324ef7 100644
--- a/glm/detail/setup.hpp
+++ b/glm/detail/setup.hpp
@@ -597,7 +597,7 @@
# else
# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT)
# endif
-# else // Unkown compiler
+# else // Unknown compiler
# if __cplusplus >= 201402L
# define GLM_LANG GLM_LANG_CXX14
# elif __cplusplus >= 201103L
diff --git a/glm/detail/type_int.hpp b/glm/detail/type_int.hpp
index 6aacdc19..361f6c11 100644
--- a/glm/detail/type_int.hpp
+++ b/glm/detail/type_int.hpp
@@ -287,7 +287,7 @@ namespace detail
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
typedef lowp_int int_t;
#else
-# error "GLM error: multiple default precision requested for signed interger types"
+# error "GLM error: multiple default precision requested for signed integer types"
#endif
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
@@ -299,7 +299,7 @@ namespace detail
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
typedef lowp_uint uint_t;
#else
-# error "GLM error: multiple default precision requested for unsigned interger types"
+# error "GLM error: multiple default precision requested for unsigned integer types"
#endif
/// Unsigned integer type.
diff --git a/glm/glm.hpp b/glm/glm.hpp
index 98be4466..2da82396 100644
--- a/glm/glm.hpp
+++ b/glm/glm.hpp
@@ -48,7 +48,7 @@
///
/// @brief The standard types defined by the specification.
///
-/// These types are all typedefs of more generalized, template types. To see the definiton
+/// These types are all typedefs of more generalized, template types. To see the definition
/// of these template types, go to @ref core_template.
///
/// @ingroup core
diff --git a/glm/gtc/round.inl b/glm/gtc/round.inl
index 94fdd54b..988c64a1 100644
--- a/glm/gtc/round.inl
+++ b/glm/gtc/round.inl
@@ -30,8 +30,9 @@
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////
-namespace glm
-{
+#include "../detail/func_integer.hpp"
+
+namespace glm{
namespace detail
{
template class vecType, bool compute = false>
@@ -275,7 +276,7 @@ namespace detail
template
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value)
{
- return isPowerOfTwo(value) ? value : highestBitValue(value);
+ return isPowerOfTwo(value) ? value : static_cast(1) << findMSB(value);
}
template class vecType>
@@ -293,8 +294,8 @@ namespace detail
if(isPowerOfTwo(value))
return value;
- genIUType const prev = highestBitValue(value);
- genIUType const next = prev << 1;
+ genIUType const prev = static_cast(1) << findMSB(value);
+ genIUType const next = prev << static_cast(1);
return (next - value) < (value - prev) ? next : prev;
}
diff --git a/glm/gtx/common.hpp b/glm/gtx/common.hpp
index 0c11f843..25f43cd2 100644
--- a/glm/gtx/common.hpp
+++ b/glm/gtx/common.hpp
@@ -68,7 +68,7 @@ namespace glm
template
GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x);
- /// Similiar to 'mod' but with a different rounding and integer support.
+ /// Similar to 'mod' but with a different rounding and integer support.
/// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'
///
/// @see GLSL mod vs HLSL fmod
diff --git a/readme.md b/readme.md
index 1bf66230..227347eb 100644
--- a/readme.md
+++ b/readme.md
@@ -76,6 +76,11 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
##### Deprecation:
- Removed GLM_FORCE_SIZE_FUNC define
+#### [GLM 0.9.7.5](https://github.com/g-truc/glm/tree/0.9.7) - 2016-0X-XX
+##### Fixes:
+- Fixed uaddCarry warning #497
+- Fixed roundPowerOfTwo and floorPowerOfTwo #503
+
#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19
##### Fixes:
- Fixed asinh and atanh warning with C++98 STL #484
@@ -205,7 +210,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
##### Fixes:
- Fixed scalar uaddCarry build error with Cuda #276
- Fixed C++11 explicit conversion operators detection #282
-- Fixed missing explicit convertion when using integer log2 with *vec1 types
+- Fixed missing explicit conversion when using integer log2 with *vec1 types
- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
@@ -526,7 +531,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions
- Promoted GLM_GTC_random extension: linear, gaussian and various random number
generation distribution
-- Added GLM_GTX_constants: provides usefull constants
+- Added GLM_GTX_constants: provides useful constants
- Added extension versioning
- Removed many unused namespaces
- Fixed half based type contructors
diff --git a/test/gtc/gtc_round.cpp b/test/gtc/gtc_round.cpp
index 6e961e95..149f75cd 100644
--- a/test/gtc/gtc_round.cpp
+++ b/test/gtc/gtc_round.cpp
@@ -174,7 +174,7 @@ namespace isPowerOfTwo
}
}//isPowerOfTwo
-namespace ceilPowerOfTwo
+namespace ceilPowerOfTwo_advanced
{
template
GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
@@ -290,6 +290,72 @@ namespace ceilPowerOfTwo
Error += test_int32();
Error += test_uint32();
+ return Error;
+ }
+}//namespace ceilPowerOfTwo_advanced
+
+namespace roundPowerOfTwo
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::uint32 const A = glm::roundPowerOfTwo(7u);
+ Error += A == 8u ? 0 : 1;
+
+ glm::uint32 const B = glm::roundPowerOfTwo(15u);
+ Error += B == 16u ? 0 : 1;
+
+ glm::uint32 const C = glm::roundPowerOfTwo(31u);
+ Error += C == 32u ? 0 : 1;
+
+ glm::uint32 const D = glm::roundPowerOfTwo(9u);
+ Error += D == 8u ? 0 : 1;
+
+ glm::uint32 const E = glm::roundPowerOfTwo(17u);
+ Error += E == 16u ? 0 : 1;
+
+ glm::uint32 const F = glm::roundPowerOfTwo(33u);
+ Error += F == 32u ? 0 : 1;
+
+ return Error;
+ }
+}//namespace roundPowerOfTwo
+
+namespace floorPowerOfTwo
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::uint32 const A = glm::floorPowerOfTwo(7u);
+ Error += A == 4u ? 0 : 1;
+
+ glm::uint32 const B = glm::floorPowerOfTwo(15u);
+ Error += B == 8u ? 0 : 1;
+
+ glm::uint32 const C = glm::floorPowerOfTwo(31u);
+ Error += C == 16u ? 0 : 1;
+
+ return Error;
+ }
+}//namespace floorPowerOfTwo
+
+namespace ceilPowerOfTwo
+{
+ int test()
+ {
+ int Error = 0;
+
+ glm::uint32 const A = glm::ceilPowerOfTwo(7u);
+ Error += A == 8u ? 0 : 1;
+
+ glm::uint32 const B = glm::ceilPowerOfTwo(15u);
+ Error += B == 16u ? 0 : 1;
+
+ glm::uint32 const C = glm::ceilPowerOfTwo(31u);
+ Error += C == 32u ? 0 : 1;
+
return Error;
}
}//namespace ceilPowerOfTwo
@@ -406,8 +472,11 @@ int main()
int Error(0);
Error += isPowerOfTwo::test();
+ Error += floorPowerOfTwo::test();
+ Error += roundPowerOfTwo::test();
Error += ceilPowerOfTwo::test();
-
+ Error += ceilPowerOfTwo_advanced::test();
+
# ifdef NDEBUG
Error += ceilPowerOfTwo::perf();
# endif//NDEBUG