Remove unnecessary parentheses

This commit is contained in:
Chris Thrasher 2023-07-12 01:14:51 -06:00
parent 37575e4ed7
commit 62c376ffa5
10 changed files with 17 additions and 17 deletions

View File

@ -420,7 +420,7 @@ Image Texture::copyToImage() const
// Handle the case where source pixels are flipped vertically
if (m_pixelsFlipped)
{
src += static_cast<unsigned int>(srcPitch * static_cast<int>((m_size.y - 1)));
src += static_cast<unsigned int>(srcPitch * static_cast<int>(m_size.y - 1));
srcPitch = -srcPitch;
}

View File

@ -73,19 +73,19 @@ termios newTerminalConfig, oldTerminalConfig; // Terminal configurations
bool altDown()
{
return (keyMap[sf::Keyboard::LAlt] || keyMap[sf::Keyboard::RAlt]);
return keyMap[sf::Keyboard::LAlt] || keyMap[sf::Keyboard::RAlt];
}
bool controlDown()
{
return (keyMap[sf::Keyboard::LControl] || keyMap[sf::Keyboard::RControl]);
return keyMap[sf::Keyboard::LControl] || keyMap[sf::Keyboard::RControl];
}
bool shiftDown()
{
return (keyMap[sf::Keyboard::LShift] || keyMap[sf::Keyboard::RShift]);
return keyMap[sf::Keyboard::LShift] || keyMap[sf::Keyboard::RShift];
}
bool systemDown()
{
return (keyMap[sf::Keyboard::LSystem] || keyMap[sf::Keyboard::RSystem]);
return keyMap[sf::Keyboard::LSystem] || keyMap[sf::Keyboard::RSystem];
}
void uninitFileDescriptors()

View File

@ -238,7 +238,7 @@ bool EglContext::makeCurrent(bool current)
eglCheck(result = eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT));
}
return (result != EGL_FALSE);
return result != EGL_FALSE;
}

View File

@ -86,7 +86,7 @@ struct VulkanLibraryWrapper
{
entryPoint = reinterpret_cast<T>(dlsym(library, name));
return (entryPoint != nullptr);
return entryPoint != nullptr;
}
void* library{};

View File

@ -1229,7 +1229,7 @@ bool WindowImplX11::hasFocus() const
int revertToReturn = 0;
XGetInputFocus(m_display, &focusedWindow, &revertToReturn);
return (m_window == focusedWindow);
return m_window == focusedWindow;
}

View File

@ -86,7 +86,7 @@ struct VulkanLibraryWrapper
{
entryPoint = reinterpret_cast<T>(reinterpret_cast<void*>(GetProcAddress(library, name)));
return (entryPoint != nullptr);
return entryPoint != nullptr;
}
HMODULE library{};
@ -201,7 +201,7 @@ bool VulkanImplWin32::createVulkanSurface(const VkInstance& instance,
surfaceCreateInfo.hinstance = GetModuleHandleA(nullptr);
surfaceCreateInfo.hwnd = windowHandle;
return (vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, allocator, &surface) == VK_SUCCESS);
return vkCreateWin32SurfaceKHR(instance, &surfaceCreateInfo, allocator, &surface) == VK_SUCCESS;
}
} // namespace sf::priv

View File

@ -207,8 +207,8 @@ std::vector<sf::Vector2i> touchPositions;
- (bool)needsToFlipFrameForOrientation:(UIDeviceOrientation)orientation
{
sf::Vector2u size = self.sfWindow->getSize();
return ((!UIDeviceOrientationIsLandscape(orientation) && size.x > size.y) ||
(UIDeviceOrientationIsLandscape(orientation) && size.y > size.x));
return (!UIDeviceOrientationIsLandscape(orientation) && size.x > size.y) ||
(UIDeviceOrientationIsLandscape(orientation) && size.y > size.x);
}
////////////////////////////////////////////////////////////

View File

@ -113,7 +113,7 @@ GlFunctionPointer SFContext::getFunction(const char* name)
if (!image)
image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
return (image ? reinterpret_cast<GlFunctionPointer>(reinterpret_cast<intptr_t>(dlsym(image, name))) : nil);
return image ? reinterpret_cast<GlFunctionPointer>(reinterpret_cast<intptr_t>(dlsym(image, name))) : nil;
}

View File

@ -200,7 +200,7 @@
else if ([[event characters] length] > 0)
{
unichar code = [[event characters] characterAtIndex:0];
return ((code < 0xF700) || (code > 0xF8FF));
return (code < 0xF700) || (code > 0xF8FF);
}
else
{

View File

@ -189,11 +189,11 @@ TEST_CASE("[Graphics] sf::Image")
// Create the composited colour for via the alpha composite over operation
const auto a = static_cast<std::uint8_t>(source.a + (dest.a * (255 - source.a)) / 255);
const auto r = static_cast<std::uint8_t>(
((source.r * source.a) + (((dest.r * dest.a) * (255 - source.a))) / 255) / a);
((source.r * source.a) + ((dest.r * dest.a) * (255 - source.a)) / 255) / a);
const auto g = static_cast<std::uint8_t>(
((source.g * source.a) + (((dest.g * dest.a) * (255 - source.a))) / 255) / a);
((source.g * source.a) + ((dest.g * dest.a) * (255 - source.a)) / 255) / a);
const auto b = static_cast<std::uint8_t>(
((source.b * source.a) + (((dest.b * dest.a) * (255 - source.a))) / 255) / a);
((source.b * source.a) + ((dest.b * dest.a) * (255 - source.a)) / 255) / a);
const sf::Color composite(r, g, b, a);
sf::Image image1;