Use common byte-swapping routines and remove cdparanoia-specific ones.
(This time, for sure!)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: common_interface.c,v 1.9 2005/01/22 03:45:18 rocky Exp $
|
||||
$Id: common_interface.c,v 1.10 2005/01/23 00:20:43 rocky Exp $
|
||||
|
||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
Copyright (C) 1998, 2002 Monty monty@xiph.org
|
||||
@@ -111,9 +111,9 @@ data_bigendianp(cdrom_drive_t *d)
|
||||
int j;
|
||||
|
||||
for(j=0;j<128;j++)
|
||||
a[j]=le16_to_cpu(buff[j*2+beginsec+460]);
|
||||
a[j] = UINT16_TO_LE(buff[j*2+beginsec+460]);
|
||||
for(j=0;j<128;j++)
|
||||
b[j]=le16_to_cpu(buff[j*2+beginsec+461]);
|
||||
b[j] = UINT16_TO_LE(buff[j*2+beginsec+461]);
|
||||
|
||||
fft_forward(128,a,NULL,NULL);
|
||||
fft_forward(128,b,NULL,NULL);
|
||||
@@ -122,10 +122,10 @@ data_bigendianp(cdrom_drive_t *d)
|
||||
lsb_energy+=fabs(a[j])+fabs(b[j]);
|
||||
|
||||
for(j=0;j<128;j++)
|
||||
a[j]=be16_to_cpu(buff[j*2+beginsec+460]);
|
||||
a[j] = UINT16_TO_BE(buff[j*2+beginsec+460]);
|
||||
|
||||
for(j=0;j<128;j++)
|
||||
b[j]=be16_to_cpu(buff[j*2+beginsec+461]);
|
||||
b[j] = UINT16_TO_BE(buff[j*2+beginsec+461]);
|
||||
|
||||
fft_forward(128,a,NULL,NULL);
|
||||
fft_forward(128,b,NULL,NULL);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
$Id: utils.h,v 1.5 2005/01/14 01:36:12 rocky Exp $
|
||||
$Id: utils.h,v 1.6 2005/01/23 00:20:43 rocky Exp $
|
||||
|
||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||
Copyright (C) 1998 Monty xiphmont@mit.edu
|
||||
@@ -36,64 +36,6 @@ bigendianp(void)
|
||||
|
||||
extern char *catstring(char *buff, const char *s);
|
||||
|
||||
|
||||
/*#if BYTE_ORDER == LITTLE_ENDIAN*/
|
||||
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
|
||||
static inline int32_t be32_to_cpu(int32_t x){
|
||||
return(UINT32_SWAP_LE_BE_C(x));
|
||||
}
|
||||
|
||||
static inline int16_t be16_to_cpu(int16_t x){
|
||||
return(UINT16_SWAP_LE_BE_C(x));
|
||||
}
|
||||
|
||||
static inline int32_t le32_to_cpu(int32_t x){
|
||||
return(x);
|
||||
}
|
||||
|
||||
static inline int16_t le16_to_cpu(int16_t x){
|
||||
return(x);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static inline int32_t be32_to_cpu(int32_t x){
|
||||
return(x);
|
||||
}
|
||||
|
||||
static inline int16_t be16_to_cpu(int16_t x){
|
||||
return(x);
|
||||
}
|
||||
|
||||
static inline int32_t le32_to_cpu(int32_t x){
|
||||
return(UINT32_SWAP_LE_BE_C(x));
|
||||
}
|
||||
|
||||
static inline int16_t le16_to_cpu(int16_t x){
|
||||
return(UINT16_SWAP_LE_BE_C(x));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
static inline int32_t cpu_to_be32(int32_t x){
|
||||
return(be32_to_cpu(x));
|
||||
}
|
||||
|
||||
static inline int32_t cpu_to_le32(int32_t x){
|
||||
return(le32_to_cpu(x));
|
||||
}
|
||||
|
||||
static inline int16_t cpu_to_be16(int16_t x){
|
||||
return(be16_to_cpu(x));
|
||||
}
|
||||
|
||||
static inline int16_t cpu_to_le16(int16_t x){
|
||||
return(le16_to_cpu(x));
|
||||
}
|
||||
|
||||
void cderror(cdrom_drive_t *d, const char *s);
|
||||
|
||||
void cdmessage(cdrom_drive_t *d,const char *s);
|
||||
|
||||
Reference in New Issue
Block a user