diff options
author | Ran Benita <ran234@gmail.com> | 2014-06-15 15:30:51 +0300 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2014-06-15 15:30:51 +0300 |
commit | 9c30d6da4e44d98c3bcc1639e4ce062bbb241865 (patch) | |
tree | cf4860ad807ed5dd09f97aec6aa977e367cb8aa6 /src/utils.h | |
parent | 67d884ec141a83ea87807a3b25d79075225896e8 (diff) | |
download | xorg-lib-libxkbcommon-9c30d6da4e44d98c3bcc1639e4ce062bbb241865.tar.gz |
x11: don't iterate on empty batches
If count % SIZE == 0 we did a useless iteration where start==stop. It's
harmless but strange, so don't do that.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h index 0198f07..51d690e 100644 --- a/src/utils.h +++ b/src/utils.h @@ -187,6 +187,9 @@ unmap_file(const char *str, size_t size); #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MAX3(a, b, c) MAX(MAX((a), (b)), (c)) +/* Round up @a so it's divisible by @b. */ +#define ROUNDUP(a, b) (((a) + (b) - 1) / (b) * (b)) + #if defined(HAVE_SECURE_GETENV) # define secure_getenv secure_getenv #elif defined(HAVE___SECURE_GETENV) |