diff --git a/ini/ini_configobj.c b/ini/ini_configobj.c index c53e868..be92aea 100644 --- a/ini/ini_configobj.c +++ b/ini/ini_configobj.c @@ -1063,7 +1063,7 @@ int ini_read_rules_from_file(const char *filename, goto done; } - ret = ini_config_parse(cfgfile, 0 , INI_MV1S_ALLOW, 0, *_rules_obj); + ret = ini_config_parse(cfgfile, 0, INI_MV1S_ALLOW, 0, *_rules_obj); if (ret != EOK) { goto done; } @@ -1111,7 +1111,7 @@ static int is_allowed_section(const char *tested_section, } } } else { /* case insensitive */ - for (int i = 0; i < num_sec; i++) { + for (int i = 0; i < num_sec; i++) { if (strcmp(tested_section, allowed_sections[i]) == 0) { return 1; } @@ -1185,9 +1185,9 @@ static int ini_allowed_sections(const char *rule_name, ret = ini_get_config_valueobj(rule_name, "case_insensitive", - rules_obj, - INI_GET_NEXT_VALUE, - &vo); + rules_obj, + INI_GET_NEXT_VALUE, + &vo); if (ret) { goto done; } @@ -1225,11 +1225,11 @@ static int ini_allowed_sections(const char *rule_name, /* Get all allowed section names and store them to * allowed_sections array */ for (size_t i = 0; i < num_sec; i++) { - ret = ini_get_config_valueobj(rule_name, - "section", - rules_obj, - INI_GET_NEXT_VALUE, - &vo); + ret = ini_get_config_valueobj(rule_name, + "section", + rules_obj, + INI_GET_NEXT_VALUE, + &vo); if (ret) { goto done; } @@ -1243,11 +1243,11 @@ static int ini_allowed_sections(const char *rule_name, /* Get all regular section_re regular expresions and * store them to allowed_sections_re array */ for (int i = 0; i < num_sec_re; i++) { - ret = ini_get_config_valueobj(rule_name, - "section_re", - rules_obj, - INI_GET_NEXT_VALUE, - &vo); + ret = ini_get_config_valueobj(rule_name, + "section_re", + rules_obj, + INI_GET_NEXT_VALUE, + &vo); if (ret) { goto done; } @@ -1407,7 +1407,7 @@ static int ini_allowed_options(const char *rule_name, /* Get all sections from config_obj */ sections = ini_get_section_list(config_obj, &num_sections, &ret); if (ret != EOK) { - goto done;; + goto done; } /* Get number of 'option' attributes in this rule @@ -1491,8 +1491,6 @@ done: return ret; } - - static ini_validator_func * get_validator(char *validator_name, struct ini_validator *validators, @@ -1747,4 +1745,3 @@ size_t ini_errobj_count(struct ini_errobj *errobj) { return errobj->count; } - diff --git a/ini/ini_configobj.h b/ini/ini_configobj.h index 0b82d44..d03511b 100644 --- a/ini/ini_configobj.h +++ b/ini/ini_configobj.h @@ -2218,7 +2218,6 @@ int ini_rules_check(struct ini_cfgobj *rules_obj, */ void ini_rules_destroy(struct ini_cfgobj *ini_config); - /** * @} */ diff --git a/ini/ini_validators_ut_check.c b/ini/ini_validators_ut_check.c index d337d36..6db011f 100644 --- a/ini/ini_validators_ut_check.c +++ b/ini/ini_validators_ut_check.c @@ -143,7 +143,6 @@ START_TEST(test_ini_errobj) } END_TEST - START_TEST(test_ini_noerror) { struct ini_cfgobj *rules_obj; @@ -250,17 +249,17 @@ START_TEST(test_unknown_validator) END_TEST static int custom_noerror(const char *rule_name, - struct ini_cfgobj *rules_obj, - struct ini_cfgobj *config_obj, - struct ini_errobj *errobj) + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj) { return 0; } static int custom_error(const char *rule_name, - struct ini_cfgobj *rules_obj, - struct ini_cfgobj *config_obj, - struct ini_errobj *errobj) + struct ini_cfgobj *rules_obj, + struct ini_cfgobj *config_obj, + struct ini_errobj *errobj) { return ini_errobj_add_msg(errobj, "Error"); } @@ -271,7 +270,7 @@ START_TEST(test_custom_noerror) struct ini_cfgobj *cfg_obj; struct ini_errobj *errobj; int ret; - struct ini_validator noerror = {"custom_noerror", custom_noerror}; + struct ini_validator noerror = { "custom_noerror", custom_noerror }; char input_rules[] = "[rule/custom_succeed]\n" @@ -306,7 +305,7 @@ START_TEST(test_custom_error) struct ini_cfgobj *cfg_obj; struct ini_errobj *errobj; int ret; - struct ini_validator error = {"custom_error", custom_error}; + struct ini_validator error = { "custom_error", custom_error }; const char *errmsg; char input_rules[] = @@ -551,7 +550,6 @@ START_TEST(test_ini_allowed_sections_str_typos) num_err = ini_errobj_count(errobj); fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); - ini_errobj_destroy(&errobj); ini_config_destroy(cfg_obj); ini_rules_destroy(rules_obj); @@ -674,7 +672,6 @@ START_TEST(test_ini_allowed_sections_re_typos) num_err = ini_errobj_count(errobj); fail_unless(num_err == 2, "Expected 2 errors, got %d", num_err); - ini_errobj_destroy(&errobj); ini_config_destroy(cfg_obj); ini_rules_destroy(rules_obj); @@ -722,7 +719,6 @@ START_TEST(test_ini_allowed_sections_re_insensitive) } END_TEST - static Suite *ini_validators_utils_suite(void) { Suite *s = suite_create("ini_validators"); @@ -748,7 +744,6 @@ static Suite *ini_validators_utils_suite(void) tcase_add_test(tc_allowed_options, test_ini_allowed_sections_re_typos); tcase_add_test(tc_allowed_options, test_ini_allowed_sections_re_insensitive); - suite_add_tcase(s, tc_infrastructure); suite_add_tcase(s, tc_allowed_options); suite_add_tcase(s, tc_allowed_sections);