1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

CSS: Don't call list_empty within args of DBG.

This commit is contained in:
Kalle Olavi Niemitalo 2007-07-15 15:52:44 +03:00 committed by Witold Filipczyk
parent 83d870a6d9
commit abd900eeff
2 changed files with 16 additions and 3 deletions

View File

@ -123,9 +123,16 @@ examine_element(struct html_context *html_context, struct css_selector *base,
unsigned char *code; unsigned char *code;
#ifdef DEBUG_CSS #ifdef DEBUG_CSS
/* Cannot use list_empty() inside the arglist of DBG() because
* GCC 4.1 "warning: operation on `errfile' may be undefined"
* breaks the build with -Werror. */
int dbg_has_leaves, dbg_has_properties;
DBG("examine_element(%p, %s, %d, %d, %p, %.*s);", html_context, base->name, seltype, rel, selectors, element->namelen, element->name); DBG("examine_element(%p, %s, %d, %d, %p, %.*s);", html_context, base->name, seltype, rel, selectors, element->namelen, element->name);
#define dbginfo(sel, type_, base) \ #define dbginfo(sel, type_, base) \
DBG("Matched selector %s (rel %d type %d [m%d])! Children %p !!%d, props !!%d", sel->name, sel->relation, sel->type, sel->type == type_, &sel->leaves, !list_empty(sel->leaves), !list_empty(sel->properties)) dbg_has_leaves = !list_empty(sel->leaves), \
dbg_has_properties = !list_empty(sel->properties), \
DBG("Matched selector %s (rel %d type %d [m%d])! Children %p !!%d, props !!%d", sel->name, sel->relation, sel->type, sel->type == type_, &sel->leaves, dbg_has_leaves, dbg_has_properties)
#else #else
#define dbginfo(sel, type, base) #define dbginfo(sel, type, base)
#endif #endif

View File

@ -479,11 +479,17 @@ css_parse_ruleset(struct css_stylesheet *css, struct scanner *scanner)
/* Mirror the properties to all the selectors. */ /* Mirror the properties to all the selectors. */
foreach (pkg, selectors) { foreach (pkg, selectors) {
#ifdef DEBUG_CSS #ifdef DEBUG_CSS
/* Cannot use list_empty() inside the arglist of DBG()
* because GCC 4.1 "warning: operation on `errfile'
* may be undefined" breaks the build with -Werror. */
int dbg_has_properties = !list_empty(properties);
int dbg_has_leaves = !list_empty(pkg->selector->leaves);
DBG("Binding properties (!!%d) to selector %s (type %d, relation %d, children %d)", DBG("Binding properties (!!%d) to selector %s (type %d, relation %d, children %d)",
!list_empty(properties), dbg_has_properties,
pkg->selector->name, pkg->selector->type, pkg->selector->name, pkg->selector->type,
pkg->selector->relation, pkg->selector->relation,
!list_empty(pkg->selector->leaves)); dbg_has_leaves);
#endif #endif
add_selector_properties(pkg->selector, &properties); add_selector_properties(pkg->selector, &properties);
} }