It's quite similar to the way ec_thread_new() passes data to the thread function.
Data is expected to passed via pointers.
This is done in the above mentioned commit 0a5e77c. Because now it's really a pointer the callback function also expects a pointer and that way, no funny casting is necessary because there the pointer is really used as a pointer and not misused as an integer:
```c
gint *type = data; // new int pointer set to the memory address set in data
// ...
switch (*type) {
// ...
```