[FR_TYPE_MAX] = 0 //!< Ensure array covers all types.
};
-uint64_t const fr_value_box_integer_max[] = {
+static uint64_t const fr_value_box_integer_max[] = {
[FR_TYPE_BOOL] = true,
[FR_TYPE_UINT8] = UINT8_MAX,
[FR_TYPE_UINT16] = UINT16_MAX,
[FR_TYPE_MAX] = 0 //!< Ensure array covers all types.
};
-int64_t const fr_value_box_integer_min[] = {
+static int64_t const fr_value_box_integer_min[] = {
[FR_TYPE_BOOL] = false,
[FR_TYPE_UINT8] = 0,
[FR_TYPE_UINT16] = 0,
fr_value_box_t const *src)
{
switch (src->type) {
- default:
- bad_cast:
- fr_strerror_printf("Invalid cast from %s to %s. Unsupported",
- fr_table_str_by_value(fr_value_box_type_table, src->type, "<INVALID>"),
- fr_table_str_by_value(fr_value_box_type_table, dst_type, "<INVALID>"));
- return -1;
-
case FR_TYPE_STRING:
return fr_value_box_from_str(ctx, dst, &dst_type, dst_enumv,
src->vb_strvalue, src->vb_length, '\0', src->tainted);
dst->vb_uint64 = fr_net_to_uint64(&src->vb_ifid[0]);
return 0;
}
+
+ default:
+ break;
}
- return 0;
+bad_cast:
+ fr_strerror_printf("Invalid cast from %s to %s. Unsupported",
+ fr_table_str_by_value(fr_value_box_type_table, src->type, "<INVALID>"),
+ fr_table_str_by_value(fr_value_box_type_table, dst_type, "<INVALID>"));
+ return -1;
}
/** Convert one type of fr_value_box_t to another
*
* @param[in] data to clear.
*/
-inline void fr_value_box_clear_value(fr_value_box_t *data)
+void fr_value_box_clear_value(fr_value_box_t *data)
{
switch (data->type) {
case FR_TYPE_OCTETS: