Skip to content

Commit

Permalink
more const fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Sep 7, 2017
1 parent 47eb429 commit cf2419a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/util/dict.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4316,20 +4316,16 @@ void fr_dict_verify(char const *file, int line, fr_dict_attr_t const *da)
{ {
int i; int i;
fr_dict_attr_t const *da_p; fr_dict_attr_t const *da_p;
#ifndef NDEBUG
fr_dict_attr_t *tmp; fr_dict_attr_t *tmp;
#endif


if (!da) { if (!da) {
FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t pointer was NULL", file, line); FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t pointer was NULL", file, line);


if (!fr_cond_assert(0)) fr_exit_now(1); if (!fr_cond_assert(0)) fr_exit_now(1);
} }


#ifndef NDEBUG
memcpy(&tmp, &da, sizeof(da)); memcpy(&tmp, &da, sizeof(da));
(void) talloc_get_type_abort(tmp, fr_dict_attr_t); (void) talloc_get_type_abort(tmp, fr_dict_attr_t);
#endif


if ((!da->flags.is_root) && (da->depth == 0)) { if ((!da->flags.is_root) && (da->depth == 0)) {
FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: " FR_FAULT_LOG("CONSISTENCY CHECK FAILED %s[%u]: fr_dict_attr_t %s vendor: %i, attr %i: "
Expand All @@ -4347,7 +4343,11 @@ void fr_dict_verify(char const *file, int line, fr_dict_attr_t const *da)
if (!fr_cond_assert(0)) fr_exit_now(1); if (!fr_cond_assert(0)) fr_exit_now(1);
} }


for (da_p = da; da_p; da_p = da_p->next) (void) talloc_get_type_abort(da_p, fr_dict_attr_t); for (da_p = da; da_p; da_p = da_p->next) {
memcpy(&tmp, &da_p, sizeof(da_p));

(void) talloc_get_type_abort(tmp, fr_dict_attr_t);
}


for (i = da->depth, da_p = da; (i >= 0) && da; i--, da_p = da_p->parent) { for (i = da->depth, da_p = da; (i >= 0) && da; i--, da_p = da_p->parent) {
if (i != (int)da_p->depth) { if (i != (int)da_p->depth) {
Expand Down

0 comments on commit cf2419a

Please sign in to comment.