From 1efda79bf2f72a416806de3159e1c2936c5fdbe9 Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 15:17:18 +0200 Subject: refactored workspace_next/prev --- include/util.h | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 include/util.h (limited to 'include/util.h') diff --git a/include/util.h b/include/util.h new file mode 100644 index 00000000..5d42b780 --- /dev/null +++ b/include/util.h @@ -0,0 +1,4 @@ +/** + * Wrap i into the range [0, max[ + */ +int wrap(int i, int max); -- cgit v1.2.3 From e533014201475648df24c1c74dbf04de65a9d16c Mon Sep 17 00:00:00 2001 From: minus Date: Tue, 25 Aug 2015 19:53:59 +0200 Subject: added missing util.h/c stuff --- include/util.h | 5 +++++ sway/util.c | 2 ++ 2 files changed, 7 insertions(+) (limited to 'include/util.h') diff --git a/include/util.h b/include/util.h index 5d42b780..8e65e6d6 100644 --- a/include/util.h +++ b/include/util.h @@ -1,4 +1,9 @@ +#ifndef _SWAY_UTIL_H +#define _SWAY_UTIL_H + /** * Wrap i into the range [0, max[ */ int wrap(int i, int max); + +#endif diff --git a/sway/util.c b/sway/util.c index 25aeb9f4..9a59ddf9 100644 --- a/sway/util.c +++ b/sway/util.c @@ -1,3 +1,5 @@ +#include "util.h" + int wrap(int i, int max) { return ((i % max) + max) % max; } -- cgit v1.2.3