Skip to content

Commit

Permalink
silence warning 'possible loss of data' (win64)
Browse files Browse the repository at this point in the history
When compiling for 64bit Windows, size_t and unsigned int are of
different size, leading cl.exe to warning C4267:
 conversion from 'size_t' to 'unsigned int', possible loss of data
  • Loading branch information
haubi committed Oct 11, 2016
1 parent ac8f886 commit 2c720bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lodepng.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3460,7 +3460,7 @@ unsigned lodepng_convert(unsigned char* out, const unsigned char* in,
const LodePNGColorMode* mode_out, const LodePNGColorMode* mode_in,
unsigned w, unsigned h)
{
size_t i;
unsigned i;
ColorTree tree;
size_t numpixels = w * h;

Expand Down Expand Up @@ -4299,7 +4299,7 @@ static unsigned readChunk_bKGD(LodePNGInfo* info, const unsigned char* data, siz
}

/*text chunk (tEXt)*/
static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, size_t chunkLength)
static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, unsigned chunkLength)
{
unsigned error = 0;
char *key = 0, *str = 0;
Expand Down Expand Up @@ -4343,7 +4343,7 @@ static unsigned readChunk_tEXt(LodePNGInfo* info, const unsigned char* data, siz

/*compressed text chunk (zTXt)*/
static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings,
const unsigned char* data, size_t chunkLength)
const unsigned char* data, unsigned chunkLength)
{
unsigned error = 0;
unsigned i;
Expand Down Expand Up @@ -4392,7 +4392,7 @@ static unsigned readChunk_zTXt(LodePNGInfo* info, const LodePNGDecompressSetting

/*international text chunk (iTXt)*/
static unsigned readChunk_iTXt(LodePNGInfo* info, const LodePNGDecompressSettings* zlibsettings,
const unsigned char* data, size_t chunkLength)
const unsigned char* data, unsigned chunkLength)
{
unsigned error = 0;
unsigned i;
Expand Down

0 comments on commit 2c720bb

Please sign in to comment.