Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
I noticed you used INT64. Are there precautions in place if it doesn't exist?
Well, I simply went UTSL... Further down in that file it says:
struct source *source_stream_make( struct svalue *s, INT64 start, INT64 len )
Then I see:
res->len = len; res->skip = start;
Ergo:
INT64 len, skip;
Is needed to fullfill this.
So, any precautions necessary must have been there already, I presume. Using ssize_t or ptrdiff_t is not a good idea in this case, since we're dealing with the sizes of datastreams (not even files). So the closest you're going to get is off_t (which is signed, I believe), but since it's a stream and not a file, not even that is good enough.
So, since INT64 goes in, and a stream can be rather large (larger than any existing file), I'd suggest to keep INT64 (unless the necessary precautions have not been made; but that's Per's department :-).
Following up on this hint, I decided to dig a little deeper. Found something. A C size_t type which was compared with > 0 and which stored -1 sometimes.