diff --git a/lodepng.cpp b/lodepng.cpp index 69f1b10a8..8fc928147 100644 --- a/lodepng.cpp +++ b/lodepng.cpp @@ -3325,7 +3325,7 @@ void lodepng_compute_color_stats(LodePNGColorStats* stats, if(!numcolors_done) { for(i = 0; i < stats->numcolors; i++) { const unsigned char* color = &stats->palette[i * 4]; - color_tree_add(&tree, color[0], color[1], color[2], color[3], i); + color_tree_add(&tree, color[0], color[1], color[2], color[3], (unsigned int)i); } } @@ -4243,7 +4243,7 @@ static unsigned readChunk_iCCP(LodePNGInfo* info, const LodePNGDecompressSetting &data[string2_begin], length, zlibsettings); if(!error) { - info->iccp_profile_size = decoded.size; + info->iccp_profile_size = (unsigned int)decoded.size; info->iccp_profile = (unsigned char*)lodepng_malloc(decoded.size); if(info->iccp_profile) { memcpy(info->iccp_profile, decoded.data, decoded.size); diff --git a/lodepng.h b/lodepng.h index 669f6c810..feb6358fc 100644 --- a/lodepng.h +++ b/lodepng.h @@ -28,13 +28,6 @@ freely, subject to the following restrictions: #include /*for size_t*/ -namespace vtkm -{ -namespace png -{ - -extern const char* LODEPNG_VERSION_STRING; - /* The following #defines are used to create code sections. They can be disabled to disable code sections, which can give faster compile time and smaller binary. @@ -99,6 +92,13 @@ source files with custom allocators.*/ #include #endif /*LODEPNG_COMPILE_CPP*/ +namespace vtkm +{ +namespace png +{ + +extern const char* LODEPNG_VERSION_STRING; + #ifdef LODEPNG_COMPILE_PNG /*The PNG color types (also used for raw).*/ typedef enum LodePNGColorType {