diff options
Diffstat (limited to 'Build/source/libs/libpng/libpng-src/pngtest.c')
-rw-r--r-- | Build/source/libs/libpng/libpng-src/pngtest.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/Build/source/libs/libpng/libpng-src/pngtest.c b/Build/source/libs/libpng/libpng-src/pngtest.c index 37b42bb3461..f83e8bbf2cd 100644 --- a/Build/source/libs/libpng/libpng-src/pngtest.c +++ b/Build/source/libs/libpng/libpng-src/pngtest.c @@ -1,7 +1,7 @@ /* pngtest.c - a simple test program to test libpng * - * Copyright (c) 2018-2019 Cosmin Truta + * Copyright (c) 2018-2024 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -524,7 +524,7 @@ PNGCBAPI png_debug_malloc(png_structp png_ptr, png_alloc_size_t size) */ if (size == 0) - return (NULL); + return NULL; /* This calls the library allocator twice, once to get the requested buffer and once to get a new free list entry. */ @@ -565,7 +565,7 @@ PNGCBAPI png_debug_malloc(png_structp png_ptr, png_alloc_size_t size) printf("png_malloc %lu bytes at %p\n", (unsigned long)size, pinfo->pointer); - return (png_voidp)(pinfo->pointer); + return (png_voidp)pinfo->pointer; } } @@ -698,9 +698,9 @@ read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk) png_error(png_ptr, "lost user chunk pointer"); /* Return one of the following: - * return (-n); chunk had an error - * return (0); did not recognize - * return (n); success + * return -n; chunk had an error + * return 0; did not recognize + * return n; success * * The unknown chunk structure contains the chunk data: * png_byte name[5]; @@ -715,38 +715,38 @@ read_user_chunk_callback(png_struct *png_ptr, png_unknown_chunkp chunk) { /* Found sTER chunk */ if (chunk->size != 1) - return (-1); /* Error return */ + return -1; /* Error return */ if (chunk->data[0] != 0 && chunk->data[0] != 1) - return (-1); /* Invalid mode */ + return -1; /* Invalid mode */ if (set_location(png_ptr, my_user_chunk_data, have_sTER) != 0) { my_user_chunk_data->sTER_mode=chunk->data[0]; - return (1); + return 1; } else - return (0); /* duplicate sTER - give it to libpng */ + return 0; /* duplicate sTER - give it to libpng */ } if (chunk->name[0] != 118 || chunk->name[1] != 112 || /* v p */ chunk->name[2] != 65 || chunk->name[3] != 103) /* A g */ - return (0); /* Did not recognize */ + return 0; /* Did not recognize */ /* Found ImageMagick vpAg chunk */ if (chunk->size != 9) - return (-1); /* Error return */ + return -1; /* Error return */ if (set_location(png_ptr, my_user_chunk_data, have_vpAg) == 0) - return (0); /* duplicate vpAg */ + return 0; /* duplicate vpAg */ my_user_chunk_data->vpAg_width = png_get_uint_31(png_ptr, chunk->data); my_user_chunk_data->vpAg_height = png_get_uint_31(png_ptr, chunk->data + 4); my_user_chunk_data->vpAg_units = chunk->data[8]; - return (1); + return 1; } #ifdef PNG_WRITE_SUPPORTED @@ -882,14 +882,14 @@ test_one_file(const char *inname, const char *outname) if ((fpin = fopen(inname, "rb")) == NULL) { fprintf(STDERR, "Could not find input file %s\n", inname); - return (1); + return 1; } if ((fpout = fopen(outname, "wb")) == NULL) { fprintf(STDERR, "Could not open output file %s\n", outname); FCLOSE(fpin); - return (1); + return 1; } pngtest_debug("Allocating read and write structures"); @@ -948,7 +948,7 @@ test_one_file(const char *inname, const char *outname) #endif FCLOSE(fpin); FCLOSE(fpout); - return (1); + return 1; } #ifdef PNG_WRITE_SUPPORTED @@ -968,7 +968,7 @@ test_one_file(const char *inname, const char *outname) png_destroy_write_struct(&write_ptr, &write_info_ptr); FCLOSE(fpin); FCLOSE(fpout); - return (1); + return 1; } #endif #endif @@ -1656,16 +1656,16 @@ test_one_file(const char *inname, const char *outname) pngtest_debug("Destroying data structs"); #ifdef SINGLE_ROWBUF_ALLOC - pngtest_debug("destroying row_buf for read_ptr"); + pngtest_debug("Destroying row_buf for read_ptr"); png_free(read_ptr, row_buf); row_buf = NULL; #endif /* SINGLE_ROWBUF_ALLOC */ - pngtest_debug("destroying read_ptr, read_info_ptr, end_info_ptr"); + pngtest_debug("Destroying read_ptr, read_info_ptr, end_info_ptr"); png_destroy_read_struct(&read_ptr, &read_info_ptr, &end_info_ptr); #ifdef PNG_WRITE_SUPPORTED - pngtest_debug("destroying write_end_info_ptr"); + pngtest_debug("Destroying write_end_info_ptr"); png_destroy_info_struct(write_ptr, &write_end_info_ptr); - pngtest_debug("destroying write_ptr, write_info_ptr"); + pngtest_debug("Destroying write_ptr, write_info_ptr"); png_destroy_write_struct(&write_ptr, &write_info_ptr); #endif pngtest_debug("Destruction complete."); @@ -1686,7 +1686,7 @@ test_one_file(const char *inname, const char *outname) inname, error_count, warning_count); if (strict != 0) - return (1); + return 1; } # ifdef PNG_WRITE_SUPPORTED @@ -1704,21 +1704,21 @@ test_one_file(const char *inname, const char *outname) inname, warning_count); if (strict != 0) - return (1); + return 1; } pngtest_debug("Opening files for comparison"); if ((fpin = fopen(inname, "rb")) == NULL) { fprintf(STDERR, "Could not find file %s\n", inname); - return (1); + return 1; } if ((fpout = fopen(outname, "rb")) == NULL) { fprintf(STDERR, "Could not find file %s\n", outname); FCLOSE(fpin); - return (1); + return 1; } #if defined (PNG_WRITE_SUPPORTED) /* else nothing was written */ &&\ @@ -1757,10 +1757,10 @@ test_one_file(const char *inname, const char *outname) FCLOSE(fpout); if (strict != 0 && unsupported_chunks == 0) - return (1); + return 1; else - return (0); + return 0; } if (num_in == 0) @@ -1794,10 +1794,10 @@ test_one_file(const char *inname, const char *outname) * can be exactly the same size! */ if (strict != 0 && unsupported_chunks == 0) - return (1); + return 1; else - return (0); + return 0; } } } @@ -1806,7 +1806,7 @@ test_one_file(const char *inname, const char *outname) FCLOSE(fpin); FCLOSE(fpout); - return (0); + return 0; } /* Input and output filenames */ @@ -2155,4 +2155,4 @@ main(void) #endif /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_40 Your_png_h_is_not_version_1_6_40; +typedef png_libpng_version_1_6_41 Your_png_h_is_not_version_1_6_41; |