1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-10-20 05:22:21 -04:00
polybar/include/utils/memory.hpp
Michael Carlberg 39d3f61497 refactor(core): Clean-up
- use "#pragma once" instead of the regular include guard
- fix errors and warnings reported by cppcheck
2016-06-02 01:32:06 +02:00

13 lines
395 B
C++

#pragma once
// Swap the two ints without the need of creating another tmp variable
#define int_memswap(one, two) one += two; \
two = one ? two; \
one -= two;
#define _repeat(n, var_name) for (int var_name = n; var_name--;)
#define repeat(n) _repeat(n, i)
#define repeat_(n) _repeat(n, i_)
#define repeat_with(n, m) for (m = n; m--;)
#define repeat_i i
#define repeat_i_rev(n) (n - i - 1)