Replace macros with C++17 features (see issue #3362)

- Convert ALLOW_UNUSED_LOCAL to [[maybe_unused]]
- Convert WARN_UNUSED_RESULT to [[nodiscard]]
This commit is contained in:
Marshall Greenblatt
2022-07-27 12:52:42 -04:00
parent 02d7a758fe
commit a9043f2e80
8 changed files with 16 additions and 47 deletions

View File

@@ -18,8 +18,7 @@ class ScopedGLContext {
public:
ScopedGLContext(HDC hdc, HGLRC hglrc, bool swap_buffers)
: hdc_(hdc), swap_buffers_(swap_buffers) {
BOOL result = wglMakeCurrent(hdc, hglrc);
ALLOW_UNUSED_LOCAL(result);
[[maybe_unused]] BOOL result = wglMakeCurrent(hdc, hglrc);
DCHECK(result);
}
~ScopedGLContext() {
@@ -188,8 +187,7 @@ void OsrRenderHandlerWinGL::DisableGL() {
if (IsWindow(hwnd())) {
// wglDeleteContext will make the context not current before deleting it.
BOOL result = wglDeleteContext(hrc_);
ALLOW_UNUSED_LOCAL(result);
[[maybe_unused]] BOOL result = wglDeleteContext(hrc_);
DCHECK(result);
ReleaseDC(hwnd(), hdc_);
}