mirror of
https://github.com/NickHu/sway
synced 2025-02-07 20:46:17 +01:00
added missing util.h/c stuff
This commit is contained in:
parent
e854a54e96
commit
e533014201
2 changed files with 7 additions and 0 deletions
|
@ -1,4 +1,9 @@
|
||||||
|
#ifndef _SWAY_UTIL_H
|
||||||
|
#define _SWAY_UTIL_H
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrap i into the range [0, max[
|
* Wrap i into the range [0, max[
|
||||||
*/
|
*/
|
||||||
int wrap(int i, int max);
|
int wrap(int i, int max);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
int wrap(int i, int max) {
|
int wrap(int i, int max) {
|
||||||
return ((i % max) + max) % max;
|
return ((i % max) + max) % max;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue