From a3c8390d19593b1e5277d95bfb4ab206d4785150 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 12 Feb 2014 10:12:04 -0500 Subject: Make DEBUG macro invocations variadic Use a script to update DEBUG macro invocations to use it as a variadic macro, supplying format string and its arguments directly, instead of wrapping them in parens. This script was used to update the code: grep -rwl --include '*.[hc]' DEBUG . | while read f; do mv "$f"{,.orig} perl -e \ 'use strict; use File::Slurp; my $text=read_file(\*STDIN); $text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs; print $text;' < "$f.orig" > "$f" rm "$f.orig" done Reviewed-by: Jakub Hrozek Reviewed-by: Stephen Gallagher Reviewed-by: Simo Sorce --- src/providers/ipa/ipa_hosts.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/providers/ipa/ipa_hosts.c') diff --git a/src/providers/ipa/ipa_hosts.c b/src/providers/ipa/ipa_hosts.c index 1323cac60..64f80f082 100644 --- a/src/providers/ipa/ipa_hosts.c +++ b/src/providers/ipa/ipa_hosts.c @@ -122,7 +122,7 @@ ipa_host_info_send(TALLOC_CTX *mem_ctx, ret = ipa_host_info_next(req, state); if (ret == EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No host search base configured?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No host search base configured?\n"); ret = EINVAL; } @@ -169,7 +169,7 @@ static errno_t ipa_host_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting host info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting host info\n"); talloc_zfree(state->cur_filter); return EIO; } @@ -232,7 +232,7 @@ ipa_host_info_done(struct tevent_req *subreq) ret = ipa_hostgroup_info_next(req, state); if (ret == EOK) { - DEBUG(SSSDBG_CRIT_FAILURE, ("No host search base configured?\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "No host search base configured?\n"); tevent_req_error(req, EINVAL); return; } else if (ret != EAGAIN) { @@ -255,7 +255,7 @@ ipa_host_info_done(struct tevent_req *subreq) } if (!sdap_has_deref_support(state->sh, state->opts)) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Server does not support deref\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Server does not support deref\n"); tevent_req_error(req, EIO); return; } @@ -268,7 +268,7 @@ ipa_host_info_done(struct tevent_req *subreq) dp_opt_get_int(state->opts->basic, SDAP_ENUM_SEARCH_TIMEOUT)); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting host info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting host info\n"); tevent_req_error(req, EIO); return; } @@ -307,7 +307,7 @@ static errno_t ipa_hostgroup_info_next(struct tevent_req *req, SDAP_ENUM_SEARCH_TIMEOUT), true); if (subreq == NULL) { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error requesting hostgroup info\n")); + DEBUG(SSSDBG_CRIT_FAILURE, "Error requesting hostgroup info\n"); talloc_zfree(state->cur_filter); return EIO; } @@ -340,7 +340,7 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) talloc_zfree(subreq); if (ret != EOK) { DEBUG(SSSDBG_OP_FAILURE, - ("sdap_get_generic_recv failed: [%d]\n", ret)); + "sdap_get_generic_recv failed: [%d]\n", ret); tevent_req_error(req, ret); return; } @@ -385,7 +385,7 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) if (ret != EOK) goto done; if (state->hostgroup_count == 0) { - DEBUG(SSSDBG_FUNC_DATA, ("No host groups were dereferenced\n")); + DEBUG(SSSDBG_FUNC_DATA, "No host groups were dereferenced\n"); } else { state->hostgroups = talloc_zero_array(state, struct sysdb_attrs *, state->hostgroup_count); @@ -411,8 +411,8 @@ ipa_hostgroup_info_done(struct tevent_req *subreq) &hostgroup_name); if (ret != EOK) goto done; - DEBUG(SSSDBG_FUNC_DATA, ("Dereferenced host group: %s\n", - hostgroup_name)); + DEBUG(SSSDBG_FUNC_DATA, "Dereferenced host group: %s\n", + hostgroup_name); state->hostgroups[j] = talloc_steal(state->hostgroups, deref_result[i]->attrs); j++; @@ -425,7 +425,7 @@ done: if (ret == EOK) { tevent_req_done(req); } else { - DEBUG(SSSDBG_OP_FAILURE, ("Error [%d][%s]\n", ret, strerror(ret))); + DEBUG(SSSDBG_OP_FAILURE, "Error [%d][%s]\n", ret, strerror(ret)); tevent_req_error(req, ret); } } -- cgit