OPT: Replace AssertFatal with static_assert

See parent commit
This commit is contained in:
Robert Schmidt
2024-12-19 03:26:27 +01:00
parent 2f43b343b6
commit d820c187fc

View File

@@ -529,8 +529,9 @@ void trace_pdu_implementation(ws_trace_t *t)
int init_opt(void) {
paramdef_t opt_params[] = OPT_PARAMS_DESC ;
checkedparam_t opt_checkParams[] = OPTPARAMS_CHECK_DESC;
static_assert(sizeofArray(opt_params) == sizeofArray(opt_checkParams),
"opt_params and opt_checkParams should have the same size");
int sz=sizeofArray(opt_params);
AssertFatal(sz == sizeofArray(opt_checkParams), "Error in arrays size (%d!=%lu)\n", sz, sizeofArray(opt_checkParams));
config_set_checkfunctions(opt_params, opt_checkParams, sz);
config_get(config_get_if(), opt_params, sz, OPT_CONFIGPREFIX);
subframesSinceCaptureStart = 0;