Code reshuffling

This commit is contained in:
Behdad Esfahbod 2012-05-11 00:50:38 +02:00
parent 1e08830b4f
commit 6eec6f406d
1 changed files with 25 additions and 11 deletions

View File

@ -511,19 +511,33 @@ _hb_debug_msg_va (const char *what,
const char *message, const char *message,
va_list ap) va_list ap)
{ {
if (!_hb_debug (level, max_level))
return TRUE;
static const char bars[] = "││││││││││││││││││││││││││││││││││││││││"; static const char bars[] = "││││││││││││││││││││││││││││││││││││││││";
(void) (_hb_debug (level, max_level) && fprintf (stderr, "%-10s", what ? what : "");
(fprintf (stderr, "%-10s", what ? what : ""), TRUE) &&
((obj && fprintf (stderr, "(%p) ", obj), TRUE) || fprintf (stderr, " %*s ", (unsigned int) (2 * sizeof (void *)), ""), TRUE) && if (obj)
(indented && fprintf (stderr, "%2d %s├%s", fprintf (stderr, "(%p) ", obj);
level, else
bars + sizeof (bars) - 1 - MIN ((unsigned int) sizeof (bars), 3 * level), fprintf (stderr, " %*s ", (unsigned int) (2 * sizeof (void *)), "");
level_dir ? (level_dir > 0 ? "" : "") : ""), TRUE) &&
(!indented && fprintf (stderr, " ├╴"), TRUE) && if (indented)
(func && fprintf (stderr, "%s: ", func), TRUE) && fprintf (stderr, "%2d %s├%s",
(vfprintf (stderr, message, ap), TRUE) && level,
fprintf (stderr, "\n")); bars + sizeof (bars) - 1 - MIN ((unsigned int) sizeof (bars), 3 * level),
level_dir ? (level_dir > 0 ? "" : "") : "");
else
fprintf (stderr, " ├╴");
if (func)
fprintf (stderr, "%s: ", func);
if (message)
vfprintf (stderr, message, ap);
fprintf (stderr, "\n");
return TRUE; return TRUE;
} }