Fix compile warnings for 64 bit systems.

This commit is contained in:
Erik de Castro Lopo 2007-04-16 23:54:51 +10:00
parent b05c4a46aa
commit 28714c9ee0
4 changed files with 8 additions and 5 deletions

View File

@ -3,6 +3,9 @@
* src/double64.c
Fix clipping of double to short conversions on 64 bit systems.
* src/flac.c regtest/database.c tests/cpp_test.cc
Fix compile warnings for 64 bit systems.
2007-04-15 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/wav.c src/wav_w64.c

View File

@ -185,8 +185,8 @@ db_add_file (REG_DB * db_handle, const char * filepath)
snprintf (db->cmdbuf, sizeof (db->cmdbuf), "insert into sndfile "
"(fname, fpath, srate, frames, channels, format, checksum, logbuf) values"
"('%s','%s',%d,'%lld', %d, '0x%08x', '0x%08x', '%s');",
db->filename, db->pathname, info.samplerate, info.frames, info.channels, info.format, checksum, db->logbuf) ;
"('%s','%s',%d,'%ld', %d, '0x%08x', '0x%08x', '%s');",
db->filename, db->pathname, info.samplerate, (long) info.frames, info.channels, info.format, checksum, db->logbuf) ;
if (strlen (db->cmdbuf) >= sizeof (db->cmdbuf) - 1)
{ printf ("strlen (db->cmdbuf) too long.\n") ;
@ -368,7 +368,7 @@ check_file_by_ekey (REGTEST_DB * db, int ekey)
if (strcmp (result [k], "frames") == 0)
{ if (strtoll (result [k + cols], NULL, 10) == info.frames)
continue ;
printf ("\n\nError : frames doesn't match : %s == %lld\n", result [k + cols], info.frames) ;
printf ("\n\nError : frames doesn't match : %s == %ld\n", result [k + cols], (long) info.frames) ;
} ;
if (strcmp (result [k], "channels") == 0)

View File

@ -422,7 +422,7 @@ static FLAC__StreamEncoderWriteStatus
sf_flac_enc_write_callback (const FLAC__StreamEncoder * UNUSED (encoder), const FLAC__byte buffer [], size_t bytes, unsigned UNUSED (samples), unsigned UNUSED (current_frame), void *client_data)
{ SF_PRIVATE *psf = (SF_PRIVATE*) client_data ;
if (psf_fwrite (buffer, 1, bytes, psf) == bytes && psf->error == 0)
if (psf_fwrite (buffer, 1, bytes, psf) == (sf_count_t) bytes && psf->error == 0)
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK ;
return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR ;

View File

@ -123,7 +123,7 @@ read_file (const char * filename, int format)
} ;
if (file.frames () != ARRAY_LEN (sbuffer) * 4)
{ printf ("\n\n%s %d : Error : frames %ld should be %u.\n\n", __func__, __LINE__,
{ printf ("\n\n%s %d : Error : frames %ld should be %lu.\n\n", __func__, __LINE__,
SF_COUNT_TO_LONG (file.frames ()), ARRAY_LEN (sbuffer) * 4 / 2) ;
exit (1) ;
} ;