diff --git a/examples/array.c b/examples/array.c index 7dc68be..bf35430 100644 --- a/examples/array.c +++ b/examples/array.c @@ -7,11 +7,11 @@ typedef vtype_array arr_t; -int print_value(void* value, ssize_t index, vtype type, void* data) { +int print_value(vtype_variable value, ssize_t index, void* data) { const char *n = data; - vtype_int32 *v = value; + vtype_int32 *v = value.pointer; - assert(type == VTYPE_INT32); + assert(value.type == VTYPE_INT32); printf("%s %d (index: %ld)\n", n, *v, index); diff --git a/examples/dict.c b/examples/dict.c index c4bebbb..604d6b6 100644 --- a/examples/dict.c +++ b/examples/dict.c @@ -8,28 +8,28 @@ typedef vtype_dict dict_t; -int print_value(const void* key, vtype key_type, void* value, vtype value_type, void* data) { +int print_value(vtype_variable key, vtype_variable value, void* data) { const char *n = data; - switch (key_type) { + switch (key.type) { default: abort(); case VTYPE_INT32: - printf("%s %d: ", n, *(vtype_int32*)key); + printf("%s %d: ", n, *(vtype_int32*)key.pointer); break; case VTYPE_FLOAT: - printf("%s %f: ", n, *(vtype_float*)key); + printf("%s %f: ", n, *(vtype_float*)key.pointer); break; } - switch (value_type) { + switch (value.type) { default: abort(); case VTYPE_INT32: - printf("%d\n", *(vtype_int32*)value); + printf("%d\n", *(vtype_int32*)value.pointer); break; case VTYPE_FLOAT: - printf("%f\n", *(vtype_float*)value); + printf("%f\n", *(vtype_float*)value.pointer); break; } diff --git a/examples/list.c b/examples/list.c index 83ca85a..e2a8e7b 100644 --- a/examples/list.c +++ b/examples/list.c @@ -8,17 +8,17 @@ typedef vtype_list list_t; -int print_value(void* value, ssize_t index, vtype type, void* data) { +int print_value(vtype_variable value, ssize_t index, void* data) { const char *n = data; - switch (type) { + switch (value.type) { default: abort(); case VTYPE_INT32: - printf("%s %d (index: %ld)\n", n, *(vtype_int32*)value, index); + printf("%s %d (index: %ld)\n", n, *(vtype_int32*)value.pointer, index); break; case VTYPE_FLOAT: - printf("%s %f (index: %ld)\n", n, *(vtype_float*)value, index); + printf("%s %f (index: %ld)\n", n, *(vtype_float*)value.pointer, index); break; } diff --git a/examples/map.c b/examples/map.c index 30c8a2a..a60b02f 100644 --- a/examples/map.c +++ b/examples/map.c @@ -8,22 +8,22 @@ typedef vtype_map map_t; -int print_value(const void* key, vtype key_type, void* value, vtype value_type, void* data) { +int print_value(vtype_variable key, vtype_variable value, void* data) { const char *n = data; - vtype_int32 *k = (void*)key; + vtype_int32 *k = (void*)key.pointer; - assert(key_type == VTYPE_INT32); + assert(key.type == VTYPE_INT32); printf("%s %d: ", n, *k); - switch (value_type) { + switch (value.type) { default: abort(); case VTYPE_INT32: - printf("%d\n", *(vtype_int32*)value); + printf("%d\n", *(vtype_int32*)value.pointer); break; case VTYPE_FLOAT: - printf("%f\n", *(vtype_float*)value); + printf("%f\n", *(vtype_float*)value.pointer); break; } diff --git a/examples/set.c b/examples/set.c index d05a978..643c22e 100644 --- a/examples/set.c +++ b/examples/set.c @@ -7,11 +7,11 @@ typedef vtype_set vset_t; -int print_value(const void* value, vtype type, void* data) { +int print_value(vtype_variable value, void* data) { const char *n = data; - vtype_int32 *v = (void*)value; + vtype_int32 *v = (void*)value.pointer; - assert(type == VTYPE_INT32); + assert(value.type == VTYPE_INT32); printf("%s %d\n", n, *v);