summaryrefslogtreecommitdiff
path: root/xbacklight.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-19 19:17:58 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-19 19:17:58 -0200
commit97a3f5665a62ff3a606da48f3854d082f249e6a8 (patch)
tree3552e5cb38f8c9efd7b5fbd4da060c9fd80effbd /xbacklight.c
parenta0dc8902b476fc2dddf02fceec7a7186d81f48fc (diff)
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects make distcheck and all gcc 4.3 and sparse warnings.
Diffstat (limited to 'xbacklight.c')
-rw-r--r--xbacklight.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xbacklight.c b/xbacklight.c
index d0cdb92..6eb3327 100644
--- a/xbacklight.c
+++ b/xbacklight.c
@@ -25,6 +25,10 @@
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+
typedef enum { Get, Set, Inc, Dec } op_t;
static char *program_name;
@@ -225,6 +229,9 @@ main (int argc, char **argv)
case Dec:
new = cur - set;
break;
+ default:
+ XSync (dpy, False);
+ return 1;
}
if (new > max) new = max;
if (new < min) new = min;
@@ -249,4 +256,6 @@ main (int argc, char **argv)
XRRFreeScreenResources (resources);
}
XSync (dpy, False);
+
+ return 0;
}