aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/util.h5
-rw-r--r--sway/util.c2
2 files changed, 7 insertions, 0 deletions
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 @@
1#ifndef _SWAY_UTIL_H
2#define _SWAY_UTIL_H
3
1/** 4/**
2 * Wrap i into the range [0, max[ 5 * Wrap i into the range [0, max[
3 */ 6 */
4int wrap(int i, int max); 7int wrap(int i, int max);
8
9#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 @@
1#include "util.h"
2
1int wrap(int i, int max) { 3int wrap(int i, int max) {
2 return ((i % max) + max) % max; 4 return ((i % max) + max) % max;
3} 5}