More docs added.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index 0e05091..3ec8ed5 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -35,6 +35,21 @@
#include <ftobjs.h> /* for ABS() */
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Sqrt32 */
+ /* */
+ /* <Description> */
+ /* Computes the square root of an Int32 integer (which will be */
+ /* as an unsigned long value). */
+ /* */
+ /* <Input> */
+ /* x :: The value to compute the root for. */
+ /* */
+ /* <Return> */
+ /* The result of `sqrt(x)'. */
+ /* */
BASE_FUNC
FT_Int32 FT_Sqrt32( FT_Int32 x )
{
@@ -48,10 +63,10 @@
do
{
newroot = root + mask;
- if (newroot <= val)
+ if ( newroot <= val )
{
val -= newroot;
- root = newroot+mask;
+ root = newroot + mask;
}
root >>= 1;
@@ -72,7 +87,7 @@
/* FT_MulDiv */
/* */
/* <Description> */
- /* A very simple function used to perform the computation `(A*B)/C' */
+ /* A very simple function used to perform the computation `(a*b)/c' */
/* with maximum accuracy (it uses a 64-bit intermediate integer */
/* whenever necessary). */
/* */
@@ -113,7 +128,7 @@
/* */
/* <Description> */
/* A very simple function used to perform the computation */
- /* `(A*B)/0x10000' with maximum accuracy. Most of the time this is */
+ /* `(a*b)/0x10000' with maximum accuracy. Most of the time this is */
/* used to multiply a given value by a 16.16 fixed float factor. */
/* */
/* <Input> */
@@ -157,7 +172,7 @@
/* */
/* <Description> */
/* A very simple function used to perform the computation */
- /* `(A*0x10000)/B' with maximum accuracy. Most of the time, this is */
+ /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
/* used to divide a given value by a 16.16 fixed float factor. */
/* */
/* <Input> */
@@ -205,7 +220,7 @@
/* FT_MulDiv */
/* */
/* <Description> */
- /* A very simple function used to perform the computation `(A*B)/C' */
+ /* A very simple function used to perform the computation `(a*b)/c' */
/* with maximum accuracy (it uses a 64-bit intermediate integer */
/* whenever necessary). */
/* */
@@ -281,7 +296,7 @@
/* */
/* <Description> */
/* A very simple function used to perform the computation */
- /* `(A*B)/0x10000' with maximum accuracy. Most of the time, this is */
+ /* `(a*b)/0x10000' with maximum accuracy. Most of the time, this is */
/* used to multiply a given value by a 16.16 fixed float factor. */
/* */
/* <Input> */
@@ -341,7 +356,7 @@
/* */
/* <Description> */
/* A very simple function used to perform the computation */
- /* `(A*0x10000)/B' with maximum accuracy. Most of the time, this is */
+ /* `(a*0x10000)/b' with maximum accuracy. Most of the time, this is */
/* used to divide a given value by a 16.16 fixed float factor. */
/* */
/* <Input> */
@@ -401,6 +416,21 @@
}
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Add64 */
+ /* */
+ /* <Description> */
+ /* Add two Int64 values. Will be wrapped by the ADD_64() macro. */
+ /* */
+ /* <Input> */
+ /* x :: A pointer to the first value to be added. */
+ /* y :: A pointer to the second value to be added. */
+ /* */
+ /* <InOut> */
+ /* z :: A pointer to the result of `x + y'. */
+ /* */
BASE_FUNC
void FT_Add64( FT_Int64* x,
FT_Int64* y,
@@ -416,6 +446,22 @@
}
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulTo64 */
+ /* */
+ /* <Description> */
+ /* Multiplies two Int32 integers. Returns a Int64 integer. Will be */
+ /* wrapped by the MUL_64() macro. */
+ /* */
+ /* <Input> */
+ /* x :: The first multiplier. */
+ /* y :: The second multiplier. */
+ /* */
+ /* <InOut> */
+ /* z :: A pointer to the result of `x * y'. */
+ /* */
BASE_FUNC
void FT_MulTo64( FT_Int32 x,
FT_Int32 y,
@@ -463,6 +509,22 @@
}
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Div64by32 */
+ /* */
+ /* <Description> */
+ /* Divides an Int64 value by an Int32 value. Returns an Int32 */
+ /* integer. Will be wrapped by the DIV_64() macro. */
+ /* */
+ /* <Input> */
+ /* x :: A pointer to the dividend. */
+ /* y :: The divisor. */
+ /* */
+ /* <Return> */
+ /* The result of `x / y'. */
+ /* */
BASE_FUNC
FT_Int32 FT_Div64by32( FT_Int64* x,
FT_Int32 y )