diff options
author | jdc <jdc@pkgsrc.org> | 2010-03-26 16:38:32 +0000 |
---|---|---|
committer | jdc <jdc@pkgsrc.org> | 2010-03-26 16:38:32 +0000 |
commit | c47c92f795300df7f71d2381b0f5e44a77707681 (patch) | |
tree | b2c6cae5437cbabed6801c5630467ffcb3574428 /audio | |
parent | e49cd5622cca980e5fd2508660301ba174789a96 (diff) | |
download | pkgsrc-c47c92f795300df7f71d2381b0f5e44a77707681.tar.gz |
patch-ad: fix an #endif versus #else error
patch-cc: adds NetBSD bswap* to interface/utils.h as per utils.h
patch-ci: fix a crash on big-endian machines
Diffstat (limited to 'audio')
-rw-r--r-- | audio/cdparanoia/patches/patch-ad | 14 | ||||
-rw-r--r-- | audio/cdparanoia/patches/patch-cc | 16 | ||||
-rw-r--r-- | audio/cdparanoia/patches/patch-ci | 21 |
3 files changed, 35 insertions, 16 deletions
diff --git a/audio/cdparanoia/patches/patch-ad b/audio/cdparanoia/patches/patch-ad index 12ee25d654b..7c665bc0fb9 100644 --- a/audio/cdparanoia/patches/patch-ad +++ b/audio/cdparanoia/patches/patch-ad @@ -1,7 +1,7 @@ -$NetBSD: patch-ad,v 1.4 2006/09/03 17:13:30 ben Exp $ +$NetBSD: patch-ad,v 1.5 2010/03/26 16:38:32 jdc Exp $ ---- utils.h.orig 2000-04-19 15:41:04.000000000 -0700 -+++ utils.h +--- utils.h.orig 2008-08-22 09:39:06.000000000 +0000 ++++ utils.h 2010-03-24 11:10:19.000000000 +0000 @@ -1,5 +1,20 @@ #include <stdlib.h> +#ifdef __linux__ @@ -23,7 +23,7 @@ $NetBSD: patch-ad,v 1.4 2006/09/03 17:13:30 ben Exp $ #include <stdio.h> #include <errno.h> #include <string.h> -@@ -19,15 +34,34 @@ static inline int bigendianp(void){ +@@ -18,15 +33,35 @@ } static inline int32_t swap32(int32_t x){ @@ -44,17 +44,19 @@ $NetBSD: patch-ad,v 1.4 2006/09/03 17:13:30 ben Exp $ +#endif } - static inline int16_t swap16(int16_t x){ +-static inline int16_t swap16(int16_t x){ ++static inline int16_t swap16(int16_t x){ +#ifdef __NetBSD__ + return bswap16(x); +#else +#if defined(__APPLE__) && defined(__MACH__) + return((((uint16_t)x & 0x00ffU) << 8) | + (((uint16_t)x & 0xff00U) >> 8)); -+#endif ++#else return((((u_int16_t)x & 0x00ffU) << 8) | (((u_int16_t)x & 0xff00U) >> 8)); +#endif ++#endif } #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/audio/cdparanoia/patches/patch-cc b/audio/cdparanoia/patches/patch-cc index 459f6ac4a09..ea2329926d5 100644 --- a/audio/cdparanoia/patches/patch-cc +++ b/audio/cdparanoia/patches/patch-cc @@ -1,7 +1,7 @@ -$NetBSD: patch-cc,v 1.7 2009/08/09 16:00:53 drochner Exp $ +$NetBSD: patch-cc,v 1.8 2010/03/26 16:38:32 jdc Exp $ ---- interface/utils.h.orig 2008-08-14 15:56:20.000000000 +0200 -+++ interface/utils.h +--- interface/utils.h.orig 2008-08-14 13:56:20.000000000 +0000 ++++ interface/utils.h 2010-03-24 10:55:09.000000000 +0000 @@ -1,4 +1,23 @@ +#ifdef __linux__ #include <endian.h> @@ -26,10 +26,13 @@ $NetBSD: patch-cc,v 1.7 2009/08/09 16:00:53 drochner Exp $ #include <stdio.h> #include <errno.h> #include <string.h> -@@ -14,15 +33,27 @@ static inline int bigendianp(void){ +@@ -14,15 +33,35 @@ } static inline int32_t swap32(int32_t x){ ++#ifdef __NetBSD__ ++ return bswap32(x); ++#else +#if defined(__APPLE__) && defined(__MACH__) + return((((uint32_t)x & 0x000000ffU) << 24) | + (((uint32_t)x & 0x0000ff00U) << 8) | @@ -41,9 +44,13 @@ $NetBSD: patch-cc,v 1.7 2009/08/09 16:00:53 drochner Exp $ (((u_int32_t)x & 0x00ff0000U) >> 8) | (((u_int32_t)x & 0xff000000U) >> 24)); +#endif ++#endif } static inline int16_t swap16(int16_t x){ ++#ifdef __NetBSD__ ++ return bswap16(x); ++#else +#if defined(__APPLE__) && defined(__MACH__) + return((((uint16_t)x & 0x00ffU) << 8) | + (((uint16_t)x & 0xff00U) >> 8)); @@ -51,6 +58,7 @@ $NetBSD: patch-cc,v 1.7 2009/08/09 16:00:53 drochner Exp $ return((((u_int16_t)x & 0x00ffU) << 8) | (((u_int16_t)x & 0xff00U) >> 8)); +#endif ++#endif } #if BYTE_ORDER == LITTLE_ENDIAN diff --git a/audio/cdparanoia/patches/patch-ci b/audio/cdparanoia/patches/patch-ci index 213b0e48b78..dcbaa518ad7 100644 --- a/audio/cdparanoia/patches/patch-ci +++ b/audio/cdparanoia/patches/patch-ci @@ -1,8 +1,8 @@ -$NetBSD: patch-ci,v 1.7 2009/08/29 04:54:52 hasso Exp $ +$NetBSD: patch-ci,v 1.8 2010/03/26 16:38:32 jdc Exp $ ---- interface/interface.c.orig 2008-09-11 13:43:52 +0300 -+++ interface/interface.c 2009-08-26 09:57:44 +0300 -@@ -35,6 +35,10 @@ int cdda_close(cdrom_drive *d){ +--- interface/interface.c.orig 2008-09-11 10:43:52.000000000 +0000 ++++ interface/interface.c 2010-03-24 13:57:38.000000000 +0000 +@@ -35,6 +35,10 @@ _clean_messages(d); if(d->cdda_device_name)free(d->cdda_device_name); @@ -13,7 +13,7 @@ $NetBSD: patch-ci,v 1.7 2009/08/29 04:54:52 hasso Exp $ if(d->ioctl_device_name)free(d->ioctl_device_name); if(d->drive_model)free(d->drive_model); if(d->cdda_fd!=-1)close(d->cdda_fd); -@@ -43,6 +47,19 @@ int cdda_close(cdrom_drive *d){ +@@ -43,6 +47,19 @@ if(d->private->sg_hd)free(d->private->sg_hd); free(d->private); } @@ -33,7 +33,7 @@ $NetBSD: patch-ci,v 1.7 2009/08/29 04:54:52 hasso Exp $ free(d); } -@@ -55,22 +72,31 @@ int cdda_open(cdrom_drive *d){ +@@ -55,22 +72,31 @@ if(d->opened)return(0); switch(d->interface){ @@ -65,3 +65,12 @@ $NetBSD: patch-ci,v 1.7 2009/08/29 04:54:52 hasso Exp $ default: cderror(d,"100: Interface not supported\n"); return(-100); +@@ -113,7 +139,7 @@ + if(sectors>0){ + sectors=d->read_audio(d,buffer,beginsector,sectors); + +- if(sectors>0){ ++ if(sectors>0 && buffer != NULL){ + /* byteswap? */ + if(d->bigendianp==-1) /* not determined yet */ + d->bigendianp=data_bigendianp(d); |