lib/libdmsg/msg_lnk.c
static
int
h2span_relay_cmp(h2span_relay_t *relay1, h2span_relay_t *relay2)
{
	h2span_link_t *link1 = relay1->source_rt->any.link;
	h2span_link_t *link2 = relay2->source_rt->any.link;

	if ((intptr_t)link1->node < (intptr_t)link2->node)
		return(-1);
	if ((intptr_t)link1->node > (intptr_t)link2->node)
		return(1);
	if (link1->dist < link2->dist)
		return(-1);
	if (link1->dist > link2->dist)
		return(1);
	if (link1->rnss < link2->rnss)
		return(-1);
	if (link1->rnss > link2->rnss)
		return(1);
#if 1
	if ((uintptr_t)link1->state < (uintptr_t)link2->state)
		return(-1);
	if ((uintptr_t)link1->state > (uintptr_t)link2->state)
		return(1);
#else
	if (link1->state->msgid < link2->state->msgid)
		return(-1);
	if (link1->state->msgid > link2->state->msgid)
		return(1);
#endif
	return(0);
}
/*
 * Relay entries are sorted by node, subsorted by distance and link
 * address (so we can match up the conn->tree relay topology with
 * a node's link topology).
 */
Relay entries are sorted by node, subsorted by distance and link
address (so we can match up the conn->tree relay topology with
a node's link topology).
Relay entries are sorted by node subsorted by distance and link address ( so we can match up the conn - > tree relay topology with a node ' s link topology ) .
static
int
h2span_relay_cmp(h2span_relay_t *relay1, h2span_relay_t *relay2)
{
	h2span_link_t *link1 = relay1->source_rt->any.link;
	h2span_link_t *link2 = relay2->source_rt->any.link;
	if ((intptr_t)link1->node < (intptr_t)link2->node)
		return(-1);
	if ((intptr_t)link1->node > (intptr_t)link2->node)
		return(1);
	if (link1->dist < link2->dist)
		return(-1);
	if (link1->dist > link2->dist)
		return(1);
	if (link1->rnss < link2->rnss)
		return(-1);
	if (link1->rnss > link2->rnss)
		return(1);
#if 1
	if ((uintptr_t)link1->state < (uintptr_t)link2->state)
		return(-1);
	if ((uintptr_t)link1->state > (uintptr_t)link2->state)
		return(1);
#else
	if (link1->state->msgid < link2->state->msgid)
		return(-1);
	if (link1->state->msgid > link2->state->msgid)
		return(1);
#endif
	return(0);
}
static int h2span_relay_cmp ( h2span_relay_t * relay1 , h2span_relay_t * relay2 ) { h2span_link_t * link1 = relay1 -> source_rt -> any . link ; h2span_link_t * link2 = relay2 -> source_rt -> any . link ; if ( ( intptr_t ) link1 -> node < ( intptr_t ) link2 -> node ) return ( -1 ) ; if ( ( intptr_t ) link1 -> node > ( intptr_t ) link2 -> node ) return ( 1 ) ; if ( link1 -> dist < link2 -> dist ) return ( -1 ) ; if ( link1 -> dist > link2 -> dist ) return ( 1 ) ; if ( link1 -> rnss < link2 -> rnss ) return ( -1 ) ; if ( link1 -> rnss > link2 -> rnss ) return ( 1 ) ; #if 1 if ( ( uintptr_t ) link1 -> state < ( uintptr_t ) link2 -> state ) return ( -1 ) ; if ( ( uintptr_t ) link1 -> state > ( uintptr_t ) link2 -> state ) return ( 1 ) ; #else if ( link1 -> state -> msgid < link2 -> state -> msgid ) return ( -1 ) ; if ( link1 -> state -> msgid > link2 -> state -> msgid ) return ( 1 ) ; #endif return ( 0 ) ; }
Relay entries are sorted by node, subsorted by distance and link
 address (so we can match up the conn->tree relay topology with
 a node's link topology).
Relay entries are sorted by node subsorted by distance and link address ( so we can match up the conn - > tree relay topology with a node ' s link topology ) .