From f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 29 Oct 2024 14:49:26 +0800 Subject: format * format * Minor test fixes * enable checking cpp format in ci --- tools/gfx/nvapi/nvapi-include.h | 27 +++++++++++++-------------- tools/gfx/nvapi/nvapi-util.cpp | 9 +++++---- tools/gfx/nvapi/nvapi-util.h | 11 ++++++----- 3 files changed, 24 insertions(+), 23 deletions(-) (limited to 'tools/gfx/nvapi') diff --git a/tools/gfx/nvapi/nvapi-include.h b/tools/gfx/nvapi/nvapi-include.h index 513977048..45a8ca77b 100644 --- a/tools/gfx/nvapi/nvapi-include.h +++ b/tools/gfx/nvapi/nvapi-include.h @@ -6,20 +6,19 @@ #ifdef GFX_NVAPI // On windows if we include NVAPI, we must include windows.h first -# ifdef _WIN32 -# pragma push_macro("WIN32_LEAN_AND_MEAN") -# pragma push_macro("NOMINMAX") -# undef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# undef NOMINMAX -# define NOMINMAX -# include -# pragma pop_macro("NOMINMAX") -# pragma pop_macro("WIN32_LEAN_AND_MEAN") -# endif +#ifdef _WIN32 +#pragma push_macro("WIN32_LEAN_AND_MEAN") +#pragma push_macro("NOMINMAX") +#undef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#undef NOMINMAX +#define NOMINMAX +#include +#pragma pop_macro("NOMINMAX") +#pragma pop_macro("WIN32_LEAN_AND_MEAN") +#endif -# include -# include +#include +#include #endif - diff --git a/tools/gfx/nvapi/nvapi-util.cpp b/tools/gfx/nvapi/nvapi-util.cpp index 63bcc65fc..efb053c07 100644 --- a/tools/gfx/nvapi/nvapi-util.cpp +++ b/tools/gfx/nvapi/nvapi-util.cpp @@ -2,11 +2,12 @@ #include "nvapi-include.h" -namespace gfx { +namespace gfx +{ static SlangResult g_initStatus = SLANG_E_UNINITIALIZED; -/* static */SlangResult NVAPIUtil::initialize() +/* static */ SlangResult NVAPIUtil::initialize() { #ifdef GFX_NVAPI if (g_initStatus == SLANG_E_UNINITIALIZED) @@ -22,9 +23,9 @@ static SlangResult g_initStatus = SLANG_E_UNINITIALIZED; return g_initStatus; } -/* static */bool NVAPIUtil::isAvailable() +/* static */ bool NVAPIUtil::isAvailable() { return SLANG_SUCCEEDED(g_initStatus); } -} // gfx +} // namespace gfx diff --git a/tools/gfx/nvapi/nvapi-util.h b/tools/gfx/nvapi/nvapi-util.h index 0bcab7d36..7715df8c6 100644 --- a/tools/gfx/nvapi/nvapi-util.h +++ b/tools/gfx/nvapi/nvapi-util.h @@ -4,16 +4,17 @@ #include "slang-com-helper.h" #include "slang-com-ptr.h" -namespace gfx { +namespace gfx +{ struct NVAPIUtil { - /// Set up NVAPI for use. Must be called before any other function is used. + /// Set up NVAPI for use. Must be called before any other function is used. static SlangResult initialize(); - /// True if the NVAPI is available, can be called even if initialize fails. - /// If initialize has not been called will return false + /// True if the NVAPI is available, can be called even if initialize fails. + /// If initialize has not been called will return false static bool isAvailable(); }; -} // gfx +} // namespace gfx -- cgit v1.2.3