From 3c79b6897317ee55f3d3789d14d616a55bd9d645 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Wed, 26 Feb 2020 15:55:05 -0800 Subject: [PATCH] constexpr usage for IsValid --- DirectXTex/DirectXTex.h | 2 +- DirectXTex/DirectXTex.inl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DirectXTex/DirectXTex.h b/DirectXTex/DirectXTex.h index a7e0681..f5660f3 100644 --- a/DirectXTex/DirectXTex.h +++ b/DirectXTex/DirectXTex.h @@ -40,7 +40,7 @@ namespace DirectX //--------------------------------------------------------------------------------- // DXGI Format Utilities - bool __cdecl IsValid(_In_ DXGI_FORMAT fmt) noexcept; + constexpr bool __cdecl IsValid(_In_ DXGI_FORMAT fmt) noexcept; bool __cdecl IsCompressed(_In_ DXGI_FORMAT fmt) noexcept; bool __cdecl IsPacked(_In_ DXGI_FORMAT fmt) noexcept; bool __cdecl IsVideo(_In_ DXGI_FORMAT fmt) noexcept; diff --git a/DirectXTex/DirectXTex.inl b/DirectXTex/DirectXTex.inl index a430b25..aa501b1 100644 --- a/DirectXTex/DirectXTex.inl +++ b/DirectXTex/DirectXTex.inl @@ -16,7 +16,7 @@ //===================================================================================== _Use_decl_annotations_ -inline bool __cdecl IsValid(DXGI_FORMAT fmt) noexcept +constexpr inline bool __cdecl IsValid(DXGI_FORMAT fmt) noexcept { return (static_cast(fmt) >= 1 && static_cast(fmt) <= 190); }