Inline FcDebug invocations and only initialize once, in FcInit*. Improve
debug msg in FcPatternPrint. reviewed by: plam
This commit is contained in:
parent
d2f459781c
commit
b97a34b592
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
2005-11-24 Dirk Mueller <dmueller@suse.com>
|
||||
reviewed by: plam
|
||||
|
||||
* src/fcdbg.c (FcDebug, FcDebugInit, FcPatternPrint):
|
||||
* src/fcinit.c (FcInitLoadConfig, FcInitLoadConfigAndFonts):
|
||||
* src/fcint.h (FcDebug):
|
||||
|
||||
Inline FcDebug invocations and only initialize once, in FcInit*.
|
||||
Improve debug msg in FcPatternPrint.
|
||||
|
||||
2005-11-23 Frederic Crozat <fcrozat@mandriva.com>:
|
||||
reviewed by: plam
|
||||
|
||||
|
|
30
src/fcdbg.c
30
src/fcdbg.c
|
@ -106,7 +106,7 @@ FcPatternPrint (const FcPattern *p)
|
|||
printf ("Null pattern\n");
|
||||
return;
|
||||
}
|
||||
printf ("Pattern %d of %d\n", p->num, p->size);
|
||||
printf ("Pattern has %d elts (size %d)\n", p->num, p->size);
|
||||
for (i = 0; i < p->num; i++)
|
||||
{
|
||||
e = FcPatternEltU(p->elts) + i;
|
||||
|
@ -339,25 +339,19 @@ FcFontSetPrint (const FcFontSet *s)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
FcDebug (void)
|
||||
int FcDebugVal;
|
||||
|
||||
void
|
||||
FcInitDebug (void)
|
||||
{
|
||||
static int initialized;
|
||||
static int debug;
|
||||
char *e;
|
||||
|
||||
if (!initialized)
|
||||
e = getenv ("FC_DEBUG");
|
||||
if (e)
|
||||
{
|
||||
char *e;
|
||||
|
||||
initialized = 1;
|
||||
e = getenv ("FC_DEBUG");
|
||||
if (e)
|
||||
{
|
||||
printf ("FC_DEBUG=%s\n", e);
|
||||
debug = atoi (e);
|
||||
if (debug < 0)
|
||||
debug = 0;
|
||||
}
|
||||
printf ("FC_DEBUG=%s\n", e);
|
||||
FcDebugVal = atoi (e);
|
||||
if (FcDebugVal < 0)
|
||||
FcDebugVal = 0;
|
||||
}
|
||||
return debug;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ FcInitLoadConfig (void)
|
|||
{
|
||||
FcConfig *config;
|
||||
|
||||
FcInitDebug ();
|
||||
config = FcConfigCreate ();
|
||||
if (!config)
|
||||
return FcFalse;
|
||||
|
@ -78,6 +79,7 @@ FcInitLoadConfigAndFonts (void)
|
|||
{
|
||||
FcConfig *config = FcInitLoadConfig ();
|
||||
|
||||
FcInitDebug ();
|
||||
if (!config)
|
||||
return 0;
|
||||
if (!FcConfigBuildFonts (config))
|
||||
|
|
|
@ -594,8 +594,13 @@ FcEditPrint (const FcEdit *edit);
|
|||
void
|
||||
FcSubstPrint (const FcSubst *subst);
|
||||
|
||||
int
|
||||
FcDebug (void);
|
||||
extern int FcDebugVal;
|
||||
|
||||
static __inline__ int
|
||||
FcDebug (void) { return FcDebugVal; }
|
||||
|
||||
void
|
||||
FcInitDebug (void);
|
||||
|
||||
/* fcdefault.c */
|
||||
FcChar8 *
|
||||
|
|
Loading…
Reference in New Issue