diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-02-14 19:24:40 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-02-14 19:24:40 +0000 |
commit | ca3293e0332bbd9fe63d6cd6bc215f048132bd08 (patch) | |
tree | 29065b3081e1df0bbb274dbe8647e6494c76ab64 /src/utils/fpmath.h | |
parent | 0068331a1d6989ef523fca0753bd9ad943232cdf (diff) | |
download | libcss-ca3293e0332bbd9fe63d6cd6bc215f048132bd08.tar.gz libcss-ca3293e0332bbd9fe63d6cd6bc215f048132bd08.tar.bz2 |
Make fpmath stuff public.
Un-inline string->fixed conversion routine.
svn path=/trunk/libcss/; revision=6513
Diffstat (limited to 'src/utils/fpmath.h')
-rw-r--r-- | src/utils/fpmath.h | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/utils/fpmath.h b/src/utils/fpmath.h deleted file mode 100644 index c4db605..0000000 --- a/src/utils/fpmath.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of LibCSS. - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org> - */ - -#ifndef css_utils_fpmath_h_ -#define css_utils_fpmath_h_ - -#include <stdint.h> - -/* 22:10 fixed point math */ -typedef int32_t fixed; - -/* Add two fixed point values */ -#define FADD(a, b) ((a) + (b)) -/* Subtract two fixed point values */ -#define FSUB(a, b) ((a) - (b)) -/* Multiply two fixed point values */ -#define FMUL(a, b) (((a) * (b)) >> 10) -/* Divide two fixed point values */ -#define FDIV(a, b) (((a) << 10) / (b)) - -/* Add an integer to a fixed point value */ -#define FADDI(a, b) ((a) + ((b) << 10)) -/* Subtract an integer from a fixed point value */ -#define FSUBI(a, b) ((a) - ((b) << 10)) -/* Multiply a fixed point value by an integer */ -#define FMULI(a, b) ((a) * (b)) -/* Divide a fixed point value by an integer */ -#define FDIVI(a, b) ((a) / (b)) - -/* Convert a floating point value to fixed point */ -#define FLTTOFIX(a) ((fixed) ((a) * (float) (1 << 10))) -/* Convert a fixed point value to floating point */ -#define FIXTOFLT(a) ((float) (a) / (float) (1 << 10)) - -/* Convert an integer to a fixed point value */ -#define INTTOFIX(a) ((a) << 10) -/* Convert a fixed point value to an integer */ -#define FIXTOINT(a) ((a) >> 10) - -#include "utils/fpconstants.h" - -#endif - |