};
-static int calc_date(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b)
+static int calc_date(UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b)
{
fr_value_box_t one, two;
bool overflow;
* Cast dates to time delta, do the conversions.
*/
if (a->type != FR_TYPE_TIME_DELTA) {
- if (fr_value_box_cast(ctx, &one, FR_TYPE_TIME_DELTA, NULL, a) < 0) return -1;
+ if (fr_value_box_cast(NULL, &one, FR_TYPE_TIME_DELTA, NULL, a) < 0) return -1;
a = &one;
}
if (b->type != FR_TYPE_TIME_DELTA) {
- if (fr_value_box_cast(ctx, &two, FR_TYPE_TIME_DELTA, NULL, b) < 0) return -1;
+ if (fr_value_box_cast(NULL, &two, FR_TYPE_TIME_DELTA, NULL, b) < 0) return -1;
b = &two;
}
return 0;
}
-static int calc_time_delta(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b)
+static int calc_time_delta(UNUSED TALLOC_CTX *ctx, fr_value_box_t *dst, fr_value_box_t const *a, fr_token_t op, fr_value_box_t const *b)
{
fr_value_box_t one, two;
* TIME_DELTA.
*/
if (a->type == FR_TYPE_DATE) {
- if (fr_value_box_cast(ctx, &one, FR_TYPE_TIME_DELTA, NULL, a) < 0) return -1;
+ if (fr_value_box_cast(NULL, &one, FR_TYPE_TIME_DELTA, NULL, a) < 0) return -1;
a = &one;
}
if (b->type == FR_TYPE_DATE) {
- if (fr_value_box_cast(ctx, &two, FR_TYPE_TIME_DELTA, NULL, b) < 0) return -1;
+ if (fr_value_box_cast(NULL, &two, FR_TYPE_TIME_DELTA, NULL, b) < 0) return -1;
b = &two;
}
* We cast the inputs based on the destination time resolution. So "5ms + 5" = "10ms".
*/
if (a->type != FR_TYPE_TIME_DELTA) {
- if (fr_value_box_cast(ctx, &one, FR_TYPE_TIME_DELTA, dst->enumv, a) < 0) return -1;
+ if (fr_value_box_cast(NULL, &one, FR_TYPE_TIME_DELTA, dst->enumv, a) < 0) return -1;
a = &one;
}
if (b->type != FR_TYPE_TIME_DELTA) {
- if (fr_value_box_cast(ctx, &two, FR_TYPE_TIME_DELTA, dst->enumv, b) < 0) return -1;
+ if (fr_value_box_cast(NULL, &two, FR_TYPE_TIME_DELTA, dst->enumv, b) < 0) return -1;
b = &two;
}
* Intermediate calculations are done using increased precision.
*/
if (a->type != FR_TYPE_FLOAT64) {
- if (fr_value_box_cast(ctx, &one, FR_TYPE_FLOAT64, NULL, a) < 0) return -1;
+ if (fr_value_box_cast(NULL, &one, FR_TYPE_FLOAT64, NULL, a) < 0) return -1;
a = &one;
}
if (b->type != FR_TYPE_FLOAT64) {
- if (fr_value_box_cast(ctx, &two, FR_TYPE_FLOAT64, NULL, b) < 0) return -1;
+ if (fr_value_box_cast(NULL, &two, FR_TYPE_FLOAT64, NULL, b) < 0) return -1;
b = &two;
}
fr_assert(dst->type == FR_TYPE_FLOAT64);
if (a->type != FR_TYPE_FLOAT64) {
- if (fr_value_box_cast(ctx, &one, FR_TYPE_FLOAT64, NULL, a) < 0) return -1;
+ if (fr_value_box_cast(NULL, &one, FR_TYPE_FLOAT64, NULL, a) < 0) return -1;
a = &one;
}
if (b->type != FR_TYPE_FLOAT64) {
- if (fr_value_box_cast(ctx, &two, FR_TYPE_FLOAT64, NULL, b) < 0) return -1;
+ if (fr_value_box_cast(NULL, &two, FR_TYPE_FLOAT64, NULL, b) < 0) return -1;
b = &two;
}
}
if (a->type != type) {
- if (fr_value_box_cast(ctx, &one, type, NULL, a) < 0) return -1;
+ if (fr_value_box_cast(NULL, &one, type, NULL, a) < 0) return -1;
a = &one;
}
if (b->type != type) {
- if (fr_value_box_cast(ctx, &two, type, NULL, b) < 0) return -1;
+ if (fr_value_box_cast(NULL, &two, type, NULL, b) < 0) return -1;
b = &two;
}
}
fr_value_box_init(&out, type, dst->enumv, false);
- rcode = calc(ctx, &out, a, op, b);
+ rcode = calc(NULL, &out, a, op, b);
if (rcode < 0) return rcode;
/*
* Then once we're done, cast the result to the final
* output type.
*/
- return fr_value_box_cast(ctx, dst, dst->type, dst->enumv, &out);
+ return fr_value_box_cast(NULL, dst, dst->type, dst->enumv, &out);
}
static const fr_binary_op_t calc_type[FR_TYPE_MAX + 1] = {