From: Christoph Mallon Date: Wed, 27 Jul 2011 16:04:14 +0000 (+0200) Subject: Simplify usage of LC_OPT_ENT_STR(): The length of the buffer is determined in the... X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7652c5cb777e2f6c76923ebae460b35ea76a94b5;p=libfirm Simplify usage of LC_OPT_ENT_STR(): The length of the buffer is determined in the macro, not passed as parameter. --- diff --git a/ir/be/bemain.c b/ir/be/bemain.c index f87534f67..b113fd4cf 100644 --- a/ir/be/bemain.c +++ b/ir/be/bemain.c @@ -134,10 +134,10 @@ static const lc_opt_table_entry_t be_main_options[] = { LC_OPT_ENT_BOOL ("profilegenerate", "instrument the code for execution count profiling", &be_options.opt_profile_generate), LC_OPT_ENT_BOOL ("profileuse", "use existing profile data", &be_options.opt_profile_use), LC_OPT_ENT_BOOL ("statev", "dump statistic events", &be_options.statev), - LC_OPT_ENT_STR ("filtev", "filter for stat events (regex if support is active", be_options.filtev, sizeof(be_options.filtev)), + LC_OPT_ENT_STR ("filtev", "filter for stat events (regex if support is active", be_options.filtev), - LC_OPT_ENT_STR ("ilp.server", "the ilp server name", be_options.ilp_server, sizeof(be_options.ilp_server)), - LC_OPT_ENT_STR ("ilp.solver", "the ilp solver name", be_options.ilp_solver, sizeof(be_options.ilp_solver)), + LC_OPT_ENT_STR("ilp.server", "the ilp server name", be_options.ilp_server), + LC_OPT_ENT_STR("ilp.solver", "the ilp solver name", be_options.ilp_solver), LC_OPT_LAST }; diff --git a/ir/libcore/lc_opts.h b/ir/libcore/lc_opts.h index 23074edfe..cf825eeae 100644 --- a/ir/libcore/lc_opts.h +++ b/ir/libcore/lc_opts.h @@ -123,8 +123,8 @@ typedef struct { #define LC_OPT_ENT_NEGBOOL(name, desc, addr) \ _LC_OPT_ENT(name, desc, lc_opt_type_negboolean, int, addr, 0, lc_opt_std_cb, lc_opt_std_dump, lc_opt_bool_dump_vals) -#define LC_OPT_ENT_STR(name, desc, buf, len) \ - _LC_OPT_ENT(name, desc, lc_opt_type_string, char, buf, len, lc_opt_std_cb, lc_opt_std_dump, NULL) +#define LC_OPT_ENT_STR(name, desc, buf) \ + _LC_OPT_ENT(name, desc, lc_opt_type_string, char, buf, sizeof(buf), lc_opt_std_cb, lc_opt_std_dump, NULL) #define LC_OPT_LAST \ _LC_OPT_ENT(NULL, NULL, lc_opt_type_invalid, void, NULL, 0, NULL, NULL, NULL)