Re: OSS sound
Rob Crittenden <[email protected]>
| Newsgroups | gmane.comp.emulators.winex.devel |
|---|---|
| Message-ID | <[email protected]> |
On Thu, 30 Oct 2003, Peter Hunnisett wrote:
> >
> >So basically clear and reset are reversed depending on whether one is using
> >pipes or events.
> >
> >If the unix pipes are clearly faster it would seem a good optimization to
> >port this code over to the Alsa driver (which still uses events) but I
> >wonder which behavior is correct. This looks like real low-hanging fruit.
> >
> Unix pipes are faster than win32 events with the present setup. Feel
> free to code up an X11 licensed patch. I'd be happy to include it.
Er, right. But do you know should it be? Should CLEAR be a no-op or RESET?
I gather that RESET should be since it appears to be that way in OSS. I just
thought I'd ask rather than assuming, especially since it is the reverse
in the current Alsa library.
> >It also seems strange to go thru the trouble of a while loop that will always
> >be false...
> >
> It's a standard C idiom to make macros look like functions. Once can
> write CLEAR_OMR(parm); in the code (note semicolon)
Yes, I understand how macros work. My question is why have a do/while loop that
will always exit at the first test? Why not write the macros as:
...
#define CLEAR_OMR(omr) { int x = 0; read((omr)->msg_pipe[0], &x, sizeof(x)); }
#define RESET_OMR(omr) { }
...
It just seems like a strange thing to do.
rob
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/