From 8ac54e8b148bb131d53e1e46226f34de2116f99b Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 9 Apr 2014 18:12:10 +0200 Subject: [PATCH] Formatting. --- src/monitor.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/monitor.c b/src/monitor.c index 26a6f1d5..eccbd433 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -37,31 +37,22 @@ static int compareVideoModes(const void* firstPtr, const void* secondPtr) { int firstBPP, secondBPP, firstSize, secondSize; - GLFWvidmode* first = (GLFWvidmode*) firstPtr; - GLFWvidmode* second = (GLFWvidmode*) secondPtr; + const GLFWvidmode* first = firstPtr; + const GLFWvidmode* second = secondPtr; // First sort on color bits per pixel - - firstBPP = first->redBits + - first->greenBits + - first->blueBits; - secondBPP = second->redBits + - second->greenBits + - second->blueBits; - + firstBPP = first->redBits + first->greenBits + first->blueBits; + secondBPP = second->redBits + second->greenBits + second->blueBits; if (firstBPP != secondBPP) return firstBPP - secondBPP; // Then sort on screen area, in pixels - firstSize = first->width * first->height; secondSize = second->width * second->height; - if (firstSize != secondSize) return firstSize - secondSize; // Lastly sort on refresh rate - return first->refreshRate - second->refreshRate; }