示例#1
0
static int aggregationHashChainCmp(const KSI_AggregationHashChain **left, const KSI_AggregationHashChain **right) {
	const KSI_AggregationHashChain *l = *left;
	const KSI_AggregationHashChain *r = *right;
	if (l == r || l == NULL || r == NULL || l->chainIndex == NULL || r->chainIndex == NULL) {
		return intCmp((KSI_uint64_t)right, (KSI_uint64_t)left);
	}
	return intCmp(KSI_IntegerList_length(r->chainIndex), KSI_IntegerList_length(l->chainIndex));
}
示例#2
0
int rangeCmp(const void *a, const void *b){
	int ret;
	if ((ret = intCmp(((range *)a)->a, ((range *)b)->a)))
		return ret;
	if ((ret = intCmp(((range *)a)->b, ((range *)b)->b)))
		return ret;
	return 0;
}
示例#3
0
int stIntTuple_cmpFn(stIntTuple *intTuple1, stIntTuple *intTuple2) {
    int32_t
            i,
            j =
                    stIntTuple_length(intTuple1) < stIntTuple_length(intTuple2) ? stIntTuple_length(
                            intTuple1)
                            : stIntTuple_length(intTuple2);
    for (i = 0; i < j; i++) {
        int32_t k = intCmp(stIntTuple_getPosition(intTuple1, i)
                ,stIntTuple_getPosition(intTuple2, i));
        if (k != 0) {
            return k;
        }
    }
    return intCmp(stIntTuple_length(intTuple1), stIntTuple_length(intTuple2));
}
示例#4
0
int laserCmp(const void *a, const void *b){
	int s = intCmp(((laser *)a)->start, ((laser *)b)->start);
	if (!s)
		s = intCmp(((laser *)a)->end, ((laser *)b)->end);
	return s;
}