mirror of
https://github.com/microsoft/DirectXTex
synced 2024-11-25 05:40:06 +00:00
Minor code review feedback
This commit is contained in:
parent
72e9775e68
commit
94c68685a2
@ -121,7 +121,7 @@ namespace
|
|||||||
|
|
||||||
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
||||||
|
|
||||||
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
template<UINT TNameLength>
|
template<UINT TNameLength>
|
||||||
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength])
|
inline void SetDebugObjectName(_In_ ID3D11DeviceChild* resource, _In_ const char (&name)[TNameLength])
|
||||||
|
@ -119,7 +119,7 @@ namespace
|
|||||||
|
|
||||||
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
||||||
|
|
||||||
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
template<UINT TNameLength>
|
template<UINT TNameLength>
|
||||||
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength])
|
inline void SetDebugObjectName(_In_ ID3D12DeviceChild* resource, _In_z_ const wchar_t(&name)[TNameLength])
|
||||||
|
@ -25,7 +25,7 @@ struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VA
|
|||||||
|
|
||||||
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
||||||
|
|
||||||
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------
|
||||||
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
|
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
|
||||||
@ -51,7 +51,7 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear() { m_handle = 0; }
|
void clear() { m_handle = nullptr; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HANDLE m_handle;
|
HANDLE m_handle;
|
||||||
|
@ -197,7 +197,7 @@ namespace
|
|||||||
|
|
||||||
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
||||||
|
|
||||||
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
class auto_delete_file
|
class auto_delete_file
|
||||||
{
|
{
|
||||||
|
@ -197,7 +197,7 @@ namespace
|
|||||||
|
|
||||||
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
typedef std::unique_ptr<void, handle_closer> ScopedHandle;
|
||||||
|
|
||||||
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle( HANDLE h ) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
class auto_delete_file
|
class auto_delete_file
|
||||||
{
|
{
|
||||||
|
@ -286,7 +286,7 @@ const SValue g_pExtFileTypes [] =
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
|
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
|
||||||
|
|
||||||
|
@ -428,7 +428,7 @@ const SValue g_pFeatureLevels[] = // valid feature levels for -fl for maximimu
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } };
|
struct handle_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) CloseHandle(h); } };
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ const SValue g_pExtFileTypes[] =
|
|||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? 0 : h; }
|
inline HANDLE safe_handle(HANDLE h) { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
|
||||||
|
|
||||||
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
|
struct find_closer { void operator()(HANDLE h) { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user