[libpng16] Replace the remaining uses of png_size_t with size_t

In v1.6.0, size_t became a required type. It should be used
consistently. To maintain backwards compatibility, png_size_t
is still maintained in deprecated form.
This commit is contained in:
Cosmin Truta
2018-06-17 22:37:44 -04:00
parent 916117d970
commit a74aa9a002
36 changed files with 362 additions and 367 deletions

View File

@@ -410,15 +410,14 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
#ifndef PNG_STDIO_SUPPORTED
static void
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_read_data(png_structp png_ptr, png_bytep data, size_t length)
{
png_size_t check;
size_t check;
/* fread() returns 0 on error, so it is OK to store this in a png_size_t
/* fread() returns 0 on error, so it is OK to store this in a size_t
* instead of an int, which is what fread() actually returns.
*/
check = (png_size_t)fread(data, (png_size_t)1, length,
(FILE *)png_ptr->io_ptr);
check = fread(data, 1, length, (FILE *)png_ptr->io_ptr);
if (check != length)
{
@@ -427,7 +426,7 @@ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length)
}
static void
png_write_data(png_structp png_ptr, png_bytep data, png_size_t length)
png_write_data(png_structp png_ptr, png_bytep data, size_t length)
{
png_uint_32 check;

View File

@@ -23,8 +23,8 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
int iWidth, int iHeight, png_color BkgColor);
#ifndef PNG_STDIO_SUPPORTED
static void png_read_data(png_structp png_ptr, png_bytep data, png_size_t length);
static void png_write_data(png_structp png_ptr, png_bytep data, png_size_t length);
static void png_read_data(png_structp png_ptr, png_bytep data, size_t length);
static void png_write_data(png_structp png_ptr, png_bytep data, size_t length);
static void png_flush(png_structp png_ptr);
#endif