Skip to content

Commit a13f7b2

Browse files
committed
tweak nonnull settings
if dict is NULL, it just defaults to internal
1 parent 27039a0 commit a13f7b2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/lib/util/dict.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,9 @@ fr_dict_t *fr_dict_protocol_alloc(fr_dict_t const *parent) CC_HINT(nonnull);
898898

899899
int fr_dict_protocol_reference(fr_dict_attr_t const **da_p, fr_dict_attr_t const *root, fr_sbuff_t *in) CC_HINT(nonnull);
900900

901-
int fr_dict_read(fr_dict_t *dict, char const *dict_dir, char const *filename) CC_HINT(nonnull);
901+
int fr_dict_read(fr_dict_t *dict, char const *dict_dir, char const *filename) CC_HINT(nonnull(3));
902902

903-
bool fr_dict_filename_loaded(fr_dict_t const *dict, char const *dict_dir, char const *filename) CC_HINT(nonnull);
903+
bool fr_dict_filename_loaded(fr_dict_t const *dict, char const *dict_dir, char const *filename) CC_HINT(nonnull(2,3));
904904
/** @} */
905905

906906
/** @name Autoloader interface
@@ -983,7 +983,7 @@ fr_dict_t const *fr_dict_internal(void);
983983
void dict_dctx_debug(dict_tokenize_ctx_t *dctx) CC_HINT(nonnull);
984984

985985
int fr_dict_parse_str(fr_dict_t *dict, char const *str,
986-
fr_dict_attr_t const *parent) CC_HINT(nonnull);
986+
fr_dict_attr_t const *parent) CC_HINT(nonnull(2,3));
987987

988988
ssize_t fr_dict_valid_name(char const *name, ssize_t len) CC_HINT(nonnull);
989989

src/lib/util/dict_tokenize.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,15 +3859,15 @@ int fr_dict_parse_str(fr_dict_t *dict, char const *input, fr_dict_attr_t const *
38593859
ret = dict_read_process_value(&dctx, argv + 1, argc - 1, &base_flags);
38603860

38613861
} else if (strcasecmp(argv[0], "ATTRIBUTE") == 0) {
3862-
if (parent && (parent != dict->root)) {
3862+
if (parent != dict->root) {
38633863
(void) dict_dctx_push(&dctx, parent, NEST_NONE);
38643864
}
38653865

38663866
ret = dict_read_process_attribute(&dctx,
38673867
argv + 1, argc - 1, &base_flags);
38683868

38693869
} else if (strcasecmp(argv[0], "DEFINE") == 0) {
3870-
if (parent && (parent != dict->root)) {
3870+
if (parent != dict->root) {
38713871
(void) dict_dctx_push(&dctx, parent, NEST_NONE);
38723872
}
38733873

0 commit comments

Comments
 (0)