예제 #1
0
void enclave_main()
{
    sgx_debug("qsort test\n");

    sgx_qsort(values, 6, sizeof(int), compare);

    sgx_printf("%d %d %d %d %d %d\n", values[0], values[1], values[2], values[3], values[4], values[5]);

    sgx_exit(NULL);
}
예제 #2
0
파일: stack.c 프로젝트: johnjohnsp1/opensgx
void sk_sort(_STACK *st)
{
    if (st && !st->sorted) {
        int (*comp_func) (const void *, const void *);

        /*
         * same comment as in sk_find ... previously st->comp was declared as
         * a (void*,void*) callback type, but this made the population of the
         * callback pointer illogical - our callbacks compare type** with
         * type**, so we leave the casting until absolutely necessary (ie.
         * "now").
         */
        comp_func = (int (*)(const void *, const void *))(st->comp);
        sgx_qsort(st->data, st->num, sizeof(char *), comp_func);
        st->sorted = 1;
    }
}