diff --git a/CHANGELOG.md b/CHANGELOG.md index bd0026b1..1be1d8dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,8 @@ Developers may need to change their code ### Minor features +* Removed `YANG_ORDERING_WHEN_LAST` compile-time option (obsolete since 5.4) + * See https://github.com/clicon/clixon/issues/287 * Removed `JSON_CDATA_STRIP` compile-time option (obsolete since 5.4) * Added fuzz code for xpath * List-pagination: Follow ietf-draft 100%: Removed list-pagination "presence" diff --git a/include/clixon_custom.h b/include/clixon_custom.h index 6079f68c..c04d2432 100644 --- a/include/clixon_custom.h +++ b/include/clixon_custom.h @@ -127,17 +127,6 @@ */ #undef LIST_PAGINATION_REMAINING -/*! - * RFC 7950 generally does not specify an XML/JSON encoding order of sub-elements of list or - * containers. See sections 7.5.7 and 7.8.5 - * There are some exceptions, eg rpc/action input/output or list key elements - * Clixon by default encodes them in yang order. - * Set this option if you want sub-elements with WHEN sub-statements last - * See https://github.com/clicon/clixon/issues/287 - * Consider enabling this option permanently after 5.4 - */ -#define YANG_ORDERING_WHEN_LAST - /*! Use Ancestor config cache * The cache uses two yang stmt flag bits. One to say it is active, the second its value */ diff --git a/lib/src/clixon_yang.c b/lib/src/clixon_yang.c index d22988f3..0f527589 100644 --- a/lib/src/clixon_yang.c +++ b/lib/src/clixon_yang.c @@ -3673,7 +3673,6 @@ yang_extension_value(yang_stmt *ys, return retval; } -#ifdef YANG_ORDERING_WHEN_LAST /* Sort substatements with when:s last */ static int yang_sort_subelements_fn(const void* arg1, @@ -3694,7 +3693,6 @@ yang_sort_subelements_fn(const void* arg1, return -1; else return ys1->_ys_vector_i - ys2->_ys_vector_i; } -#endif /*! Experimental code for sorting YANG children * @@ -3707,19 +3705,15 @@ yang_sort_subelements_fn(const void* arg1, int yang_sort_subelements(yang_stmt *ys) { - int retval = -1; + int retval = -1; + yang_stmt *yc = NULL; -#ifdef YANG_ORDERING_WHEN_LAST if ((yang_keyword_get(ys) == Y_CONTAINER || yang_keyword_get(ys) == Y_LIST)){ - yang_stmt *yc = NULL; - /* This enumerates _ys_vector_i in ys->ys_stmt vector */ while ((yc = yn_each(ys, yc)) != NULL) ; qsort(ys->ys_stmt, ys->ys_len, sizeof(ys), yang_sort_subelements_fn); } -#endif - retval = 0; // done: return retval;