Skip to content

Commit

Permalink
bind: fix warning for variable used only in DEBUG() calls
Browse files Browse the repository at this point in the history
Fixes: #4305

Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
  • Loading branch information
eero-t authored and mrunge committed May 7, 2024
1 parent ff8cd79 commit 4d29f1d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/bind.c
Expand Up @@ -470,7 +470,9 @@ static int bind_parse_generic_name_value(const char *xpath_expression, /* {{{ */
return -1;
}

#if COLLECT_DEBUG
int num_entries = 0;
#endif
/* Iterate over all matching nodes. */
for (int i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr);
i++) {
Expand Down Expand Up @@ -510,8 +512,10 @@ static int bind_parse_generic_name_value(const char *xpath_expression, /* {{{ */
}

status = (*list_callback)(name, value, current_time, user_data);
#if COLLECT_DEBUG
if (status == 0)
num_entries++;
#endif

xmlFree(name);
}
Expand Down Expand Up @@ -549,7 +553,9 @@ static int bind_parse_generic_value_list(const char *xpath_expression, /* {{{ */
return -1;
}

#if COLLECT_DEBUG
int num_entries = 0;
#endif
/* Iterate over all matching nodes. */
for (int i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr);
i++) {
Expand All @@ -572,8 +578,10 @@ static int bind_parse_generic_value_list(const char *xpath_expression, /* {{{ */
continue;

status = (*list_callback)(node_name, value, current_time, user_data);
#if COLLECT_DEBUG
if (status == 0)
num_entries++;
#endif
}
}

Expand Down Expand Up @@ -609,7 +617,9 @@ static int bind_parse_generic_name_attr_value_list(
return -1;
}

#if COLLECT_DEBUG
int num_entries = 0;
#endif
/* Iterate over all matching nodes. */
for (int i = 0; xpathObj->nodesetval && (i < xpathObj->nodesetval->nodeNr);
i++) {
Expand Down Expand Up @@ -641,8 +651,10 @@ static int bind_parse_generic_name_attr_value_list(
}

status = (*list_callback)(attr_name, value, current_time, user_data);
#if COLLECT_DEBUG
if (status == 0)
num_entries++;
#endif

xmlFree(attr_name);
}
Expand Down

0 comments on commit 4d29f1d

Please sign in to comment.