Michael W. Bombardieri wrote:
> > > ok for removing xfree from aucat?
> > 
> > yes, ok ratchov; if later this causes me merges i'll find another
> > solution.  Feel free to do the same in usr.bin/sndiod, as it's
> > almost the same.
> 
> Same thing for sndiod...

ok mmcc@

> Index: abuf.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/abuf.c,v
> retrieving revision 1.3
> diff -u -p -u -r1.3 abuf.c
> --- abuf.c    16 Feb 2015 06:11:33 -0000      1.3
> +++ abuf.c    12 Nov 2015 07:07:57 -0000
> @@ -62,7 +62,7 @@ abuf_done(struct abuf *buf)
>               }
>       }
>  #endif
> -     xfree(buf->data);
> +     free(buf->data);
>       buf->data = (void *)0xdeadbeef;
>  }
>  
> Index: dev.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/dev.c,v
> retrieving revision 1.18
> diff -u -p -u -r1.18 dev.c
> --- dev.c     5 Sep 2015 11:19:20 -0000       1.18
> +++ dev.c     12 Nov 2015 07:07:57 -0000
> @@ -15,6 +15,7 @@
>   * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
>   */
>  #include <stdio.h>
> +#include <stdlib.h>
>  #include <string.h>
>  
>  #include "abuf.h"
> @@ -838,10 +839,8 @@ dev_cycle(struct dev *d)
>                        */
>                       s->pstate = SLOT_INIT;
>                       abuf_done(&s->mix.buf);
> -                     if (s->mix.decbuf)
> -                             xfree(s->mix.decbuf);
> -                     if (s->mix.resampbuf)
> -                             xfree(s->mix.resampbuf);
> +                     free(s->mix.decbuf);
> +                     free(s->mix.resampbuf);
>                       s->ops->eof(s->arg);
>                       *ps = s->next;
>                       dev_mix_adjvol(d);
> @@ -1143,14 +1142,12 @@ dev_close(struct dev *d)
>       d->slot_list = NULL;
>       dev_sio_close(d);
>       if (d->mode & MODE_PLAY) {
> -             if (d->encbuf != NULL)
> -                     xfree(d->encbuf);
> -             xfree(d->pbuf);
> +             free(d->encbuf);
> +             free(d->pbuf);
>       }
>       if (d->mode & MODE_REC) {
> -             if (d->decbuf != NULL)
> -                     xfree(d->decbuf);
> -             xfree(d->rbuf);
> +             free(d->decbuf);
> +             free(d->rbuf);
>       }
>  }
>  
> @@ -1256,7 +1253,7 @@ dev_del(struct dev *d)
>       }
>       midi_del(d->midi);
>       *p = d->next;
> -     xfree(d);
> +     free(d);
>  }
>  
>  unsigned int
> @@ -1829,16 +1826,12 @@ slot_detach(struct slot *s)
>       }       
>       *ps = s->next;
>       if (s->mode & MODE_RECMASK) {
> -             if (s->sub.encbuf)
> -                     xfree(s->sub.encbuf);
> -             if (s->sub.resampbuf)
> -                     xfree(s->sub.resampbuf);
> +             free(s->sub.encbuf);
> +             free(s->sub.resampbuf);
>       }
>       if (s->mode & MODE_PLAY) {
> -             if (s->mix.decbuf)
> -                     xfree(s->mix.decbuf);
> -             if (s->mix.resampbuf)
> -                     xfree(s->mix.resampbuf);
> +             free(s->mix.decbuf);
> +             free(s->mix.resampbuf);
>               dev_mix_adjvol(s->dev);
>       }
>  }
> Index: file.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/file.c,v
> retrieving revision 1.15
> diff -u -p -u -r1.15 file.c
> --- file.c    27 Aug 2015 07:38:38 -0000      1.15
> +++ file.c    12 Nov 2015 07:07:57 -0000
> @@ -328,7 +328,7 @@ file_poll(void)
>       while ((f = *pf) != NULL) {
>               if (f->state == FILE_ZOMB) {
>                       *pf = f->next;
> -                     xfree(f);
> +                     free(f);
>               } else
>                       pf = &f->next;
>       }
> Index: listen.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/listen.c,v
> retrieving revision 1.2
> diff -u -p -u -r1.2 listen.c
> --- listen.c  13 Mar 2013 08:28:33 -0000      1.2
> +++ listen.c  12 Nov 2015 07:07:57 -0000
> @@ -70,13 +70,12 @@ listen_close(struct listen *f)
>       }
>       *pf = f->next;
>  
> -     if (f->path != NULL) {
> +     if (f->path != NULL)
>               unlink(f->path);
> -             xfree(f->path);
> -     }
> +     free(f->path);
>       file_del(f->file);
>       close(f->fd);
> -     xfree(f);
> +     free(f);
>  }
>  
>  void
> Index: midi.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/midi.c,v
> retrieving revision 1.10
> diff -u -p -u -r1.10 midi.c
> --- midi.c    28 Sep 2013 18:49:32 -0000      1.10
> +++ midi.c    12 Nov 2015 07:07:57 -0000
> @@ -461,7 +461,7 @@ port_del(struct port *c)
>  #endif
>       }
>       *p = c->next;
> -     xfree(c);
> +     free(c);
>  }
>  
>  int
> Index: opt.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/opt.c,v
> retrieving revision 1.2
> diff -u -p -u -r1.2 opt.c
> --- opt.c     7 Dec 2012 08:04:58 -0000       1.2
> +++ opt.c     12 Nov 2015 07:07:57 -0000
> @@ -136,5 +136,5 @@ opt_del(struct opt *o)
>  #endif
>       }
>       *po = o->next;
> -     xfree(o);
> +     free(o);
>  }
> Index: sock.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/sock.c,v
> retrieving revision 1.15
> diff -u -p -u -r1.15 sock.c
> --- sock.c    16 Feb 2015 06:35:17 -0000      1.15
> +++ sock.c    12 Nov 2015 07:07:57 -0000
> @@ -152,7 +152,7 @@ sock_close(struct sock *f)
>       }
>       file_del(f->file);
>       close(f->fd);
> -     xfree(f);
> +     free(f);
>  }
>  
>  void
> @@ -289,7 +289,7 @@ sock_new(int fd)
>       f->file = file_new(&sock_fileops, f, "sock", 1);
>       f->fd = fd;
>       if (f->file == NULL) {
> -             xfree(f);
> +             free(f);
>               return NULL;
>       }
>       f->next = sock_list;
> Index: utils.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/utils.c,v
> retrieving revision 1.1
> diff -u -p -u -r1.1 utils.c
> --- utils.c   23 Nov 2012 07:03:28 -0000      1.1
> +++ utils.c   12 Nov 2015 07:07:57 -0000
> @@ -158,15 +158,6 @@ xmalloc(size_t size)
>  }
>  
>  /*
> - * free memory allocated with xmalloc()
> - */
> -void
> -xfree(void *p)
> -{
> -     free(p);
> -}
> -
> -/*
>   * xmalloc-style strdup(3)
>   */
>  char *
> Index: utils.h
> ===================================================================
> RCS file: /cvs/src/usr.bin/sndiod/utils.h,v
> retrieving revision 1.3
> diff -u -p -u -r1.3 utils.h
> --- utils.h   12 May 2013 04:58:41 -0000      1.3
> +++ utils.h   12 Nov 2015 07:07:57 -0000
> @@ -29,7 +29,6 @@ void log_flush(void);
>  
>  void *xmalloc(size_t);
>  char *xstrdup(char *);
> -void xfree(void *);
>  
>  /*
>   * Log levels:

Reply via email to