mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
Add cast to size_t for some parameters passed to psf_binheader_writef.
This commit is contained in:
parent
b5087b6221
commit
5a1ba58762
@ -1,3 +1,9 @@
|
||||
2004-06-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* src/avr.c src/ircam.c src/nist.c src/paf.c src/w64.c src/xi.c
|
||||
Add cast to size_t for some parameters passed to psf_binheader_writef. This
|
||||
is Debian bug number 253490. Thanks to Anand Kumria and Andreas Jochens.
|
||||
|
||||
2004-06-14 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* configure.ac
|
||||
|
@ -220,7 +220,7 @@ avr_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
|
||||
datalength = (int) (psf->datalength & 0x7FFFFFFF) ;
|
||||
|
||||
psf_binheader_writef (psf, "Emz22", TWOBIT_MARKER, 8,
|
||||
psf_binheader_writef (psf, "Emz22", TWOBIT_MARKER, (size_t) 8,
|
||||
psf->sf.channels == 2 ? 0xFFFF : 0, psf->bytewidth * 8) ;
|
||||
|
||||
sign = ((psf->sf.format & SF_FORMAT_SUBMASK) == SF_FORMAT_PCM_U8) ? 0 : 0xFFFF ;
|
||||
@ -228,7 +228,7 @@ avr_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
psf_binheader_writef (psf, "E222", sign, 0, 0xFFFF) ;
|
||||
psf_binheader_writef (psf, "E4444", psf->sf.samplerate, psf->sf.frames, 0, 0) ;
|
||||
|
||||
psf_binheader_writef (psf, "E222zz", 0, 0, 0, 20, 64) ;
|
||||
psf_binheader_writef (psf, "E222zz", 0, 0, 0, (size_t) 20, (size_t) 64) ;
|
||||
|
||||
/* Header construction complete so write it out. */
|
||||
psf_fwrite (psf->header, psf->headindex, 1, psf) ;
|
||||
|
@ -279,7 +279,7 @@ ircam_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
default : return SFE_BAD_OPEN_FORMAT ;
|
||||
} ;
|
||||
|
||||
psf_binheader_writef (psf, "z", IRCAM_DATA_OFFSET - psf->headindex) ;
|
||||
psf_binheader_writef (psf, "z", (size_t) (IRCAM_DATA_OFFSET - psf->headindex)) ;
|
||||
|
||||
/* Header construction complete so write it out. */
|
||||
psf_fwrite (psf->header, psf->headindex, 1, psf) ;
|
||||
|
@ -331,7 +331,7 @@ nist_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
psf_asciiheader_printf (psf, "end_head\n") ;
|
||||
|
||||
/* Zero fill to dataoffset. */
|
||||
psf_binheader_writef (psf, "z", NIST_HEADER_LENGTH - psf->headindex) ;
|
||||
psf_binheader_writef (psf, "z", (size_t) (NIST_HEADER_LENGTH - psf->headindex)) ;
|
||||
|
||||
psf_fwrite (psf->header, psf->headindex, 1, psf) ;
|
||||
|
||||
|
@ -320,7 +320,7 @@ paf_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
} ;
|
||||
|
||||
/* Zero fill to dataoffset. */
|
||||
psf_binheader_writef (psf, "z", (int) (psf->dataoffset - psf->headindex)) ;
|
||||
psf_binheader_writef (psf, "z", (size_t) (psf->dataoffset - psf->headindex)) ;
|
||||
|
||||
psf_fwrite (psf->header, psf->headindex, 1, psf) ;
|
||||
|
||||
|
@ -528,7 +528,7 @@ w64_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
|
||||
/* Pad to 8 bytes with zeros. */
|
||||
if (fmt_size % 8)
|
||||
psf_binheader_writef (psf, "z", 8 - (fmt_size % 8)) ;
|
||||
psf_binheader_writef (psf, "z", (size_t) (8 - (fmt_size % 8))) ;
|
||||
|
||||
if (add_fact_chunk)
|
||||
psf_binheader_writef (psf, "eh88", fact_MARKER16, 16 + 8 + 8, psf->sf.frames) ;
|
||||
|
4
src/xi.c
4
src/xi.c
@ -298,12 +298,12 @@ xi_write_header (SF_PRIVATE *psf, int calc_length)
|
||||
** Jump note numbers (96), volume envelope (48), pan envelope (48),
|
||||
** volume points (1), pan points (1)
|
||||
*/
|
||||
psf_binheader_writef (psf, "z", 96 + 48 + 48 + 1 + 1) ;
|
||||
psf_binheader_writef (psf, "z", (size_t) (96 + 48 + 48 + 1 + 1)) ;
|
||||
|
||||
/* Jump volume loop (3 bytes), pan loop (3), envelope flags (3), vibrato (3)
|
||||
** fade out (2), 22 unknown bytes, and then write sample_count (2 bytes).
|
||||
*/
|
||||
psf_binheader_writef (psf, "ez2z2", 4 * 3, 0x1234, 22, 1) ;
|
||||
psf_binheader_writef (psf, "ez2z2", (size_t) (4 * 3), 0x1234, (size_t) 22, 1) ;
|
||||
|
||||
psf->sf.frames = 12 ;
|
||||
pxi->loop_begin = 0 ;
|
||||
|
Loading…
Reference in New Issue
Block a user