summaryrefslogtreecommitdiff
path: root/include/fitz/base_math.h
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-02-28 17:47:50 +0100
committerTor Andersson <tor@ghostscript.com>2009-02-28 17:47:50 +0100
commit9d1fbd85969dbfcf5de9e458f7d9387f3fc8959c (patch)
tree163e47d4656492c873d19006bae9f697a3565ff6 /include/fitz/base_math.h
parent4ee4da1c6d2db727790dd72a60a7f29d43e802b9 (diff)
downloadmupdf-9d1fbd85969dbfcf5de9e458f7d9387f3fc8959c.tar.xz
Merge and move header files into the source directories.
Diffstat (limited to 'include/fitz/base_math.h')
-rw-r--r--include/fitz/base_math.h29
1 files changed, 0 insertions, 29 deletions
diff --git a/include/fitz/base_math.h b/include/fitz/base_math.h
deleted file mode 100644
index 4dee81fc..00000000
--- a/include/fitz/base_math.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* multiply 8-bit fixpoint (0..1) so that 0*0==0 and 255*255==255 */
-#define fz_mul255(a,b) (((a) * ((b) + 1)) >> 8)
-#define fz_floor(x) floor(x)
-#define fz_ceil(x) ceil(x)
-
-/* divide and floor towards -inf */
-static inline int fz_idiv(int a, int b)
-{
- return a < 0 ? (a - b + 1) / b : a / b;
-}
-
-/* from python */
-static inline void fz_idivmod(int x, int y, int *d, int *m)
-{
- int xdivy = x / y;
- int xmody = x - xdivy * y;
- /* If the signs of x and y differ, and the remainder is non-0,
- * C89 doesn't define whether xdivy is now the floor or the
- * ceiling of the infinitely precise quotient. We want the floor,
- * and we have it iff the remainder's sign matches y's.
- */
- if (xmody && ((y ^ xmody) < 0)) {
- xmody += y;
- xdivy --;
- }
- *d = xdivy;
- *m = xmody;
-}
-