- fixed a few 64-bit warnings.

This commit is contained in:
Christoph Oelckers 2016-02-13 13:37:28 +01:00
parent f7e27032dc
commit 340faef1ec
6 changed files with 9 additions and 9 deletions

View file

@ -156,7 +156,7 @@ int Fir_Resampler_::input_needed( blargg_long output_count ) const
output_count -= 2;
}
long input_extra = input_count - (write_pos - &buf [(width_ - 1) * stereo]);
long input_extra = (long)(input_count - (write_pos - &buf [(width_ - 1) * stereo]));
if ( input_extra < 0 )
input_extra = 0;
return input_extra;

View file

@ -38,7 +38,7 @@ off_t MPG123Decoder::file_lseek(void *handle, off_t offset, int whence)
ssize_t MPG123Decoder::file_read(void *handle, void *buffer, size_t bytes)
{
FileReader *reader = reinterpret_cast<MPG123Decoder*>(handle)->Reader;
return reader->Read(buffer, bytes);
return (ssize_t)reader->Read(buffer, (long)bytes);
}
@ -183,7 +183,7 @@ bool MPG123Decoder::seek(size_t ms_offset)
if(mpg123_getformat(MPG123, &srate, &channels, &enc) == MPG123_OK)
{
size_t smp_offset = (size_t)((double)ms_offset / 1000. * srate);
if(mpg123_seek(MPG123, smp_offset, SEEK_SET) >= 0)
if(mpg123_seek(MPG123, (off_t)smp_offset, SEEK_SET) >= 0)
{
Done = false;
return true;

View file

@ -617,7 +617,7 @@ public:
SampleRate = srate;
Looping = loop;
Data.Resize((size_t)(0.2 * SampleRate) * FrameSize);
Data.Resize((SampleRate / 5) * FrameSize);
return true;
}
@ -782,7 +782,7 @@ OpenALSoundRenderer::OpenALSoundRenderer()
alcGetIntegerv(Device, ALC_STEREO_SOURCES, 1, &numStereo);
Sources.Resize(MIN<int>(MAX<int>(*snd_channels, 2), numMono+numStereo));
for(size_t i = 0;i < Sources.Size();i++)
for(unsigned i = 0;i < Sources.Size();i++)
{
alGenSources(1, &Sources[i]);
if(getALError() != AL_NO_ERROR)

View file

@ -126,7 +126,7 @@ TArray<char> SndFileDecoder::readAll()
output.Resize((unsigned)(SndInfo.frames * framesize));
size_t got = read(&output[0], output.Size());
output.Resize(got);
output.Resize((unsigned)got);
return output;
}

View file

@ -54,8 +54,8 @@ static TArray<AFuncDesc> AFTable;
//==========================================================================
// [RH] Keep GCC quiet by not using offsetof on Actor types.
#define DEFINE_FLAG(prefix, name, type, variable) { prefix##_##name, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) }
#define DEFINE_FLAG2(symbol, name, type, variable) { symbol, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) }
#define DEFINE_FLAG(prefix, name, type, variable) { (unsigned int)prefix##_##name, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) }
#define DEFINE_FLAG2(symbol, name, type, variable) { (unsigned int)symbol, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) }
#define DEFINE_DEPRECATED_FLAG(name) { DEPF_##name, #name, -1, 0 }
#define DEFINE_DUMMY_FLAG(name) { DEPF_UNUSED, #name, -1, 0 }

View file

@ -1584,7 +1584,7 @@ void ST_Util_DrawChar (BITMAPINFO *screen, const BYTE *font, int x, int y, BYTE
const BYTE fg = attrib & 0x0F;
const BYTE fg_left = fg << 4;
const BYTE bg = bg_left >> 4;
const BYTE color_array[4] = { bg_left | bg, attrib & 0x7F, fg_left | bg, fg_left | fg };
const BYTE color_array[4] = { (BYTE)(bg_left | bg), (BYTE)(attrib & 0x7F), (BYTE)(fg_left | bg), (BYTE)(fg_left | fg) };
const BYTE *src = font + 1 + charnum * font[0];
int pitch = screen->bmiHeader.biWidth >> 1;
BYTE *dest = ST_Util_BitsForBitmap(screen) + x*4 + y * font[0] * pitch;