Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind: fix warning for variable used only in DEBUG() calls #4306

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/bind.c
Original file line number Diff line number Diff line change
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