Address some compiler warnings about implicit integer conversions.

--HG--
branch : minor
This commit is contained in:
Alex Szpakowski
2016-10-18 22:32:35 -03:00
parent 2e016810c9
commit 0653ec9564
23 changed files with 44 additions and 43 deletions
+2 -2
View File
@@ -61,7 +61,7 @@ ModPlugDecoder::ModPlugDecoder(Data *data, const std::string &ext, int bufferSiz
ModPlug_SetSettings(&settings);
// Load the module.
plug = ModPlug_Load(data->getData(), data->getSize());
plug = ModPlug_Load(data->getData(), (int) data->getSize());
if (plug == 0)
throw love::Exception("Could not load file with ModPlug.");
@@ -121,7 +121,7 @@ bool ModPlugDecoder::rewind()
{
// Let's reload.
ModPlug_Unload(plug);
plug = ModPlug_Load(data->getData(), data->getSize());
plug = ModPlug_Load(data->getData(), (int) data->getSize());
ModPlug_SetMasterVolume(plug, 128);
eof = false;
return (plug != 0);
+1 -1
View File
@@ -157,7 +157,7 @@ Mpg123Decoder::Mpg123Decoder(Data *data, const std::string &ext, int bufferSize)
mpg123_format_none(handle);
mpg123_format(handle, rate, channels, MPG123_ENC_SIGNED_16);
sampleRate = rate;
sampleRate = (int) rate;
}
catch (love::Exception &)
{
+5 -5
View File
@@ -76,9 +76,9 @@ static int vorbisSeek(void *datasource /* ptr to the data that the vorbis files
ogg_int64_t offset /*offset from the point we wish to seek to*/,
int whence /*where we want to seek to*/)
{
int spaceToEOF; // How much more we can read till we hit the EOF marker
ogg_int64_t actualOffset; // How much we can actually offset it by
SOggFile *vorbisData; // The data we passed in (for the typecast)
int64 spaceToEOF; // How much more we can read till we hit the EOF marker
int64 actualOffset; // How much we can actually offset it by
SOggFile *vorbisData; // The data we passed in (for the typecast)
// Get the data in the right format
vorbisData = (SOggFile *) datasource;
@@ -103,7 +103,7 @@ static int vorbisSeek(void *datasource /* ptr to the data that the vorbis files
else
actualOffset = spaceToEOF;
// Seek from our currrent location
vorbisData->dataRead += (int)actualOffset;
vorbisData->dataRead += actualOffset;
break;
case SEEK_END: // Seek from the end of the file
if (offset < 0)
@@ -147,7 +147,7 @@ VorbisDecoder::VorbisDecoder(Data *data, const std::string &ext, int bufferSize)
// Initialize OGG file
oggFile.dataPtr = (const char *) data->getData();
oggFile.dataSize = (int) data->getSize();
oggFile.dataSize = data->getSize();
oggFile.dataRead = 0;
// Open Vorbis handle
+3 -2
View File
@@ -23,6 +23,7 @@
// LOVE
#include "common/Data.h"
#include "common/int.h"
#include "Decoder.h"
// vorbis
@@ -41,8 +42,8 @@ namespace lullaby
struct SOggFile
{
const char *dataPtr; // Pointer to the data in memory
int dataSize; // Size of the data
int dataRead; // How much we've read so far
int64 dataSize; // Size of the data
int64 dataRead; // How much we've read so far
};
class VorbisDecoder : public Decoder