| OLD | NEW |
| 1 | 1 |
| 2 /* pngerror.c - stub functions for i/o and memory allocation | 2 /* pngerror.c - stub functions for i/o and memory allocation |
| 3 * | 3 * |
| 4 * Last changed in libpng 1.2.45 [July 7, 2011] | 4 * Last changed in libpng 1.2.51 [February 6, 2014] |
| 5 * Copyright (c) 1998-2011 Glenn Randers-Pehrson | 5 * Copyright (c) 1998-2014 Glenn Randers-Pehrson |
| 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) | 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) |
| 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) | 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) |
| 8 * | 8 * |
| 9 * This code is released under the libpng license. | 9 * This code is released under the libpng license. |
| 10 * For conditions of distribution and use, see the disclaimer | 10 * For conditions of distribution and use, see the disclaimer |
| 11 * and license in png.h | 11 * and license in png.h |
| 12 * | 12 * |
| 13 * This file provides a location for all error handling. Users who | 13 * This file provides a location for all error handling. Users who |
| 14 * need special error handling are expected to write replacement functions | 14 * need special error handling are expected to write replacement functions |
| 15 * and use png_set_error_fn() to use those functions. See the instructions | 15 * and use png_set_error_fn() to use those functions. See the instructions |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 longjmp(jmpbuf,1); | 293 longjmp(jmpbuf,1); |
| 294 } | 294 } |
| 295 # else | 295 # else |
| 296 longjmp(png_ptr->jmpbuf, 1); | 296 longjmp(png_ptr->jmpbuf, 1); |
| 297 # endif | 297 # endif |
| 298 } | 298 } |
| 299 #endif | 299 #endif |
| 300 /* Here if not setjmp support or if png_ptr is null. */ | 300 /* Here if not setjmp support or if png_ptr is null. */ |
| 301 PNG_ABORT(); | 301 PNG_ABORT(); |
| 302 #ifndef PNG_CONSOLE_IO_SUPPORTED | 302 #ifndef PNG_CONSOLE_IO_SUPPORTED |
| 303 error_message = error_message; /* Make compiler happy */ | 303 PNG_UNUSED(error_message) /* Make compiler happy */ |
| 304 #endif | 304 #endif |
| 305 } | 305 } |
| 306 | 306 |
| 307 #ifdef PNG_WARNINGS_SUPPORTED | 307 #ifdef PNG_WARNINGS_SUPPORTED |
| 308 /* This function is called when there is a warning, but the library thinks | 308 /* This function is called when there is a warning, but the library thinks |
| 309 * it can continue anyway. Replacement functions don't have to do anything | 309 * it can continue anyway. Replacement functions don't have to do anything |
| 310 * here if you don't want them to. In the default configuration, png_ptr is | 310 * here if you don't want them to. In the default configuration, png_ptr is |
| 311 * not used, but it is passed in case it may be useful. | 311 * not used, but it is passed in case it may be useful. |
| 312 */ | 312 */ |
| 313 static void /* PRIVATE */ | 313 static void /* PRIVATE */ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 339 fprintf(stderr, PNG_STRING_NEWLINE); | 339 fprintf(stderr, PNG_STRING_NEWLINE); |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 else | 342 else |
| 343 # endif | 343 # endif |
| 344 { | 344 { |
| 345 fprintf(stderr, "libpng warning: %s", warning_message); | 345 fprintf(stderr, "libpng warning: %s", warning_message); |
| 346 fprintf(stderr, PNG_STRING_NEWLINE); | 346 fprintf(stderr, PNG_STRING_NEWLINE); |
| 347 } | 347 } |
| 348 #else | 348 #else |
| 349 warning_message = warning_message; /* Make compiler happy */ | 349 PNG_UNUSED(warning_message) /* Make compiler happy */ |
| 350 #endif | 350 #endif |
| 351 png_ptr = png_ptr; /* Make compiler happy */ | 351 PNG_UNUSED(png_ptr) /* Make compiler happy */ |
| 352 } | 352 } |
| 353 #endif /* PNG_WARNINGS_SUPPORTED */ | 353 #endif /* PNG_WARNINGS_SUPPORTED */ |
| 354 | 354 |
| 355 /* This function is called when the application wants to use another method | 355 /* This function is called when the application wants to use another method |
| 356 * of handling errors and warnings. Note that the error function MUST NOT | 356 * of handling errors and warnings. Note that the error function MUST NOT |
| 357 * return to the calling routine or serious problems will occur. The return | 357 * return to the calling routine or serious problems will occur. The return |
| 358 * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) | 358 * method used in the default routine calls longjmp(png_ptr->jmpbuf, 1) |
| 359 */ | 359 */ |
| 360 void PNGAPI | 360 void PNGAPI |
| 361 png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, | 361 png_set_error_fn(png_structp png_ptr, png_voidp error_ptr, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 387 png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) | 387 png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) |
| 388 { | 388 { |
| 389 if (png_ptr != NULL) | 389 if (png_ptr != NULL) |
| 390 { | 390 { |
| 391 png_ptr->flags &= | 391 png_ptr->flags &= |
| 392 ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); | 392 ((~(PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT))&strip_mode); |
| 393 } | 393 } |
| 394 } | 394 } |
| 395 #endif | 395 #endif |
| 396 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ | 396 #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ |
| OLD | NEW |