Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings: conversion from 'size_t' to 'unsigned short', possible loss of data #180

Open
AntTheAlchemist opened this issue Apr 13, 2023 · 2 comments

Comments

@AntTheAlchemist
Copy link

Had these warnings come up for the past couple of years on Visual Studio 2022 when building for x86.

lodepng.cpp(704,35): warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
lodepng.cpp(729,37): warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
lodepng.cpp(746,38): warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
@Derpalus
Copy link

Derpalus commented May 30, 2023

Compiling in x64 mode on VS 2019 I get even more warnings:

lodepng.cpp(704,35): warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
lodepng.cpp(705,39): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)
lodepng.cpp(729,37): warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
lodepng.cpp(746,38): warning C4267: '=': conversion from 'size_t' to 'unsigned short', possible loss of data
lodepng.cpp(3999,78): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5062,33): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5331,60): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5336,83): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5337,94): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5338,83): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5339,94): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5340,83): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5341,94): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5342,78): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5537,3): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5561,7): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5595,62): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5612,3): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5634,57): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5665,57): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5778,57): warning C4267: 'argument': conversion from 'size_t' to 'unsigned int', possible loss of data
lodepng.cpp(5892,33): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)

@kajott
Copy link
Contributor

kajott commented Nov 29, 2023

This is a duplicate of #67, and should be fixed by #142.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants