[Tremor] excessive use of 'long' vars
Monty
xiphmont at xiph.org
Thu May 11 14:49:41 PDT 2006
On Thu, May 11, 2006 at 11:03:17PM +0200, Oliver Lange wrote:
> Monty schrieb:
> >
> >It should be set using type defines. 'int' is the wrong answer too,
> >as there are plenty of platforms where an int is 8 bits or 16 bits,
> >which is not large enough either.
> >
>
> Of course you're right, int32_t is the correct answer there.
>
> However, i just compiled tremor on Gentoo-64 and it produced
> exactly the same output as the 32-bit build for Win2k. At least
> it works, even with some 64-bit bitmasks and other 64-bit stuff
> used here & there.
right; the overly long type is, stricty, correct, it's just wasteful.
The nature of your complaint is valid nonetheless.
>
> Another minor thing (call me squeamish if you like):
> If the caller has to open the input stream, then
> ov_clear() should not close the file by default, just
> cleanup it's structs. The one who opens a file should
> also be responsible for closing. Maybe the caller wants
> to rewind the stream to play a looped sample?
that's what ov_seek [et al] are for.
But answering the original question, once you hand off resources to
the library, you are not permitted any mucking with those resources
(unless explicitly allowed by the docs), the stdio stream especially.
You're not allowed to use fseek()... why is fclose any different?
You've handed the file handle to tremor, it belongs to tremor.
(I see what you're saying; the behavioral model is arbitrary, but
it is also documented in detail).
Monty
More information about the Tremor
mailing list