From 0512748fceff819c26388324daa888ee50ba98e3 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Thu, 26 Oct 2023 15:21:10 -0600 Subject: [PATCH] Run clang-tidy on OpenGL ES codepaths --- .github/workflows/ci.yml | 13 +++++++------ src/SFML/Window/EglContext.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5660ca13..b60f654b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -222,12 +222,13 @@ jobs: fail-fast: false matrix: platform: - - { name: Windows, os: windows-2022, flags: -GNinja } - - { name: Linux, os: ubuntu-22.04 } - - { name: Linux DRM, os: ubuntu-22.04, flags: -DSFML_USE_DRM=TRUE } - - { name: macOS, os: macos-12 } - - { name: iOS, os: macos-12, flags: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 } - - { name: Android, os: ubuntu-22.04, flags: -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$GITHUB_WORKSPACE/android-ndk-r23b -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26 } + - { name: Windows, os: windows-2022, flags: -GNinja } + - { name: Linux, os: ubuntu-22.04 } + - { name: Linux DRM, os: ubuntu-22.04, flags: -DSFML_USE_DRM=TRUE } + - { name: Linux OpenGL ES, os: ubuntu-22.04, flags: -DSFML_OPENGL_ES=ON } + - { name: macOS, os: macos-12 } + - { name: iOS, os: macos-12, flags: -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=arm64 } + - { name: Android, os: ubuntu-22.04, flags: -DCMAKE_ANDROID_ARCH_ABI=x86 -DCMAKE_SYSTEM_NAME=Android -DSFML_BUILD_TEST_SUITE=FALSE -DCMAKE_ANDROID_NDK=$GITHUB_WORKSPACE/android-ndk-r23b -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=clang -DCMAKE_ANDROID_STL_TYPE=c++_shared -DCMAKE_ANDROID_API=26 } steps: - name: Checkout Code diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index 44f87357b..e2a036398 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -399,7 +399,7 @@ void EglContext::updateSettings() #if defined(SFML_SYSTEM_LINUX) && !defined(SFML_USE_DRM) //////////////////////////////////////////////////////////// -XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsPerPixel, const ContextSettings& settings) +XVisualInfo EglContext::selectBestVisual(::Display* xDisplay, unsigned int bitsPerPixel, const ContextSettings& settings) { EglContextImpl::ensureInit(); @@ -419,7 +419,7 @@ XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsP // Should never happen... err() << "No EGL visual found. You should check your graphics driver" << std::endl; - return XVisualInfo(); + return {}; } XVisualInfo vTemplate; @@ -427,14 +427,14 @@ XVisualInfo EglContext::selectBestVisual(::Display* XDisplay, unsigned int bitsP // Get X11 visuals compatible with this EGL config int visualCount = 0; - auto availableVisuals = X11Ptr(XGetVisualInfo(XDisplay, VisualIDMask, &vTemplate, &visualCount)); + auto availableVisuals = X11Ptr(XGetVisualInfo(xDisplay, VisualIDMask, &vTemplate, &visualCount)); if (visualCount == 0) { // Can't happen... err() << "No X11 visual found. Bug in your EGL implementation ?" << std::endl; - return XVisualInfo(); + return {}; } // Pick up the best one