rename CEIL as DIV_ROUND_UP

Improves the name of this macro, moves it to types.h, and adds a block
of Doxygen comments to describe what it does.
This commit is contained in:
Zachary T Welch
2009-11-16 02:53:57 -08:00
parent f0ce88b3af
commit a94748ec6d
19 changed files with 60 additions and 53 deletions

View File

@@ -73,6 +73,15 @@ typedef bool _Bool;
(type *)( (char *)__mptr - offsetof(type,member) );})
/**
* Rounds @c m up to the nearest multiple of @c n using division.
* @params m The value to round up to @c n.
* @params n Round @c m up to a multiple of this number.
* @returns The rounded integer value.
*/
#define DIV_ROUND_UP(m, n) (((m) + (n) - 1) / (n))
/* DANGER!!!! here be dragons!
*
* Leave these fn's as byte accesses because it is safe