Re: [WINEALSA] Add Midi IN support (take 3)

2004-01-12 Thread Alexandre Julliard
Christian Costa <[EMAIL PROTECTED]> writes: > Alexandre Julliard wrote: > >>This isn't thread-safe. >> > The function that uses them is a timer callback. You are right, this doesn't matter then. > Well, I intended, in later patches, to update the poll fds when > opening or closing devices and th

Re: [WINEALSA] Add Midi IN support (take 3)

2004-01-12 Thread Christian Costa
Alexandre Julliard wrote: Christian Costa <[EMAIL PROTECTED]> writes: +static int npfd; +static int pfd_array_size = 0; +static struct pollfd *pfd = NULL; This isn't thread-safe. The function that uses them is a timer callback. Why don't you simply allocate the array in the function and

Re: [WINEALSA] Add Midi IN support (take 3)

2004-01-12 Thread Alexandre Julliard
Christian Costa <[EMAIL PROTECTED]> writes: > +static int npfd; > +static int pfd_array_size = 0; > +static struct pollfd *pfd = NULL; This isn't thread-safe. Why don't you simply allocate the array in the function and free it when you are done? -- Alexandre Julliard [EMAIL PROTECTED]

Re: [WINEALSA] Add Midi IN support (w/o alloca)

2004-01-11 Thread Christian Costa
Eric Pouech wrote: Christian Costa a écrit : +for (wDevID = 0; wDevID < MIDM_NumDevs; wDevID++) +if ( (ev->source.client == MidiInDev[wDevID].addr.client) && (ev->source.client == MidiInDev[wDevID].addr.client) ) +break; Why do you do twice the same test ? A+ Indeed this is

Re: [WINEALSA] Add Midi IN support (w/o alloca)

2004-01-11 Thread Eric Pouech
Christian Costa a écrit : + for (wDevID = 0; wDevID < MIDM_NumDevs; wDevID++) + if ( (ev->source.client == MidiInDev[wDevID].addr.client) && (ev->source.client == MidiInDev[wDevID].addr.client) ) + break; Why do you do twice the same test ? A+

Re: [WINEALSA] Add Midi IN support

2004-01-11 Thread Christian Costa
Marcus Meissner wrote: On Fri, Jan 09, 2004 at 12:03:10PM +, Mike Hearn wrote: On Thu, 08 Jan 2004 16:46:53 -0800, Alexandre Julliard wrote: You should not use alloca in Wine, it's not portable enough. Could we take the glib implementation of alloca and stick it into libwine_por

Re: [WINEALSA] Add Midi IN support

2004-01-09 Thread Marcus Meissner
On Fri, Jan 09, 2004 at 12:03:10PM +, Mike Hearn wrote: > On Thu, 08 Jan 2004 16:46:53 -0800, Alexandre Julliard wrote: > > You should not use alloca in Wine, it's not portable enough. > > Could we take the glib implementation of alloca and stick it into > libwine_port? IIRC in glib it uses th

Re: [WINEALSA] Add Midi IN support

2004-01-09 Thread Mike Hearn
On Thu, 08 Jan 2004 16:46:53 -0800, Alexandre Julliard wrote: > You should not use alloca in Wine, it's not portable enough. Could we take the glib implementation of alloca and stick it into libwine_port? IIRC in glib it uses the system implementation unless it's not good enough or missing, in whi

Re: [WINEALSA] Add Midi IN support

2004-01-08 Thread Alexandre Julliard
Christian Costa <[EMAIL PROTECTED]> writes: > +int npfd; > +struct pollfd *pfd; > + > +npfd = snd_seq_poll_descriptors_count(midiSeq, POLLIN); > +pfd = (struct pollfd *)alloca(npfd * sizeof(struct pollfd)); You should not use alloca in Wine, it's not portable enough. -- Alex