From 88c747e20612ffcae326313f8d624b36c1235993 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 2 Jun 2002 21:07:57 +0000 Subject: [PATCH] Eliminate some compiler warnings, avoid seg fault when matching missing values --- src/fccfg.c | 4 ++-- src/fcdbg.c | 5 ++++- src/fclist.c | 4 +++- src/fcmatch.c | 4 ++-- src/fcname.c | 4 +++- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/fccfg.c b/src/fccfg.c index 65a5728..b5a9ade 100644 --- a/src/fccfg.c +++ b/src/fccfg.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.7 2002/05/29 08:21:33 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fccfg.c,v 1.8 2002/06/02 19:51:36 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -1158,7 +1158,7 @@ FcConfigSubstitute (FcConfig *config, * If there was a test, then replace the matched * value with the new list of values */ - if (t) + if (t && st[i].elt) { FcValueList *thisValue = st[i].value; FcValueList *nextValue = thisValue ? thisValue->next : 0; diff --git a/src/fcdbg.c b/src/fcdbg.c index 53789d2..9ea9c29 100644 --- a/src/fcdbg.c +++ b/src/fcdbg.c @@ -1,5 +1,5 @@ /* - * $XFree86: $ + * $XFree86: xc/lib/fontconfig/src/fcdbg.c,v 1.2 2002/02/18 22:29:28 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -51,6 +51,9 @@ FcValuePrint (FcValue v) case FcTypeCharSet: /* XXX */ printf (" set"); break; + case FcTypeFTFace: + printf (" face"); + break; } } diff --git a/src/fclist.c b/src/fclist.c index 176017d..88e6eab 100644 --- a/src/fclist.c +++ b/src/fclist.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fclist.c,v 1.2 2002/02/28 16:51:48 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fclist.c,v 1.3 2002/05/21 17:06:22 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -224,6 +224,8 @@ FcListValueHash (FcValue v) return FcListMatrixHash (v.u.m); case FcTypeCharSet: return FcCharSetCount (v.u.c); + case FcTypeFTFace: + return (FcChar32) v.u.f; } return 0; } diff --git a/src/fcmatch.c b/src/fcmatch.c index e4e2c53..e796e4b 100644 --- a/src/fcmatch.c +++ b/src/fcmatch.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fcmatch.c,v 1.7 2002/05/29 22:07:33 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fcmatch.c,v 1.8 2002/05/31 04:42:42 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -465,7 +465,7 @@ FcSortCompare (const void *aa, const void *ab) FcSortNode *b = *(FcSortNode **) ab; double *as = &a->score[0]; double *bs = &b->score[0]; - double ad, bd; + double ad = 0, bd = 0; int i; i = NUM_MATCHER; diff --git a/src/fcname.c b/src/fcname.c index 26ef53e..c93706f 100644 --- a/src/fcname.c +++ b/src/fcname.c @@ -1,5 +1,5 @@ /* - * $XFree86: xc/lib/fontconfig/src/fcname.c,v 1.4 2002/05/29 22:07:33 keithp Exp $ + * $XFree86: xc/lib/fontconfig/src/fcname.c,v 1.5 2002/06/02 20:52:06 keithp Exp $ * * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. * @@ -464,6 +464,8 @@ FcNameUnparseValue (FcStrBuf *buf, return FcNameUnparseString (buf, temp, 0); case FcTypeCharSet: return FcNameUnparseCharSet (buf, v.u.c); + case FcTypeFTFace: + return FcTrue; } return FcFalse; } -- 2.39.2