diff options
author | Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> | 2014-02-12 10:12:04 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 22:30:55 +0100 |
commit | a3c8390d19593b1e5277d95bfb4ab206d4785150 (patch) | |
tree | 2eb4e5432f4f79a75589c03b1513b656879ebf9c /src/providers/data_provider_opts.c | |
parent | cc026fd9ba386f2197e3217940d597dcad1a26fe (diff) | |
download | sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.gz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.tar.xz sssd-a3c8390d19593b1e5277d95bfb4ab206d4785150.zip |
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 <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/providers/data_provider_opts.c')
-rw-r--r-- | src/providers/data_provider_opts.c | 104 |
1 files changed, 52 insertions, 52 deletions
diff --git a/src/providers/data_provider_opts.c b/src/providers/data_provider_opts.c index 0edadecc1..cab01f9fa 100644 --- a/src/providers/data_provider_opts.c +++ b/src/providers/data_provider_opts.c @@ -53,15 +53,15 @@ int dp_get_options(TALLOC_CTX *memctx, ((opts[i].def_val.string != NULL) && (opts[i].val.string == NULL))) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); if (ret == EOK) ret = EINVAL; goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", opts[i].opt_name, opts[i].val.cstring ? "" : " no", - opts[i].val.cstring ? opts[i].val.cstring : "")); + opts[i].val.cstring ? opts[i].val.cstring : ""); break; case DP_OPT_BLOB: @@ -70,8 +70,8 @@ int dp_get_options(TALLOC_CTX *memctx, NULL, &tmp); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } @@ -83,8 +83,8 @@ int dp_get_options(TALLOC_CTX *memctx, opts[i].val.blob.length = 0; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has %s binary value.\n", - opts[i].opt_name, opts[i].val.blob.length?"a":"no")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has %s binary value.\n", + opts[i].opt_name, opts[i].val.blob.length?"a":"no"); break; case DP_OPT_NUMBER: @@ -94,12 +94,12 @@ int dp_get_options(TALLOC_CTX *memctx, &opts[i].val.number); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has value %d\n", - opts[i].opt_name, opts[i].val.number)); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has value %d\n", + opts[i].opt_name, opts[i].val.number); break; case DP_OPT_BOOL: @@ -109,12 +109,12 @@ int dp_get_options(TALLOC_CTX *memctx, &opts[i].val.boolean); if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s is %s\n", - opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s is %s\n", + opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE"); break; } } @@ -155,14 +155,14 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to copy value for option (%s)\n", - opts[i].opt_name)); + "Failed to copy value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has%s value %s\n", + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has%s value %s\n", opts[i].opt_name, opts[i].val.cstring ? "" : " no", - opts[i].val.cstring ? opts[i].val.cstring : "")); + opts[i].val.cstring ? opts[i].val.cstring : ""); break; case DP_OPT_BLOB: @@ -173,12 +173,12 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has %s binary value.\n", - opts[i].opt_name, opts[i].val.blob.length?"a":"no")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has %s binary value.\n", + opts[i].opt_name, opts[i].val.blob.length?"a":"no"); break; case DP_OPT_NUMBER: @@ -189,12 +189,12 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s has value %d\n", - opts[i].opt_name, opts[i].val.number)); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s has value %d\n", + opts[i].opt_name, opts[i].val.number); break; case DP_OPT_BOOL: @@ -205,12 +205,12 @@ int dp_copy_options(TALLOC_CTX *memctx, } if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, - ("Failed to retrieve value for option (%s)\n", - opts[i].opt_name)); + "Failed to retrieve value for option (%s)\n", + opts[i].opt_name); goto done; } - DEBUG(SSSDBG_TRACE_FUNC, ("Option %s is %s\n", - opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE")); + DEBUG(SSSDBG_TRACE_FUNC, "Option %s is %s\n", + opts[i].opt_name, opts[i].val.boolean?"TRUE":"FALSE"); break; } } @@ -242,10 +242,10 @@ const char *_dp_opt_get_cstring(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_STRING) { - DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + DEBUG(0, "[%s] Requested type 'String' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return NULL; } return opts[id].val.cstring; @@ -255,10 +255,10 @@ char *_dp_opt_get_string(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_STRING) { - DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + DEBUG(0, "[%s] Requested type 'String' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return NULL; } return opts[id].val.string; @@ -269,10 +269,10 @@ struct dp_opt_blob _dp_opt_get_blob(struct dp_option *opts, { struct dp_opt_blob null_blob = { NULL, 0 }; if (opts[id].type != DP_OPT_BLOB) { - DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'" + DEBUG(0, "[%s] Requested type 'Blob' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return null_blob; } return opts[id].val.blob; @@ -282,10 +282,10 @@ int _dp_opt_get_int(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_NUMBER) { - DEBUG(0, ("[%s] Requested type 'Number' for option '%s'" + DEBUG(0, "[%s] Requested type 'Number' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return 0; } return opts[id].val.number; @@ -295,10 +295,10 @@ bool _dp_opt_get_bool(struct dp_option *opts, int id, const char *location) { if (opts[id].type != DP_OPT_BOOL) { - DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'" + DEBUG(0, "[%s] Requested type 'Boolean' for option '%s'" " but value is of type '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return false; } return opts[id].val.boolean; @@ -309,10 +309,10 @@ int _dp_opt_set_string(struct dp_option *opts, int id, const char *s, const char *location) { if (opts[id].type != DP_OPT_STRING) { - DEBUG(0, ("[%s] Requested type 'String' for option '%s'" + DEBUG(0, "[%s] Requested type 'String' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; } @@ -322,7 +322,7 @@ int _dp_opt_set_string(struct dp_option *opts, int id, if (s) { opts[id].val.string = talloc_strdup(opts, s); if (!opts[id].val.string) { - DEBUG(0, ("talloc_strdup() failed!\n")); + DEBUG(0, "talloc_strdup() failed!\n"); return ENOMEM; } } @@ -334,10 +334,10 @@ int _dp_opt_set_blob(struct dp_option *opts, int id, struct dp_opt_blob b, const char *location) { if (opts[id].type != DP_OPT_BLOB) { - DEBUG(0, ("[%s] Requested type 'Blob' for option '%s'" + DEBUG(0, "[%s] Requested type 'Blob' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; } @@ -348,7 +348,7 @@ int _dp_opt_set_blob(struct dp_option *opts, int id, if (b.data) { opts[id].val.blob.data = talloc_memdup(opts, b.data, b.length); if (!opts[id].val.blob.data) { - DEBUG(0, ("talloc_memdup() failed!\n")); + DEBUG(0, "talloc_memdup() failed!\n"); return ENOMEM; } } @@ -361,10 +361,10 @@ int _dp_opt_set_int(struct dp_option *opts, int id, int i, const char *location) { if (opts[id].type != DP_OPT_NUMBER) { - DEBUG(0, ("[%s] Requested type 'Number' for option '%s'" + DEBUG(0, "[%s] Requested type 'Number' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; } @@ -377,10 +377,10 @@ int _dp_opt_set_bool(struct dp_option *opts, int id, bool b, const char *location) { if (opts[id].type != DP_OPT_BOOL) { - DEBUG(0, ("[%s] Requested type 'Boolean' for option '%s'" + DEBUG(0, "[%s] Requested type 'Boolean' for option '%s'" " but type is '%s'!\n", location, opts[id].opt_name, - dp_opt_type_to_string(opts[id].type))); + dp_opt_type_to_string(opts[id].type)); return EINVAL; } |