More whitespace

This commit is contained in:
Behdad Esfahbod 2010-04-12 12:10:05 -04:00
parent 2b0f3f1128
commit d0d1f3904c
1 changed files with 44 additions and 44 deletions

View File

@ -383,7 +383,7 @@ typedef struct _FcPStack {
FcStrBuf str; FcStrBuf str;
FcChar8 *attr_buf_static[16]; FcChar8 *attr_buf_static[16];
} FcPStack; } FcPStack;
typedef enum _FcVStackTag { typedef enum _FcVStackTag {
FcVStackNone, FcVStackNone,
@ -393,16 +393,16 @@ typedef enum _FcVStackTag {
FcVStackConstant, FcVStackConstant,
FcVStackGlob, FcVStackGlob,
FcVStackPattern, FcVStackPattern,
FcVStackPrefer, FcVStackPrefer,
FcVStackAccept, FcVStackAccept,
FcVStackDefault, FcVStackDefault,
FcVStackInteger, FcVStackInteger,
FcVStackDouble, FcVStackDouble,
FcVStackMatrix, FcVStackMatrix,
FcVStackBool, FcVStackBool,
FcVStackTest, FcVStackTest,
FcVStackExpr, FcVStackExpr,
FcVStackEdit FcVStackEdit
@ -529,7 +529,7 @@ FcTypecheckExpr (FcConfigParse *parse, FcExpr *expr, FcType type)
{ {
const FcObjectType *o; const FcObjectType *o;
const FcConstant *c; const FcConstant *c;
/* If parsing the expression failed, some nodes may be NULL */ /* If parsing the expression failed, some nodes may be NULL */
if (!expr) if (!expr)
return; return;
@ -566,8 +566,8 @@ FcTypecheckExpr (FcConfigParse *parse, FcExpr *expr, FcType type)
if (o) if (o)
FcTypecheckValue (parse, o->type, type); FcTypecheckValue (parse, o->type, type);
} }
else else
FcConfigMessage (parse, FcSevereWarning, FcConfigMessage (parse, FcSevereWarning,
"invalid constant used : %s", "invalid constant used : %s",
expr->u.constant); expr->u.constant);
break; break;
@ -618,7 +618,7 @@ FcTypecheckExpr (FcConfigParse *parse, FcExpr *expr, FcType type)
static FcTest * static FcTest *
FcTestCreate (FcConfigParse *parse, FcTestCreate (FcConfigParse *parse,
FcMatchKind kind, FcMatchKind kind,
FcQual qual, FcQual qual,
const FcChar8 *field, const FcChar8 *field,
FcOp compare, FcOp compare,
@ -817,7 +817,7 @@ static void
FcVStackPopAndDestroy (FcConfigParse *parse) FcVStackPopAndDestroy (FcConfigParse *parse)
{ {
FcVStack *vstack = parse->vstack; FcVStack *vstack = parse->vstack;
if (!vstack || vstack->pstack != parse->pstack) if (!vstack || vstack->pstack != parse->pstack)
return; return;
@ -954,8 +954,8 @@ static FcBool
FcPStackPop (FcConfigParse *parse) FcPStackPop (FcConfigParse *parse)
{ {
FcPStack *old; FcPStack *old;
if (!parse->pstack) if (!parse->pstack)
{ {
FcConfigMessage (parse, FcSevereError, "mismatching element"); FcConfigMessage (parse, FcSevereError, "mismatching element");
return FcFalse; return FcFalse;
@ -1026,11 +1026,11 @@ FcStartElement(void *userData, const XML_Char *name, const XML_Char **attr)
{ {
FcConfigParse *parse = userData; FcConfigParse *parse = userData;
FcElement element; FcElement element;
element = FcElementMap (name); element = FcElementMap (name);
if (element == FcElementUnknown) if (element == FcElementUnknown)
FcConfigMessage (parse, FcSevereWarning, "unknown element \"%s\"", name); FcConfigMessage (parse, FcSevereWarning, "unknown element \"%s\"", name);
if (!FcPStackPush (parse, element, attr)) if (!FcPStackPush (parse, element, attr))
{ {
FcConfigMessage (parse, FcSevereError, "out of memory"); FcConfigMessage (parse, FcSevereError, "out of memory");
@ -1087,7 +1087,7 @@ FcParseInt (FcConfigParse *parse)
{ {
FcChar8 *s, *end; FcChar8 *s, *end;
int l; int l;
if (!parse->pstack) if (!parse->pstack)
return; return;
s = FcStrBufDoneStatic (&parse->pstack->str); s = FcStrBufDoneStatic (&parse->pstack->str);
@ -1106,13 +1106,13 @@ FcParseInt (FcConfigParse *parse)
} }
/* /*
* idea copied from glib g_ascii_strtod with * idea copied from glib g_ascii_strtod with
* permission of the author (Alexander Larsson) * permission of the author (Alexander Larsson)
*/ */
#include <locale.h> #include <locale.h>
static double static double
FcStrtod (char *s, char **end) FcStrtod (char *s, char **end)
{ {
struct lconv *locale_data; struct lconv *locale_data;
@ -1168,7 +1168,7 @@ FcParseDouble (FcConfigParse *parse)
{ {
FcChar8 *s, *end; FcChar8 *s, *end;
double d; double d;
if (!parse->pstack) if (!parse->pstack)
return; return;
s = FcStrBufDoneStatic (&parse->pstack->str); s = FcStrBufDoneStatic (&parse->pstack->str);
@ -1190,7 +1190,7 @@ static void
FcParseString (FcConfigParse *parse, FcVStackTag tag) FcParseString (FcConfigParse *parse, FcVStackTag tag)
{ {
FcChar8 *s; FcChar8 *s;
if (!parse->pstack) if (!parse->pstack)
return; return;
s = FcStrBufDone (&parse->pstack->str); s = FcStrBufDone (&parse->pstack->str);
@ -1209,7 +1209,7 @@ FcParseMatrix (FcConfigParse *parse)
FcVStack *vstack; FcVStack *vstack;
enum { m_done, m_xx, m_xy, m_yx, m_yy } matrix_state = m_yy; enum { m_done, m_xx, m_xy, m_yx, m_yy } matrix_state = m_yy;
FcMatrix m; FcMatrix m;
while ((vstack = FcVStackPeek (parse))) while ((vstack = FcVStackPeek (parse)))
{ {
double v; double v;
@ -1275,7 +1275,7 @@ FcConfigLexBinding (FcConfigParse *parse,
FcValueBinding *binding_ret) FcValueBinding *binding_ret)
{ {
FcValueBinding binding; FcValueBinding binding;
if (!binding_string) if (!binding_string)
binding = FcValueBindingWeak; binding = FcValueBindingWeak;
else else
@ -1426,7 +1426,7 @@ FcParseAlias (FcConfigParse *parse)
} }
if (prefer) if (prefer)
{ {
edit = FcEditCreate (parse, edit = FcEditCreate (parse,
FC_FAMILY_OBJECT, FC_FAMILY_OBJECT,
FcOpPrepend, FcOpPrepend,
prefer, prefer,
@ -1611,7 +1611,7 @@ FcParseInclude (FcConfigParse *parse)
FcChar8 *s; FcChar8 *s;
const FcChar8 *i; const FcChar8 *i;
FcBool ignore_missing = FcFalse; FcBool ignore_missing = FcFalse;
s = FcStrBufDoneStatic (&parse->pstack->str); s = FcStrBufDoneStatic (&parse->pstack->str);
if (!s) if (!s)
{ {
@ -1637,7 +1637,7 @@ FcConfigLexOp (const FcChar8 *op, const FcOpMap *map, int nmap)
int i; int i;
for (i = 0; i < nmap; i++) for (i = 0; i < nmap; i++)
if (!strcmp ((char *) op, map[i].name)) if (!strcmp ((char *) op, map[i].name))
return map[i].op; return map[i].op;
return FcOpInvalid; return FcOpInvalid;
} }
@ -1846,7 +1846,7 @@ FcParseMatch (FcConfigParse *parse)
vstack->tag = FcVStackNone; vstack->tag = FcVStackNone;
if (kind == FcMatchScan && edit->object > FC_MAX_BASE_OBJECT) if (kind == FcMatchScan && edit->object > FC_MAX_BASE_OBJECT)
{ {
FcConfigMessage (parse, FcSevereError, FcConfigMessage (parse, FcSevereError,
"<match target=\"scan\"> cannot edit user-defined object \"%s\"", "<match target=\"scan\"> cannot edit user-defined object \"%s\"",
FcObjectName(edit->object)); FcObjectName(edit->object));
} }
@ -1870,7 +1870,7 @@ FcParseAcceptRejectFont (FcConfigParse *parse, FcElement element)
{ {
switch (vstack->tag) { switch (vstack->tag) {
case FcVStackGlob: case FcVStackGlob:
if (!FcConfigGlobAdd (parse->config, if (!FcConfigGlobAdd (parse->config,
vstack->u.string, vstack->u.string,
element == FcElementAcceptfont)) element == FcElementAcceptfont))
{ {
@ -1901,12 +1901,12 @@ FcPopValue (FcConfigParse *parse)
{ {
FcVStack *vstack = FcVStackPeek (parse); FcVStack *vstack = FcVStackPeek (parse);
FcValue value; FcValue value;
value.type = FcTypeVoid; value.type = FcTypeVoid;
if (!vstack) if (!vstack)
return value; return value;
switch (vstack->tag) { switch (vstack->tag) {
case FcVStackString: case FcVStackString:
value.u.s = FcStrStaticName (vstack->u.string); value.u.s = FcStrStaticName (vstack->u.string);
@ -1935,12 +1935,12 @@ FcPopValue (FcConfigParse *parse)
value.type = FcTypeBool; value.type = FcTypeBool;
break; break;
default: default:
FcConfigMessage (parse, FcSevereWarning, "unknown pattern element %d", FcConfigMessage (parse, FcSevereWarning, "unknown pattern element %d",
vstack->tag); vstack->tag);
break; break;
} }
FcVStackPopAndDestroy (parse); FcVStackPopAndDestroy (parse);
return value; return value;
} }
@ -1964,7 +1964,7 @@ FcParsePatelt (FcConfigParse *parse)
FcPatternDestroy (pattern); FcPatternDestroy (pattern);
return; return;
} }
for (;;) for (;;)
{ {
value = FcPopValue (parse); value = FcPopValue (parse);
@ -2296,7 +2296,7 @@ static void
FcCharacterData (void *userData, const XML_Char *s, int len) FcCharacterData (void *userData, const XML_Char *s, int len)
{ {
FcConfigParse *parse = userData; FcConfigParse *parse = userData;
if (!parse->pstack) if (!parse->pstack)
return; return;
if (!FcStrBufData (&parse->pstack->str, (FcChar8 *) s, len)) if (!FcStrBufData (&parse->pstack->str, (FcChar8 *) s, len))
@ -2382,18 +2382,18 @@ FcConfigParseAndLoadDir (FcConfig *config,
ret = FcFalse; ret = FcFalse;
goto bail1; goto bail1;
} }
strcpy ((char *) file, (char *) dir); strcpy ((char *) file, (char *) dir);
strcat ((char *) file, "/"); strcat ((char *) file, "/");
base = file + strlen ((char *) file); base = file + strlen ((char *) file);
files = FcStrSetCreate (); files = FcStrSetCreate ();
if (!files) if (!files)
{ {
ret = FcFalse; ret = FcFalse;
goto bail2; goto bail2;
} }
if (FcDebug () & FC_DBG_CONFIG) if (FcDebug () & FC_DBG_CONFIG)
printf ("\tScanning config dir %s\n", dir); printf ("\tScanning config dir %s\n", dir);
@ -2421,7 +2421,7 @@ FcConfigParseAndLoadDir (FcConfig *config,
if (ret) if (ret)
{ {
int i; int i;
qsort (files->strs, files->num, sizeof (FcChar8 *), qsort (files->strs, files->num, sizeof (FcChar8 *),
(int (*)(const void *, const void *)) FcSortCmpStr); (int (*)(const void *, const void *)) FcSortCmpStr);
for (i = 0; ret && i < files->num; i++) for (i = 0; ret && i < files->num; i++)
ret = FcConfigParseAndLoad (config, files->strs[i], complain); ret = FcConfigParseAndLoad (config, files->strs[i], complain);
@ -2448,18 +2448,18 @@ FcConfigParseAndLoad (FcConfig *config,
int len; int len;
FcConfigParse parse; FcConfigParse parse;
FcBool error = FcTrue; FcBool error = FcTrue;
#ifdef ENABLE_LIBXML2 #ifdef ENABLE_LIBXML2
xmlSAXHandler sax; xmlSAXHandler sax;
char buf[BUFSIZ]; char buf[BUFSIZ];
#else #else
void *buf; void *buf;
#endif #endif
filename = FcConfigFilename (name); filename = FcConfigFilename (name);
if (!filename) if (!filename)
goto bail0; goto bail0;
if (FcStrSetMember (config->configFiles, filename)) if (FcStrSetMember (config->configFiles, filename))
{ {
FcStrFree (filename); FcStrFree (filename);
@ -2483,11 +2483,11 @@ FcConfigParseAndLoad (FcConfig *config,
printf ("\tLoading config file %s\n", filename); printf ("\tLoading config file %s\n", filename);
fd = open ((char *) filename, O_RDONLY); fd = open ((char *) filename, O_RDONLY);
if (fd == -1) { if (fd == -1) {
FcStrFree (filename); FcStrFree (filename);
goto bail0; goto bail0;
} }
#ifdef ENABLE_LIBXML2 #ifdef ENABLE_LIBXML2
memset(&sax, 0, sizeof(sax)); memset(&sax, 0, sizeof(sax));
@ -2512,7 +2512,7 @@ FcConfigParseAndLoad (FcConfig *config,
#ifndef ENABLE_LIBXML2 #ifndef ENABLE_LIBXML2
XML_SetUserData (p, &parse); XML_SetUserData (p, &parse);
XML_SetDoctypeDeclHandler (p, FcStartDoctypeDecl, FcEndDoctypeDecl); XML_SetDoctypeDeclHandler (p, FcStartDoctypeDecl, FcEndDoctypeDecl);
XML_SetElementHandler (p, FcStartElement, FcEndElement); XML_SetElementHandler (p, FcStartElement, FcEndElement);
XML_SetCharacterDataHandler (p, FcCharacterData); XML_SetCharacterDataHandler (p, FcCharacterData);
@ -2541,7 +2541,7 @@ FcConfigParseAndLoad (FcConfig *config,
if (!XML_ParseBuffer (p, len, len == 0)) if (!XML_ParseBuffer (p, len, len == 0))
#endif #endif
{ {
FcConfigMessage (&parse, FcSevereError, "%s", FcConfigMessage (&parse, FcSevereError, "%s",
XML_ErrorString (XML_GetErrorCode (p))); XML_ErrorString (XML_GetErrorCode (p)));
goto bail3; goto bail3;
} }