A possible alternative:

```c
int64_t pos = (int64_t) rstream->fpos;
assert(pos >= 0);

// now use pos directly in the function call
```