Fix a few -pedantic warnings
We're not enabling -pedantic by default, but a quick test brought up a few
issues that we should fix.
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 2b670b3..d588dbf 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -992,14 +992,6 @@
EGL_NONE
};
- sysnum = udev_device_get_sysnum(device);
- if (sysnum)
- ec->drm.id = atoi(sysnum);
- if (!sysnum || ec->drm.id < 0) {
- fprintf(stderr, "cannot get device sysnum\n");
- return -1;
- }
-
static const EGLint config_attribs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RED_SIZE, 1,
@@ -1010,6 +1002,14 @@
EGL_NONE
};
+ sysnum = udev_device_get_sysnum(device);
+ if (sysnum)
+ ec->drm.id = atoi(sysnum);
+ if (!sysnum || ec->drm.id < 0) {
+ fprintf(stderr, "cannot get device sysnum\n");
+ return -1;
+ }
+
filename = udev_device_get_devnode(device);
fd = open(filename, O_RDWR | O_CLOEXEC);
if (fd < 0) {