* Return negative numbers to put 'one' at the top of the heap.
* Return positive numbers to put 'two' at the top of the heap.
*/
-static int pending_packet_cmp(void const *one, void const *two)
+static int8_t pending_packet_cmp(void const *one, void const *two)
{
fr_io_pending_packet_t const *a = one;
fr_io_pending_packet_t const *b = two;
* Order clients in the pending_clients heap, based on the
* packets that they contain.
*/
-static int pending_client_cmp(void const *one, void const *two)
+static int8_t pending_client_cmp(void const *one, void const *two)
{
fr_io_pending_packet_t const *a;
fr_io_pending_packet_t const *b;
}
-static int address_cmp(void const *one, void const *two)
+static int8_t address_cmp(void const *one, void const *two)
{
int rcode;
fr_io_address_t const *a = one;
* This function is only used for the "main" socket. Clients
* from connections do not use it.
*/
-static int alive_client_cmp(void const *one, void const *two)
+static int8_t alive_client_cmp(void const *one, void const *two)
{
fr_io_client_t const *a = one;
fr_io_client_t const *b = two;
static void fr_network_post_event(fr_event_list_t *el, fr_time_t now, void *uctx);
static int fr_network_pre_event(void *ctx, fr_time_t wake);
-static int reply_cmp(void const *one, void const *two)
+static int8_t reply_cmp(void const *one, void const *two)
{
fr_channel_data_t const *a = one, *b = two;
int ret;
return (a->m.when > b->m.when) - (a->m.when < b->m.when);
}
-static int waiting_cmp(void const *one, void const *two)
+static int8_t waiting_cmp(void const *one, void const *two)
{
fr_channel_data_t const *a = one, *b = two;
int ret;
/**
* Track a channel in the "to_decode" or "localized" heap.
*/
-static int worker_message_cmp(void const *one, void const *two)
+static int8_t worker_message_cmp(void const *one, void const *two)
{
fr_channel_data_t const *a = one, *b = two;
int ret;
/**
* Track a REQUEST in the "runnable" heap.
*/
-static int worker_runnable_cmp(void const *one, void const *two)
+static int8_t worker_runnable_cmp(void const *one, void const *two)
{
REQUEST const *a = one, *b = two;
int ret;
/**
* Track a REQUEST in the "time_order" heap.
*/
-static int worker_time_order_cmp(void const *one, void const *two)
+static int8_t worker_time_order_cmp(void const *one, void const *two)
{
REQUEST const *a = one, *b = two;
/** Order connections by reserved most recently
*/
-static int last_reserved_cmp(void const *one, void const *two)
+static int8_t last_reserved_cmp(void const *one, void const *two)
{
fr_pool_connection_t const *a = one, *b = two;
/** Order connections by released longest ago
*/
-static int last_released_cmp(void const *one, void const *two)
+static int8_t last_released_cmp(void const *one, void const *two)
{
fr_pool_connection_t const *a = one, *b = two;
* - -1 if a should occur earlier than b.
* - 0 if both events occur at the same time.
*/
-static int fr_event_timer_cmp(void const *a, void const *b)
+static int8_t fr_event_timer_cmp(void const *a, void const *b)
{
fr_event_timer_t const *ev_a = a, *ev_b = b;
* Return negative numbers to put 'a' at the top of the heap.
* Return positive numbers to put 'b' at the top of the heap.
*/
-typedef int (*fr_heap_cmp_t)(void const *a, void const *b);
+typedef int8_t (*fr_heap_cmp_t)(void const *a, void const *b);
typedef struct fr_heap_t fr_heap_t;
* - 0 if a == b
* - -1 if a < b
*/
-static inline int fr_time_cmp(fr_time_t a, fr_time_t b)
+static inline int8_t fr_time_cmp(fr_time_t a, fr_time_t b)
{
return (a > b) - (a < b);
}
*
* There may be multiple entries with the same expiry time.
*/
-static int cache_heap_cmp(void const *one, void const *two)
+static int8_t cache_heap_cmp(void const *one, void const *two)
{
rlm_cache_entry_t const *a = one, *b = two;
static void state_transition(fr_io_request_t *u, fr_io_request_state_t state, fr_io_connection_t *c);
static void conn_zombie_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_t now, void *uctx);
-static int conn_cmp(void const *one, void const *two)
+static int8_t conn_cmp(void const *one, void const *two)
{
fr_io_connection_t const *a = talloc_get_type_abort_const(one, fr_io_connection_t);
fr_io_connection_t const *b = talloc_get_type_abort_const(two, fr_io_connection_t);
* Status-Server packets are always sorted before other packets, by
* virtue of request->async->recv_time always being zero.
*/
-static int queue_cmp(void const *one, void const *two)
+static int8_t queue_cmp(void const *one, void const *two)
{
fr_io_request_t const *a = one;
fr_io_request_t const *b = two;