constexpr warning

Removes warning: conditional expression is constant, consider using 'if constexpr' statement instead
This commit is contained in:
Tim R 2019-03-31 12:21:20 -07:00 committed by GitHub
parent 8755be56d6
commit 503a22960a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -323,13 +323,13 @@ namespace glm
template<typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar)
{ {
if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO) if GLM_CONSTEXPR(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_ZO)
return perspectiveLH_ZO(fovy, aspect, zNear, zFar); return perspectiveLH_ZO(fovy, aspect, zNear, zFar);
else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO) else if GLM_CONSTEXPR(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_LH_NO)
return perspectiveLH_NO(fovy, aspect, zNear, zFar); return perspectiveLH_NO(fovy, aspect, zNear, zFar);
else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO) else if GLM_CONSTEXPR(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_ZO)
return perspectiveRH_ZO(fovy, aspect, zNear, zFar); return perspectiveRH_ZO(fovy, aspect, zNear, zFar);
else if(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO) else if GLM_CONSTEXPR(GLM_CONFIG_CLIP_CONTROL == GLM_CLIP_CONTROL_RH_NO)
return perspectiveRH_NO(fovy, aspect, zNear, zFar); return perspectiveRH_NO(fovy, aspect, zNear, zFar);
} }