Please declare global variables as `static`, i.e.:
```c
static void *sp;
static void *sq;
…
```