/*
- * $XFree86: xc/lib/fontconfig/src/fcpat.c,v 1.15 2002/08/22 07:36:45 keithp Exp $
+ * $RCSId: xc/lib/fontconfig/src/fcpat.c,v 1.18 2002/09/18 17:11:46 tsi Exp $
*
- * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
+ * Copyright © 2000 Keith Packard
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
struct _FcValueListEnt {
FcValueListEnt *next;
- FcChar32 hash;
FcValueList *list;
+ FcChar32 hash, pad;
};
+typedef union _FcValueListAlign {
+ FcValueListEnt ent;
+ FcValueList list;
+} FcValueListAlign;
+
static int FcValueListFrozenCount[FcTypeLangSet + 1];
static int FcValueListFrozenBytes[FcTypeLangSet + 1];
static char *FcValueListFrozenName[] = {
static FcValueListEnt *
FcValueListEntCreate (FcValueList *h)
{
+ FcValueListAlign *ea;
FcValueListEnt *e;
FcValueList *l, *new;
int n;
string_size += strlen ((char *) l->value.u.s) + 1;
n++;
}
- size = sizeof (FcValueListEnt) + n * sizeof (FcValueList) + string_size;
+ size = sizeof (FcValueListAlign) + n * sizeof (FcValueList) + string_size;
FcValueListFrozenCount[h->value.type]++;
FcValueListFrozenBytes[h->value.type] += size;
- e = malloc (size);
- if (!e)
+ ea = malloc (size);
+ if (!ea)
return 0;
FcMemAlloc (FC_MEM_VALLIST, size);
- e->list = (FcValueList *) (e + 1);
+ e = &ea->ent;
+ e->list = (FcValueList *) (ea + 1);
strs = (FcChar8 *) (e->list + n);
new = e->list;
- for (l = h; l; l = l->next)
+ for (l = h; l; l = l->next, new++)
{
if (l->value.type == FcTypeString)
{
strs += strlen ((char *) strs) + 1;
}
else
- new->value = FcValueSave (l->value);
+ {
+ new->value = l->value;
+ new->value = FcValueSave (new->value);
+ }
new->binding = l->binding;
if (l->next)
new->next = new + 1;
int i;
for (i = 0; i < b->num; i++)
- hash = ((hash << 1) | (hash >> 31)) ^ ((FcChar32) b->elts[i].values);
+ hash = ((hash << 1) | (hash >> 31)) ^ ((long) b->elts[i].values);
return hash;
}
}
FcResult
-FcPatternGet (FcPattern *p, const char *object, int id, FcValue *v)
+FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v)
{
FcPatternElt *e;
FcValueList *l;
}
FcResult
-FcPatternGetInteger (FcPattern *p, const char *object, int id, int *i)
+FcPatternGetInteger (const FcPattern *p, const char *object, int id, int *i)
{
FcValue v;
FcResult r;
}
FcResult
-FcPatternGetDouble (FcPattern *p, const char *object, int id, double *d)
+FcPatternGetDouble (const FcPattern *p, const char *object, int id, double *d)
{
FcValue v;
FcResult r;
}
FcResult
-FcPatternGetString (FcPattern *p, const char *object, int id, FcChar8 ** s)
+FcPatternGetString (const FcPattern *p, const char *object, int id, FcChar8 ** s)
{
FcValue v;
FcResult r;
}
FcResult
-FcPatternGetMatrix (FcPattern *p, const char *object, int id, FcMatrix **m)
+FcPatternGetMatrix(const FcPattern *p, const char *object, int id, FcMatrix **m)
{
FcValue v;
FcResult r;
FcResult
-FcPatternGetBool (FcPattern *p, const char *object, int id, FcBool *b)
+FcPatternGetBool(const FcPattern *p, const char *object, int id, FcBool *b)
{
FcValue v;
FcResult r;
}
FcResult
-FcPatternGetCharSet (FcPattern *p, const char *object, int id, FcCharSet **c)
+FcPatternGetCharSet(const FcPattern *p, const char *object, int id, FcCharSet **c)
{
FcValue v;
FcResult r;
}
FcResult
-FcPatternGetFTFace (FcPattern *p, const char *object, int id, FT_Face *f)
+FcPatternGetFTFace(const FcPattern *p, const char *object, int id, FT_Face *f)
{
FcValue v;
FcResult r;
}
FcResult
-FcPatternGetLangSet (FcPattern *p, const char *object, int id, FcLangSet **ls)
+FcPatternGetLangSet(const FcPattern *p, const char *object, int id, FcLangSet **ls)
{
FcValue v;
FcResult r;
}
FcPattern *
-FcPatternDuplicate (FcPattern *orig)
+FcPatternDuplicate (const FcPattern *orig)
{
FcPattern *new;
int i;