- Patch to allow compilation by clang.

SVN r3589 (trunk)
This commit is contained in:
Randy Heit 2012-04-23 02:46:25 +00:00
parent 5e3a41e8f6
commit a660eea116
6 changed files with 16 additions and 16 deletions

View file

@ -400,7 +400,7 @@ DUH *DUMBEXPORT dumb_load_it(const char *filename);
DUH *DUMBEXPORT dumb_load_xm(const char *filename); DUH *DUMBEXPORT dumb_load_xm(const char *filename);
DUH *DUMBEXPORT dumb_load_s3m(const char *filename); DUH *DUMBEXPORT dumb_load_s3m(const char *filename);
DUH *DUMBEXPORT dumb_load_stm(const char *filename); DUH *DUMBEXPORT dumb_load_stm(const char *filename);
DUH *DUMBEXPORT dumb_load_mod(const char *filename, int restrict); DUH *DUMBEXPORT dumb_load_mod(const char *filename, int rstrict);
DUH *DUMBEXPORT dumb_load_ptm(const char *filename); DUH *DUMBEXPORT dumb_load_ptm(const char *filename);
DUH *DUMBEXPORT dumb_load_669(const char *filename); DUH *DUMBEXPORT dumb_load_669(const char *filename);
DUH *DUMBEXPORT dumb_load_psm(const char *filename, int subsong); DUH *DUMBEXPORT dumb_load_psm(const char *filename, int subsong);
@ -413,7 +413,7 @@ DUH *DUMBEXPORT dumb_read_it(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_xm(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_xm(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_s3m(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_s3m(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_stm(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_stm(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int restrict); DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int rstrict);
DUH *DUMBEXPORT dumb_read_ptm(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_ptm(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_669(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_669(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_psm(DUMBFILE *f, int subsong); DUH *DUMBEXPORT dumb_read_psm(DUMBFILE *f, int subsong);
@ -426,7 +426,7 @@ DUH *DUMBEXPORT dumb_load_it_quick(const char *filename);
DUH *DUMBEXPORT dumb_load_xm_quick(const char *filename); DUH *DUMBEXPORT dumb_load_xm_quick(const char *filename);
DUH *DUMBEXPORT dumb_load_s3m_quick(const char *filename); DUH *DUMBEXPORT dumb_load_s3m_quick(const char *filename);
DUH *DUMBEXPORT dumb_load_stm_quick(const char *filename); DUH *DUMBEXPORT dumb_load_stm_quick(const char *filename);
DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int restrict); DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int rstrict);
DUH *DUMBEXPORT dumb_load_ptm_quick(const char *filename); DUH *DUMBEXPORT dumb_load_ptm_quick(const char *filename);
DUH *DUMBEXPORT dumb_load_669_quick(const char *filename); DUH *DUMBEXPORT dumb_load_669_quick(const char *filename);
DUH *DUMBEXPORT dumb_load_psm_quick(const char *filename, int subsong); DUH *DUMBEXPORT dumb_load_psm_quick(const char *filename, int subsong);
@ -439,7 +439,7 @@ DUH *DUMBEXPORT dumb_read_it_quick(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_xm_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_xm_quick(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_s3m_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_s3m_quick(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_stm_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_stm_quick(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int restrict); DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int rstrict);
DUH *DUMBEXPORT dumb_read_ptm_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_ptm_quick(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_669_quick(DUMBFILE *f); DUH *DUMBEXPORT dumb_read_669_quick(DUMBFILE *f);
DUH *DUMBEXPORT dumb_read_psm_quick(DUMBFILE *f, int subsong); DUH *DUMBEXPORT dumb_read_psm_quick(DUMBFILE *f, int subsong);

View file

@ -26,7 +26,7 @@
* pointer to the DUH struct. When you have finished with it, you must * pointer to the DUH struct. When you have finished with it, you must
* pass the pointer to unload_duh() so that the memory can be freed. * pass the pointer to unload_duh() so that the memory can be freed.
*/ */
DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int restrict) DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int rstrict)
{ {
DUH *duh; DUH *duh;
DUMBFILE *f = dumbfile_open(filename); DUMBFILE *f = dumbfile_open(filename);
@ -34,7 +34,7 @@ DUH *DUMBEXPORT dumb_load_mod_quick(const char *filename, int restrict)
if (!f) if (!f)
return NULL; return NULL;
duh = dumb_read_mod_quick(f, restrict); duh = dumb_read_mod_quick(f, rstrict);
dumbfile_close(f); dumbfile_close(f);

View file

@ -21,9 +21,9 @@
DUH *DUMBEXPORT dumb_load_mod(const char *filename, int restrict) DUH *DUMBEXPORT dumb_load_mod(const char *filename, int rstrict)
{ {
DUH *duh = dumb_load_mod_quick(filename, restrict); DUH *duh = dumb_load_mod_quick(filename, rstrict);
dumb_it_do_initial_runthrough(duh); dumb_it_do_initial_runthrough(duh);
return duh; return duh;
} }

View file

@ -441,7 +441,7 @@ static DUMBFILE *dumbfile_buffer_mod_2(DUMBFILE *f, int32 *remain)
} }
static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict) static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int rstrict)
{ {
DUMB_IT_SIGDATA *sigdata; DUMB_IT_SIGDATA *sigdata;
int n_channels; int n_channels;
@ -550,7 +550,7 @@ static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict)
} }
// moo // moo
if ( restrict && sigdata->n_samples == 15 ) if ( rstrict && sigdata->n_samples == 15 )
{ {
free(sigdata); free(sigdata);
dumbfile_close(f); dumbfile_close(f);
@ -758,16 +758,15 @@ static DUMB_IT_SIGDATA *it_mod_load_sigdata(DUMBFILE *f, int restrict)
DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int restrict) DUH *DUMBEXPORT dumb_read_mod_quick(DUMBFILE *f, int rstrict)
{ {
sigdata_t *sigdata; sigdata_t *sigdata;
DUH_SIGTYPE_DESC *descptr = &_dumb_sigtype_it; DUH_SIGTYPE_DESC *descptr = &_dumb_sigtype_it;
sigdata = it_mod_load_sigdata(f, restrict); sigdata = it_mod_load_sigdata(f, rstrict);
if (!sigdata) if (!sigdata)
return NULL;
{ {
const char *tag[2][2]; const char *tag[2][2];

View file

@ -21,9 +21,9 @@
DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int restrict) DUH *DUMBEXPORT dumb_read_mod(DUMBFILE *f, int rstrict)
{ {
DUH *duh = dumb_read_mod_quick(f, restrict); DUH *duh = dumb_read_mod_quick(f, rstrict);
dumb_it_do_initial_runthrough(duh); dumb_it_do_initial_runthrough(duh);
return duh; return duh;
} }

View file

@ -117,12 +117,13 @@ typedef float final_volume_t;
#define PI 3.14159265358979323846 #define PI 3.14159265358979323846
#endif #endif
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #if defined(__GNUC__) && !defined(__clang__) && (defined(__i386__) || defined(__x86_64__))
// [RH] MinGW's pow() function is terribly slow compared to VC8's // [RH] MinGW's pow() function is terribly slow compared to VC8's
// (I suppose because it's using an old version from MSVCRT.DLL). // (I suppose because it's using an old version from MSVCRT.DLL).
// On an Opteron running x86-64 Linux, this also ended up being about // On an Opteron running x86-64 Linux, this also ended up being about
// 100 cycles faster than libm's pow(), which is why I'm using this // 100 cycles faster than libm's pow(), which is why I'm using this
// for GCC in general and not just for MinGW. // for GCC in general and not just for MinGW.
// [CE] Clang doesn't yet support some inline ASM operations so I disabled it for that instance
extern __inline__ double pow_x87_inline(double x,double y) extern __inline__ double pow_x87_inline(double x,double y)
{ {