lib/libdmsg/msg_lnk.c
static
int
h2span_link_cmp(h2span_link_t *link1, h2span_link_t *link2)
{
	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);
}
/*
 * Sort/subsort must match h2span_relay_cmp() under any given node
 * to make the aggregation algorithm easier, so the best links are
 * in the same sorted order as the best relays.
 *
 * NOTE: We cannot use link*->state->msgid because this msgid is created
 *	 by each remote host and thus might wind up being the same.
 */
Sort/subsort must match h2span_relay_cmp() under any given node
to make the aggregation algorithm easier, so the best links are
in the same sorted order as the best relays.

We cannot use link*->state->msgid because this msgid is created
by each remote host and thus might wind up being the same.
Sort / subsort must match h2span_relay_cmp () under any given node to make the aggregation algorithm easier so the best links are in the same sorted order as the best relays . We cannot use link * - > state - > msgid because this msgid is created by each remote host and thus might wind up being the same .
static
int
h2span_link_cmp(h2span_link_t *link1, h2span_link_t *link2)
{
	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_link_cmp ( h2span_link_t * link1 , h2span_link_t * link2 ) { 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 ) ; }
Sort/subsort must match h2span_relay_cmp() under any given node
 to make the aggregation algorithm easier, so the best links are
 in the same sorted order as the best relays.
Sort / subsort must match h2span_relay_cmp () under any given node to make the aggregation algorithm easier so the best links are in the same sorted order as the best relays .