mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 01:49:53 +00:00
Fix warnings reported by Clang 10
This commit is contained in:
parent
fe50b95615
commit
a9f4037de1
@ -108,7 +108,7 @@ float_checksum (SNDFILE * file, int start)
|
||||
do
|
||||
{ count = (int) sf_read_float (file, data.f, ARRAY_LEN (data.f)) ;
|
||||
for (k = 0 ; k < count ; k++)
|
||||
start = start * BIG_PRIME + lrintf (0x7FFFFFFF * data.f [k]) ;
|
||||
start = start * BIG_PRIME + lrintf (2147483648.0f * data.f [k]) ;
|
||||
}
|
||||
while (count > 0) ;
|
||||
|
||||
|
@ -159,7 +159,7 @@ static void Fast_Autocorrelation (
|
||||
for (i = k ; i < 160 ; ++i) L_temp2 += sf [i] * sfl [i] ;
|
||||
f_L_ACF [k] = L_temp2 ;
|
||||
}
|
||||
scale = MAX_LONGWORD / f_L_ACF [0] ;
|
||||
scale = 2147483648.0f / f_L_ACF [0] ;
|
||||
|
||||
for (k = 0 ; k <= 8 ; k++)
|
||||
L_ACF [k] = f_L_ACF [k] * scale ;
|
||||
|
@ -233,7 +233,7 @@ dither_write_short (SF_PRIVATE *psf, const short *ptr, sf_count_t len)
|
||||
return pdither->write_short (psf, ptr, len) ;
|
||||
} ;
|
||||
|
||||
bufferlen = sizeof (pdither->buffer) / sizeof (short) ;
|
||||
bufferlen = sizeof (pdither->buffer) / (sizeof (short)) ;
|
||||
|
||||
while (len > 0)
|
||||
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
|
||||
@ -279,7 +279,7 @@ dither_write_int (SF_PRIVATE *psf, const int *ptr, sf_count_t len)
|
||||
} ;
|
||||
|
||||
|
||||
bufferlen = sizeof (pdither->buffer) / sizeof (int) ;
|
||||
bufferlen = sizeof (pdither->buffer) / (sizeof (int)) ;
|
||||
|
||||
while (len > 0)
|
||||
{ writecount = (len >= bufferlen) ? bufferlen : (int) len ;
|
||||
@ -324,7 +324,7 @@ dither_write_float (SF_PRIVATE *psf, const float *ptr, sf_count_t len)
|
||||
return pdither->write_float (psf, ptr, len) ;
|
||||
} ;
|
||||
|
||||
bufferlen = sizeof (pdither->buffer) / sizeof (float) ;
|
||||
bufferlen = sizeof (pdither->buffer) / (sizeof (float)) ;
|
||||
|
||||
while (len > 0)
|
||||
{ writecount = (len >= bufferlen) ? bufferlen : (float) len ;
|
||||
|
@ -597,7 +597,7 @@ host_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len)
|
||||
|
||||
convert = (psf->add_clipping) ? d2i_clip_array : d2i_array ;
|
||||
bufferlen = ARRAY_LEN (ubuf.dbuf) ;
|
||||
scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFFFFFF / psf->float_max ;
|
||||
scale = (psf->float_int_mult == 0) ? 1.0 : 2147483648.0f / psf->float_max ;
|
||||
|
||||
while (len > 0)
|
||||
{ if (len < bufferlen)
|
||||
@ -836,7 +836,7 @@ replace_read_d2i (SF_PRIVATE *psf, int *ptr, sf_count_t len)
|
||||
double scale ;
|
||||
|
||||
bufferlen = ARRAY_LEN (ubuf.dbuf) ;
|
||||
scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFFFFFF / psf->float_max ;
|
||||
scale = (psf->float_int_mult == 0) ? 1.0 : 2147483648.0f / psf->float_max ;
|
||||
|
||||
while (len > 0)
|
||||
{ if (len < bufferlen)
|
||||
|
@ -549,7 +549,7 @@ host_read_f2i (SF_PRIVATE *psf, int *ptr, sf_count_t len)
|
||||
|
||||
convert = (psf->add_clipping) ? f2i_clip_array : f2i_array ;
|
||||
bufferlen = ARRAY_LEN (ubuf.fbuf) ;
|
||||
scale = (psf->float_int_mult == 0) ? 1.0 : 0x7FFFFFFF / psf->float_max ;
|
||||
scale = (psf->float_int_mult == 0) ? 1.0 : 2147483648.0f / psf->float_max ;
|
||||
|
||||
while (len > 0)
|
||||
{ if (len < bufferlen)
|
||||
|
@ -313,8 +313,8 @@ permission_test (const char *filename, int typemajor)
|
||||
{
|
||||
#if (OS_IS_WIN32)
|
||||
/* Avoid compiler warnings. */
|
||||
filename = filename ;
|
||||
typemajor = typemajor ;
|
||||
(void) filename ;
|
||||
(void) typemajor ;
|
||||
|
||||
/* Can't run this test on Win32 so return. */
|
||||
return ;
|
||||
|
Loading…
Reference in New Issue
Block a user