From: Takashi Iwai Subject: Re: lack or LFS support for fopen in alsa-oss Date: Thu, 15 Feb 2007 15:58:43 +0100 Message-ID: References: <45D470D1.2060007@gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <45D470D1.2060007@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@lists.sourceforge.net Errors-To: alsa-devel-bounces@lists.sourceforge.net To: Constantine Gavrilov Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Thu, 15 Feb 2007 16:40:17 +0200, Constantine Gavrilov wrote: > > +#define DSP_OPEN() \ > +{ \ > + fd = lib_oss_pcm_open(file, oflag); \ > + if (fd >= 0) { \ > + int nfds; \ > + fds[fd] = calloc(sizeof(fd_t), 1); \ > + if (fds[fd] == NULL) { \ > + ops[FD_OSS_DSP].close(fd); \ > + errno = ENOMEM; \ > + return -1; \ > + } \ > + fds[fd]->class = FD_OSS_DSP; \ > + fds[fd]->oflags = oflag; \ > + nfds = lib_oss_pcm_poll_fds(fd); \ > + if (nfds > 0) { \ > + fds[fd]->poll_fds = nfds; \ > + poll_fds_add += nfds; \ > + } \ > + } \ > +} > + > +#define MIXER_OPEN() \ > +{ \ > + fd = lib_oss_mixer_open(file, oflag); \ > + if (fd >= 0) { \ > + fds[fd] = calloc(sizeof(fd_t), 1); \ > + if (fds[fd] == NULL) { \ > + ops[FD_OSS_MIXER].close(fd); \ > + errno = ENOMEM; \ > + return -1; \ > + } \ > + fds[fd]->class = FD_OSS_MIXER; \ > + fds[fd]->oflags = oflag; \ > + } \ > +} These are not necessarily macros unlike DECL_OPEN. Static functions would be much better. Could you fix it? Thanks, Takashi ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV