예제 #1
0
// returns 0 on error, 1 if ok.
int printf_test() {
    printf("[%s] %s\n", __FILE__, __func__);
    bitset_container_t* B = bitset_container_create();
    bitset_container_set(B, (uint16_t)1);
    bitset_container_set(B, (uint16_t)2);
    bitset_container_set(B, (uint16_t)3);
    bitset_container_set(B, (uint16_t)10);
    bitset_container_set(B, (uint16_t)10000);
    bitset_container_printf(B);  // does it crash?
    printf("\n");
    bitset_container_free(B);
    return 1;
}
예제 #2
0
void container_printf(const void *container, uint8_t typecode) {
	container = container_unwrap_shared(container,&typecode);
	switch (typecode) {
        case BITSET_CONTAINER_TYPE_CODE:
            bitset_container_printf(container);
            return;
        case ARRAY_CONTAINER_TYPE_CODE:
            array_container_printf(container);
            return;
        case RUN_CONTAINER_TYPE_CODE:
            run_container_printf(container);
            return;
        default:
            __builtin_unreachable();
    }
}