diff --git a/src/x11_fullscreen.c b/src/x11_fullscreen.c
index f7855c4..567ecfc 100644
--- a/src/x11_fullscreen.c
+++ b/src/x11_fullscreen.c
@@ -323,7 +323,7 @@ struct _glfwResolution
int _glfwPlatformGetVideoModes(GLFWvidmode* list, int maxcount)
{
int count, k, l, r, g, b, rgba, gl;
- int depth, screen;
+ int depth, screen = 0;
XVisualInfo* vislist;
XVisualInfo dummy;
int viscount, rgbcount, rescount;
diff --git a/src/x11_init.c b/src/x11_init.c
index 3ed9ab1..2d5f98c 100644
--- a/src/x11_init.c
+++ b/src/x11_init.c
@@ -470,8 +470,8 @@ static void initGammaRamp(void)
// RandR gamma support is only available with version 1.2 and above
if (_glfwLibrary.X11.RandR.available &&
(_glfwLibrary.X11.RandR.majorVersion > 1 ||
- _glfwLibrary.X11.RandR.majorVersion == 1 &&
- _glfwLibrary.X11.RandR.minorVersion >= 2))
+ _glfwLibrary.X11.RandR.majorVersion == 1 ) &&
+ _glfwLibrary.X11.RandR.minorVersion >= 2)
{
// FIXME: Assumes that all monitors have the same size gamma tables
// This is reasonable as I suspect the that if they did differ, it
diff --git a/src/x11_time.c b/src/x11_time.c
index 4184d32..99f747e 100644
--- a/src/x11_time.c
+++ b/src/x11_time.c
@@ -31,6 +31,7 @@
#include "internal.h"
#include <time.h>
+#include <sys/time.h>
//========================================================================