From e1120cf4e2b0ad11c8244d4b5de03bf95682ad19 Mon Sep 17 00:00:00 2001 From: Patrick Date: Wed, 14 Oct 2015 16:55:09 +0800 Subject: make argc handling less obnoxious, let enum do its thing --- x-alt-tab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-alt-tab.c b/x-alt-tab.c index e13d435..a979177 100644 --- a/x-alt-tab.c +++ b/x-alt-tab.c @@ -12,7 +12,7 @@ If not, see http://creativecommons.org/publicdomain/zero/1.0/ */ #include // Which way do we want to rotate the window stack? -typedef enum RotationEnum { bottom_to_top = 0, top_to_bottom = 1 } Rotation; +typedef enum RotationEnum { bottom_to_top, top_to_bottom } Rotation; void x_alt_tab(Rotation r, Display *dpy, Window *wins, unsigned int nwins) { XWindowAttributes attr; @@ -55,7 +55,7 @@ int main(int argc, char **argv) { if (nwins <= 1) return 0; - r = argc % 2 ? top_to_bottom : bottom_to_top; + r = (argc == 1) ? bottom_to_top : top_to_bottom; x_alt_tab(r, dpy, wins, nwins); return 0; } -- cgit v1.2.3