Some people have complained that code using the CEILING() macro is
difficult to understand because it's not immediately obvious what it
is supposed to do until you go and look up its definition. Use a more
descriptive name that matches the similar utility macro in the Linux
kernel.
Reviewed-by: Matt Turner <mattst88@gmail.com>
assert(format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX);
bytes_per_row = alignment
- * CEILING( comp_per_pixel*pixels_per_row, 8*alignment );
+ * DIV_ROUND_UP( comp_per_pixel*pixels_per_row, 8*alignment );
bytes_per_image = bytes_per_row * rows_per_image;
/** Compute ceiling of integer quotient of A divided by B. */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
+#define DIV_ROUND_UP( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
/** casts to silence warnings with some compilers */
if (!source)
return;
- width_in_bytes = CEILING( width, 8 );
+ width_in_bytes = DIV_ROUND_UP( width, 8 );
src = source;
for (row = 0; row < height; row++) {
GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dest,