Eliminate some compiler warnings, avoid seg fault when matching missing

values
This commit is contained in:
Keith Packard 2002-06-02 21:07:57 +00:00
parent 2a41214a25
commit 88c747e206
5 changed files with 14 additions and 7 deletions

View File

@ -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. * 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 * If there was a test, then replace the matched
* value with the new list of values * value with the new list of values
*/ */
if (t) if (t && st[i].elt)
{ {
FcValueList *thisValue = st[i].value; FcValueList *thisValue = st[i].value;
FcValueList *nextValue = thisValue ? thisValue->next : 0; FcValueList *nextValue = thisValue ? thisValue->next : 0;

View File

@ -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. * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* *
@ -51,6 +51,9 @@ FcValuePrint (FcValue v)
case FcTypeCharSet: /* XXX */ case FcTypeCharSet: /* XXX */
printf (" set"); printf (" set");
break; break;
case FcTypeFTFace:
printf (" face");
break;
} }
} }

View File

@ -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. * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* *
@ -224,6 +224,8 @@ FcListValueHash (FcValue v)
return FcListMatrixHash (v.u.m); return FcListMatrixHash (v.u.m);
case FcTypeCharSet: case FcTypeCharSet:
return FcCharSetCount (v.u.c); return FcCharSetCount (v.u.c);
case FcTypeFTFace:
return (FcChar32) v.u.f;
} }
return 0; return 0;
} }

View File

@ -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. * 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; FcSortNode *b = *(FcSortNode **) ab;
double *as = &a->score[0]; double *as = &a->score[0];
double *bs = &b->score[0]; double *bs = &b->score[0];
double ad, bd; double ad = 0, bd = 0;
int i; int i;
i = NUM_MATCHER; i = NUM_MATCHER;

View File

@ -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. * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc.
* *
@ -464,6 +464,8 @@ FcNameUnparseValue (FcStrBuf *buf,
return FcNameUnparseString (buf, temp, 0); return FcNameUnparseString (buf, temp, 0);
case FcTypeCharSet: case FcTypeCharSet:
return FcNameUnparseCharSet (buf, v.u.c); return FcNameUnparseCharSet (buf, v.u.c);
case FcTypeFTFace:
return FcTrue;
} }
return FcFalse; return FcFalse;
} }