Clean the code a bit

I ran splint on the code and it complained a lot...
master
LEdoian 4 years ago
parent e669d339d5
commit 3e0929ce3d

@ -2,8 +2,6 @@
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h>
#include <err.h>
void test_and_fail(void *ptr, char *msg) { void test_and_fail(void *ptr, char *msg) {
if (ptr == NULL) { if (ptr == NULL) {
@ -25,7 +23,6 @@ int main (void) {
test_and_fail(dpy, "Could not open display"); test_and_fail(dpy, "Could not open display");
int screen_number = XDefaultScreen(dpy); int screen_number = XDefaultScreen(dpy);
Screen *screen = XDefaultScreenOfDisplay(dpy);
Window root = XRootWindow(dpy, screen_number); Window root = XRootWindow(dpy, screen_number);
// TODO: Early check that RandR is supported by dpy // TODO: Early check that RandR is supported by dpy
@ -42,5 +39,6 @@ int main (void) {
XRRSetScreenConfig(dpy, cfg, root, XRRConfigCurrentConfiguration(cfg, &cfg_rot), new, XRRConfigTimes(cfg, &cfg_ts)); XRRSetScreenConfig(dpy, cfg, root, XRRConfigCurrentConfiguration(cfg, &cfg_rot), new, XRRConfigTimes(cfg, &cfg_ts));
XRRFreeScreenConfigInfo(cfg); XRRFreeScreenConfigInfo(cfg);
XCloseDisplay(dpy);
return 0; return 0;
} }

Loading…
Cancel
Save