Mesa (master): mesa: move CEILING() macro into macros.h
Brian Paul
brianp at kemper.freedesktop.org
Tue Nov 15 14:55:25 UTC 2011
Module: Mesa
Branch: master
Commit: b098e1af1cdaea8767b8f1416469cdd02a9c39a9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b098e1af1cdaea8767b8f1416469cdd02a9c39a9
Author: Brian Paul <brianp at vmware.com>
Date: Sat Nov 12 11:50:32 2011 -0700
mesa: move CEILING() macro into macros.h
Reviewed-by: Eric Anholt <eric at anholt.net>
---
src/mesa/main/image.c | 3 ---
src/mesa/main/macros.h | 4 ++++
src/mesa/main/pack.c | 5 +----
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index 3b16d3d..3a6f01c 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -55,9 +55,6 @@
-/** Compute ceiling of integer quotient of A divided by B. */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
-
/**
* \return GL_TRUE if type is packed pixel type, GL_FALSE otherwise.
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index d90905f..029f609 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -662,6 +662,10 @@ do { \
#define LEN_SQUARED_2FV( V ) ((V)[0]*(V)[0]+(V)[1]*(V)[1])
+/** Compute ceiling of integer quotient of A divided by B. */
+#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
+
+
/** casts to silence warnings with some compilers */
#define ENUM_TO_INT(E) ((GLint)(E))
#define ENUM_TO_FLOAT(E) ((GLfloat)(GLint)(E))
diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c
index de29395..a3cfb59 100644
--- a/src/mesa/main/pack.c
+++ b/src/mesa/main/pack.c
@@ -34,6 +34,7 @@
#include "enums.h"
#include "image.h"
#include "imports.h"
+#include "macros.h"
#include "mtypes.h"
#include "pack.h"
#include "pixeltransfer.h"
@@ -58,10 +59,6 @@
-/** Compute ceiling of integer quotient of A divided by B. */
-#define CEILING( A, B ) ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
-
-
/**
* Flip the 8 bits in each byte of the given array.
*
More information about the mesa-commit
mailing list