* PERFORMANCE OF THIS SOFTWARE.
*/
+#include "fcint.h"
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
-#include "fcint.h"
-FcMatrix _id = { 1, 0, 0, 1 };
-const FcMatrixPtr FcIdentityMatrix = {
- .storage = FcStorageDynamic,
- .u.dyn = &_id
-};
+const FcMatrix FcIdentityMatrix = { 1, 0, 0, 1 };
FcMatrix *
FcMatrixCopy (const FcMatrix *mat)
return r;
}
-void
-FcMatrixPtrDestroy (FcMatrixPtr mi)
-{
- if (mi.storage == FcStorageDynamic)
- FcMatrixFree (mi.u.dyn);
-}
-
void
FcMatrixFree (FcMatrix *mat)
{
- if (mat != FcMatrixPtrU(FcIdentityMatrix))
+ if (mat != &FcIdentityMatrix)
{
FcMemFree (FC_MEM_MATRIX, sizeof (FcMatrix));
free (mat);
r.yy = 1;
FcMatrixMultiply (m, &r, m);
}
-
-static FcMatrix * matrices = 0;
-static int matrix_ptr = 0, matrix_count = 0;
-
-void
-FcMatrixClearStatic (void)
-{
- matrices = 0;
- matrix_ptr = 0;
- matrix_count = 0;
-}
-
-FcMatrix *
-FcMatrixPtrU (FcMatrixPtr mi)
-{
- switch (mi.storage)
- {
- case FcStorageDynamic:
- return mi.u.dyn;
- case FcStorageStatic:
- return &matrices[mi.u.stat];
- default:
- return 0;
-
- }
-}
-
-FcMatrixPtr
-FcMatrixPtrCreateDynamic (FcMatrix *mi)
-{
- FcMatrixPtr new;
- new.storage = FcStorageDynamic;
- new.u.dyn = mi;
- return new;
-}
-
-FcBool
-FcMatrixPrepareSerialize(FcMatrix *m)
-{
- matrix_count++;
- return FcTrue;
-}
-
-FcMatrixPtr
-FcMatrixSerialize(FcMatrix *m)
-{
- FcMatrixPtr new;
-
- if (matrix_count == matrix_ptr)
- return FcMatrixPtrCreateDynamic(0);
-
- new.storage = FcStorageStatic;
- new.u.stat = matrix_ptr++;
- return new;
-}
-
+#define __fcmatrix__
+#include "fcaliastail.h"
+#undef __fcmatrix__