From: Arran Cudbard-Bell Date: Wed, 24 Nov 2021 20:02:05 +0000 (-0500) Subject: Revert "reorder types" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3391575a5534b29a091a2e3fc07f640c7a9975df;p=thirdparty%2Ffreeradius-server.git Revert "reorder types" There are so many uses of the old ordering it makes visually checking whether cases are covered annoying. The old ordering orders things by types which relate directly to C types, and then more abstract types, and system types, which is generally far more useful. The C types are usually the ones we deal with explicitly in martialling and unmartialling functions. It's very rare we end up needing to convert between time_delta and a native database type, but very common we need to deal with the numeric and float types. --- diff --git a/src/lib/util/types.h b/src/lib/util/types.h index bc03a3ad62a..ab9876d80ed 100644 --- a/src/lib/util/types.h +++ b/src/lib/util/types.h @@ -54,21 +54,22 @@ typedef enum { FR_TYPE_UINT32, //!< 32 Bit unsigned integer. FR_TYPE_UINT64, //!< 64 Bit unsigned integer. - FR_TYPE_SIZE, //!< Unsigned integer capable of representing any memory - //!< address on the local system. - - FR_TYPE_DATE, //!< Unix time stamp, always has value >2^31 FR_TYPE_INT8, //!< 8 Bit signed integer. FR_TYPE_INT16, //!< 16 Bit signed integer. FR_TYPE_INT32, //!< 32 Bit signed integer. FR_TYPE_INT64, //!< 64 Bit signed integer. - FR_TYPE_TIME_DELTA, //!< A period of time measured in nanoseconds. - FR_TYPE_FLOAT32, //!< Single precision floating point. FR_TYPE_FLOAT64, //!< Double precision floating point. + FR_TYPE_DATE, //!< Unix time stamp, always has value >2^31 + + FR_TYPE_TIME_DELTA, //!< A period of time measured in nanoseconds. + + FR_TYPE_SIZE, //!< Unsigned integer capable of representing any memory + //!< address on the local system. + FR_TYPE_TLV, //!< Contains nested attributes. FR_TYPE_STRUCT, //!< like TLV, but without T or L, and fixed-width children diff --git a/src/lib/util/value.c b/src/lib/util/value.c index a9ee79f6812..bcbcf543c61 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -119,20 +119,19 @@ fr_table_num_ordered_t const fr_value_box_type_table[] = { { L("uint32"), FR_TYPE_UINT32 }, { L("uint64"), FR_TYPE_UINT64 }, - { L("size"), FR_TYPE_SIZE }, - - { L("date"), FR_TYPE_DATE }, - { L("int8"), FR_TYPE_INT8 }, { L("int16"), FR_TYPE_INT16 }, { L("int32"), FR_TYPE_INT32 }, { L("int64"), FR_TYPE_INT64 }, - { L("time_delta"), FR_TYPE_TIME_DELTA }, - { L("float32"), FR_TYPE_FLOAT32 }, { L("float64"), FR_TYPE_FLOAT64 }, + { L("time_delta"), FR_TYPE_TIME_DELTA }, + { L("date"), FR_TYPE_DATE }, + + { L("size"), FR_TYPE_SIZE }, + { L("tlv"), FR_TYPE_TLV }, { L("struct"), FR_TYPE_STRUCT },