mirror of
				https://git.code.sf.net/p/libpng/code.git
				synced 2025-07-10 18:04:09 +02:00 
			
		
		
		
	[libpng17] Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)"
This commit is contained in:
		
							parent
							
								
									fd409c8019
								
							
						
					
					
						commit
						515659d638
					
				
							
								
								
									
										5
									
								
								ANNOUNCE
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								ANNOUNCE
									
									
									
									
									
								
							| @ -1,5 +1,5 @@ | ||||
| 
 | ||||
| Libpng 1.7.0beta39 - October 17, 2014 | ||||
| Libpng 1.7.0beta39 - October 26, 2014 | ||||
| 
 | ||||
| This is not intended to be a public release.  It will be replaced | ||||
| within a few weeks by a public version or by another test version. | ||||
| @ -617,7 +617,8 @@ Version 1.7.0beta38 [October 17, 2014] | ||||
|   Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa | ||||
|   Only mark text chunks as written after successfully writing them. | ||||
| 
 | ||||
| Version 1.7.0beta39 [October 17, 2014] | ||||
| Version 1.7.0beta39 [October 26, 2014] | ||||
|   Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)" | ||||
| 
 | ||||
| Send comments/corrections/commendations to png-mng-implement at lists.sf.net | ||||
| (subscription required; visit | ||||
|  | ||||
							
								
								
									
										3
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								CHANGES
									
									
									
									
									
								
							| @ -4906,7 +4906,8 @@ Version 1.7.0beta38 [October 17, 2014] | ||||
|   Removed "option WRITE_COMPRESSED_TEXT enables WRITE_TEXT" from pnglibconf.dfa | ||||
|   Only mark text chunks as written after successfully writing them. | ||||
| 
 | ||||
| Version 1.7.0beta39 [October 17, 2014] | ||||
| Version 1.7.0beta39 [October 26, 2014] | ||||
|   Changed "if (!x)" to "if (x == 0)" and "if (x)" to "if (x !== 0)" | ||||
| 
 | ||||
| Send comments/corrections/commendations to png-mng-implement at lists.sf.net | ||||
| (subscription required; visit | ||||
|  | ||||
							
								
								
									
										7
									
								
								png.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								png.c
									
									
									
									
									
								
							| @ -696,13 +696,13 @@ png_get_copyright(png_const_structrp png_ptr) | ||||
| #else | ||||
| #  ifdef __STDC__ | ||||
|    return PNG_STRING_NEWLINE \ | ||||
|      "libpng version 1.7.0beta39 - October 17, 2014" PNG_STRING_NEWLINE \ | ||||
|      "libpng version 1.7.0beta39 - October 26, 2014" PNG_STRING_NEWLINE \ | ||||
|      "Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ | ||||
|      "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ | ||||
|      "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ | ||||
|      PNG_STRING_NEWLINE; | ||||
| #  else | ||||
|       return "libpng version 1.7.0beta39 - October 17, 2014\
 | ||||
|       return "libpng version 1.7.0beta39 - October 26, 2014\
 | ||||
|       Copyright (c) 1998-2014 Glenn Randers-Pehrson\ | ||||
|       Copyright (c) 1996-1997 Andreas Dilger\ | ||||
|       Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; | ||||
| @ -3180,7 +3180,8 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times, | ||||
|                result = -result; | ||||
| 
 | ||||
|             /* Check for overflow. */ | ||||
|             if ((negative && result <= 0) || (!negative && result >= 0)) | ||||
|             if ((negative != 0 && result <= 0) || | ||||
|                 (negative == 0 && result >= 0)) | ||||
|             { | ||||
|                *res = result; | ||||
|                return 1; | ||||
|  | ||||
| @ -2632,10 +2632,10 @@ png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) | ||||
|        */ | ||||
|       ++prefix_length; | ||||
| 
 | ||||
|       if (!compressed && prefix_length <= length) | ||||
|       if (compressed == 0 && prefix_length <= length) | ||||
|          uncompressed_length = length - prefix_length; | ||||
| 
 | ||||
|       else if (compressed && prefix_length < length) | ||||
|       else if (compressed != 0 && prefix_length < length) | ||||
|       { | ||||
|          uncompressed_length = PNG_SIZE_MAX; | ||||
| 
 | ||||
| @ -2928,7 +2928,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr, | ||||
| #endif /* !PNG_READ_UNKNOWN_CHUNKS_SUPPORTED */ | ||||
| 
 | ||||
|    /* Check for unhandled critical chunks */ | ||||
|    if (!handled && PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) | ||||
|    if (handled == 0 && PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) | ||||
|       png_chunk_error(png_ptr, "unhandled critical chunk"); | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -1,7 +1,7 @@ | ||||
| 
 | ||||
| /* pngtest.c - a simple test program to test libpng
 | ||||
|  * | ||||
|  * Last changed in libpng 1.6.11 [June 5, 2014] | ||||
|  * Last changed in libpng 1.6.15 [(PENDING RELEASE)] | ||||
|  * Copyright (c) 1998-2014 Glenn Randers-Pehrson | ||||
|  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | ||||
|  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | ||||
| @ -1780,10 +1780,11 @@ main(int argc, char *argv[]) | ||||
|       } | ||||
|    } | ||||
| 
 | ||||
|    if (!multiple && argc == 3 + verbose) | ||||
|    if (multiple == 0 && argc == 3 + verbose) | ||||
|      outname = argv[2 + verbose]; | ||||
| 
 | ||||
|    if ((!multiple && argc > 3 + verbose) || (multiple && argc < 2)) | ||||
|    if ((multiple == 0 && argc > 3 + verbose) || | ||||
|        (multiple != 0 && argc < 2)) | ||||
|    { | ||||
|      fprintf(STDERR, | ||||
|        "usage: %s [infile.png] [outfile.png]\n\t%s -m {infile.png}\n", | ||||
|  | ||||
							
								
								
									
										15
									
								
								pngwrite.c
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								pngwrite.c
									
									
									
									
									
								
							| @ -2120,9 +2120,11 @@ png_image_write_main(png_voidp argument) | ||||
|    png_uint_32 format = image->format; | ||||
| 
 | ||||
|    int colormap = (format & PNG_FORMAT_FLAG_COLORMAP) != 0; | ||||
|    int linear = !colormap && (format & PNG_FORMAT_FLAG_LINEAR) != 0; /* input */ | ||||
|    int alpha = !colormap && (format & PNG_FORMAT_FLAG_ALPHA) != 0; | ||||
|    int write_16bit = linear && !colormap && !display->convert_to_8bit; | ||||
|    /* input */ | ||||
|    int linear = (colormap == 0) && (format & PNG_FORMAT_FLAG_LINEAR) != 0; | ||||
|    int alpha = (colormap == 0) && (format & PNG_FORMAT_FLAG_ALPHA) != 0; | ||||
|    int write_16bit = (linear != 0 ) && (colormap == 0) && | ||||
|        (display->convert_to_8bit == 0); | ||||
| 
 | ||||
| #  ifdef PNG_BENIGN_ERRORS_SUPPORTED | ||||
|       /* Make sure we error out on any bad situation */ | ||||
| @ -2209,7 +2211,7 @@ png_image_write_main(png_voidp argument) | ||||
| #  ifdef PNG_SIMPLIFIED_WRITE_BGR_SUPPORTED | ||||
|       if (format & PNG_FORMAT_FLAG_BGR) | ||||
|       { | ||||
|          if (!colormap && (format & PNG_FORMAT_FLAG_COLOR) != 0) | ||||
|          if (colormap == 0 && (format & PNG_FORMAT_FLAG_COLOR) != 0) | ||||
|             png_set_bgr(png_ptr); | ||||
|          format &= ~PNG_FORMAT_FLAG_BGR; | ||||
|       } | ||||
| @ -2218,7 +2220,7 @@ png_image_write_main(png_voidp argument) | ||||
| #  ifdef PNG_SIMPLIFIED_WRITE_AFIRST_SUPPORTED | ||||
|       if (format & PNG_FORMAT_FLAG_AFIRST) | ||||
|       { | ||||
|          if (!colormap && (format & PNG_FORMAT_FLAG_ALPHA) != 0) | ||||
|          if (colormap == 0 && (format & PNG_FORMAT_FLAG_ALPHA) != 0) | ||||
|             png_set_swap_alpha(png_ptr); | ||||
|          format &= ~PNG_FORMAT_FLAG_AFIRST; | ||||
|       } | ||||
| @ -2265,7 +2267,8 @@ png_image_write_main(png_voidp argument) | ||||
|     * before it is written.  This only applies when the input is 16-bit and | ||||
|     * either there is an alpha channel or it is converted to 8-bit. | ||||
|     */ | ||||
|    if ((linear && alpha) || (!colormap && display->convert_to_8bit)) | ||||
|    if ((linear != 0 && alpha != 0 ) || | ||||
|        (colormap == 0 && display->convert_to_8bit != 0)) | ||||
|    { | ||||
|       png_bytep row = png_voidcast(png_bytep, png_malloc(png_ptr, | ||||
|          png_get_rowbytes(png_ptr, info_ptr))); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Glenn Randers-Pehrson
						Glenn Randers-Pehrson