aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcname.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-03-28 12:32:32 +0200
committermarha <marha@users.sourceforge.net>2012-03-28 12:32:32 +0200
commit5bcf6bf5c39ca7077ed337a7b22797211a3a3fb9 (patch)
tree6bc8ab012f89a68d99be5e23f04eeca30c9ee18d /fontconfig/src/fcname.c
parent13ab72df2e606427985cd6dcf7db694f4243936b (diff)
parent992585b1df5c2d96a2cfac3835afbe818a13165f (diff)
downloadvcxsrv-5bcf6bf5c39ca7077ed337a7b22797211a3a3fb9.tar.gz
vcxsrv-5bcf6bf5c39ca7077ed337a7b22797211a3a3fb9.tar.bz2
vcxsrv-5bcf6bf5c39ca7077ed337a7b22797211a3a3fb9.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'fontconfig/src/fcname.c')
-rw-r--r--fontconfig/src/fcname.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/fontconfig/src/fcname.c b/fontconfig/src/fcname.c
index 1b32b0ff6..d0b1ca84c 100644
--- a/fontconfig/src/fcname.c
+++ b/fontconfig/src/fcname.c
@@ -572,9 +572,10 @@ FcNameBool (const FcChar8 *v, FcBool *result)
}
static FcValue
-FcNameConvert (FcType type, FcChar8 *string, FcMatrix *m)
+FcNameConvert (FcType type, FcChar8 *string)
{
FcValue v;
+ FcMatrix m;
v.type = type;
switch (v.type) {
@@ -583,7 +584,7 @@ FcNameConvert (FcType type, FcChar8 *string, FcMatrix *m)
v.u.i = atoi ((char *) string);
break;
case FcTypeString:
- v.u.s = FcStrStaticName(string);
+ v.u.s = FcSharedStr (string);
if (!v.u.s)
v.type = FcTypeVoid;
break;
@@ -595,8 +596,8 @@ FcNameConvert (FcType type, FcChar8 *string, FcMatrix *m)
v.u.d = strtod ((char *) string, 0);
break;
case FcTypeMatrix:
- v.u.m = m;
- sscanf ((char *) string, "%lg %lg %lg %lg", &m->xx, &m->xy, &m->yx, &m->yy);
+ sscanf ((char *) string, "%lg %lg %lg %lg", &m.xx, &m.xy, &m.yx, &m.yy);
+ v.u.m = FcMatrixCopy (&m);
break;
case FcTypeCharSet:
v.u.c = FcNameParseCharSet (string);
@@ -648,7 +649,6 @@ FcNameParse (const FcChar8 *name)
FcChar8 *e;
FcChar8 delim;
FcValue v;
- FcMatrix m;
const FcObjectType *t;
const FcConstant *c;
@@ -699,31 +699,13 @@ FcNameParse (const FcChar8 *name)
name = FcNameFindNext (name, ":,", save, &delim);
if (t)
{
- v = FcNameConvert (t->type, save, &m);
+ v = FcNameConvert (t->type, save);
if (!FcPatternAdd (pat, t->object, v, FcTrue))
{
- switch (v.type) {
- case FcTypeCharSet:
- FcCharSetDestroy ((FcCharSet *) v.u.c);
- break;
- case FcTypeLangSet:
- FcLangSetDestroy ((FcLangSet *) v.u.l);
- break;
- default:
- break;
- }
+ FcValueDestroy (v);
goto bail2;
}
- switch (v.type) {
- case FcTypeCharSet:
- FcCharSetDestroy ((FcCharSet *) v.u.c);
- break;
- case FcTypeLangSet:
- FcLangSetDestroy ((FcLangSet *) v.u.l);
- break;
- default:
- break;
- }
+ FcValueDestroy (v);
}
if (delim != ',')
break;