]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "reorder types"
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 Nov 2021 20:02:05 +0000 (15:02 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 24 Nov 2021 20:10:40 +0000 (15:10 -0500)
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.

src/lib/util/types.h
src/lib/util/value.c

index bc03a3ad62aefd0d65bb71ea9bf02256588dbcb4..ab9876d80edb5d84975ba4b4464cfdd63cca08d8 100644 (file)
@@ -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
 
index a9ee79f6812928ac9a09ccb51b7d259987cdcb37..bcbcf543c61cbd238b1c6d484db95e49ba5996c3 100644 (file)
@@ -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          },