Changeset 846 for trunk/src/3rdparty/libpng/pngerror.c
- Timestamp:
- May 5, 2011, 5:36:53 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/3rdparty/libpng/pngerror.c (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/3rdparty/libpng/pngerror.c
r561 r846 2 2 /* pngerror.c - stub functions for i/o and memory allocation 3 3 * 4 * Last changed in libpng 1. 2.37 [June 4, 2009]5 * Copyright (c) 1998-20 09Glenn Randers-Pehrson4 * Last changed in libpng 1.4.0 [January 3, 2010] 5 * Copyright (c) 1998-2010 Glenn Randers-Pehrson 6 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 7 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) … … 17 17 */ 18 18 19 #define PNG_ INTERNAL19 #define PNG_NO_PEDANTIC_WARNINGS 20 20 #include "png.h" 21 21 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) 22 #include "pngpriv.h" 22 23 23 24 static void /* PRIVATE */ 24 25 png_default_error PNGARG((png_structp png_ptr, 25 png_const_charp error_message)) ;26 #if ndef PNG_NO_WARNINGS26 png_const_charp error_message)) PNG_NORETURN; 27 #ifdef PNG_WARNINGS_SUPPORTED 27 28 static void /* PRIVATE */ 28 29 png_default_warning PNGARG((png_structp png_ptr, 29 30 png_const_charp warning_message)); 30 #endif /* PNG_ NO_WARNINGS*/31 #endif /* PNG_WARNINGS_SUPPORTED */ 31 32 32 33 /* This function is called whenever there is a fatal error. This function … … 35 36 * to replace the error function at run-time. 36 37 */ 37 #if ndef PNG_NO_ERROR_TEXT38 #ifdef PNG_ERROR_TEXT_SUPPORTED 38 39 void PNGAPI 39 40 png_error(png_structp png_ptr, png_const_charp error_message) … … 46 47 (PNG_FLAG_STRIP_ERROR_NUMBERS|PNG_FLAG_STRIP_ERROR_TEXT)) 47 48 { 48 if (*error_message == '#')49 if (*error_message == PNG_LITERAL_SHARP) 49 50 { 50 51 /* Strip "#nnnn " from beginning of error message. */ … … 94 95 png_default_error(png_ptr, '\0'); 95 96 } 96 #endif /* PNG_ NO_ERROR_TEXT*/97 98 #if ndef PNG_NO_WARNINGS97 #endif /* PNG_ERROR_TEXT_SUPPORTED */ 98 99 #ifdef PNG_WARNINGS_SUPPORTED 99 100 /* This function is called whenever there is a non-fatal error. This function 100 101 * should not be changed. If there is a need to handle warnings differently, … … 113 114 #endif 114 115 { 115 if (*warning_message == '#')116 if (*warning_message == PNG_LITERAL_SHARP) 116 117 { 117 118 for (offset = 1; offset < 15; offset++) … … 126 127 png_default_warning(png_ptr, warning_message + offset); 127 128 } 128 #endif /* PNG_NO_WARNINGS */ 129 129 #endif /* PNG_WARNINGS_SUPPORTED */ 130 131 #ifdef PNG_BENIGN_ERRORS_SUPPORTED 132 void PNGAPI 133 png_benign_error(png_structp png_ptr, png_const_charp error_message) 134 { 135 if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) 136 png_warning(png_ptr, error_message); 137 else 138 png_error(png_ptr, error_message); 139 } 140 #endif 130 141 131 142 /* These utilities are used internally to build an error message that relates … … 142 153 143 154 #define PNG_MAX_ERROR_TEXT 64 144 145 #if !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT) 155 #if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED) 146 156 static void /* PRIVATE */ 147 157 png_format_buffer(png_structp png_ptr, png_charp buffer, png_const_charp … … 155 165 if (isnonalpha(c)) 156 166 { 157 buffer[iout++] = '[';167 buffer[iout++] = PNG_LITERAL_LEFT_SQUARE_BRACKET; 158 168 buffer[iout++] = png_digit[(c & 0xf0) >> 4]; 159 169 buffer[iout++] = png_digit[c & 0x0f]; 160 buffer[iout++] = ']';170 buffer[iout++] = PNG_LITERAL_RIGHT_SQUARE_BRACKET; 161 171 } 162 172 else … … 191 201 } 192 202 #endif /* PNG_READ_SUPPORTED */ 193 #endif /* !defined(PNG_NO_WARNINGS) || !defined(PNG_NO_ERROR_TEXT)*/194 195 #if ndef PNG_NO_WARNINGS203 #endif /* PNG_WARNINGS_SUPPORTED || PNG_ERROR_TEXT_SUPPORTED */ 204 205 #ifdef PNG_WARNINGS_SUPPORTED 196 206 void PNGAPI 197 207 png_chunk_warning(png_structp png_ptr, png_const_charp warning_message) … … 206 216 } 207 217 } 208 #endif /* PNG_NO_WARNINGS */ 209 218 #endif /* PNG_WARNINGS_SUPPORTED */ 219 220 #ifdef PNG_READ_SUPPORTED 221 #ifdef PNG_BENIGN_ERRORS_SUPPORTED 222 void PNGAPI 223 png_chunk_benign_error(png_structp png_ptr, png_const_charp error_message) 224 { 225 if (png_ptr->flags & PNG_FLAG_BENIGN_ERRORS_WARN) 226 png_chunk_warning(png_ptr, error_message); 227 else 228 png_chunk_error(png_ptr, error_message); 229 } 230 #endif 231 #endif /* PNG_READ_SUPPORTED */ 232 233 #ifdef PNG_SETJMP_SUPPORTED 234 /* This API only exists if ANSI-C style error handling is used, 235 * otherwise it is necessary for png_default_error to be overridden. 236 */ 237 jmp_buf* PNGAPI 238 png_set_longjmp_fn(png_structp png_ptr, png_longjmp_ptr longjmp_fn, 239 size_t jmp_buf_size) 240 { 241 if (png_ptr == NULL || jmp_buf_size != png_sizeof(jmp_buf)) 242 return NULL; 243 244 png_ptr->longjmp_fn = longjmp_fn; 245 return &png_ptr->jmpbuf; 246 } 247 #endif 210 248 211 249 /* This is the default error handling function. Note that replacements for … … 217 255 png_default_error(png_structp png_ptr, png_const_charp error_message) 218 256 { 219 #if ndef PNG_NO_CONSOLE_IO257 #ifdef PNG_CONSOLE_IO_SUPPORTED 220 258 #ifdef PNG_ERROR_NUMBERS_SUPPORTED 221 if (*error_message == '#')259 if (*error_message == PNG_LITERAL_SHARP) 222 260 { 223 261 /* Strip "#nnnn " from beginning of error message. */ … … 253 291 254 292 #ifdef PNG_SETJMP_SUPPORTED 255 if (png_ptr )293 if (png_ptr && png_ptr->longjmp_fn) 256 294 { 257 295 # ifdef USE_FAR_KEYWORD … … 259 297 jmp_buf jmpbuf; 260 298 png_memcpy(jmpbuf, png_ptr->jmpbuf, png_sizeof(jmp_buf)); 261 longjmp(jmpbuf, 1);299 png_ptr->longjmp_fn(jmpbuf, 1); 262 300 } 263 301 # else 264 longjmp(png_ptr->jmpbuf, 1);302 png_ptr->longjmp_fn(png_ptr->jmpbuf, 1); 265 303 # endif 266 304 } 267 #else 305 #endif 306 /* Here if not setjmp support or if png_ptr is null. */ 268 307 PNG_ABORT(); 269 #endif 270 #ifdef PNG_NO_CONSOLE_IO 308 #ifndef PNG_CONSOLE_IO_SUPPORTED 271 309 error_message = error_message; /* Make compiler happy */ 272 310 #endif 273 311 } 274 312 275 #if ndef PNG_NO_WARNINGS313 #ifdef PNG_WARNINGS_SUPPORTED 276 314 /* This function is called when there is a warning, but the library thinks 277 315 * it can continue anyway. Replacement functions don't have to do anything … … 282 320 png_default_warning(png_structp png_ptr, png_const_charp warning_message) 283 321 { 284 #if ndef PNG_NO_CONSOLE_IO322 #ifdef PNG_CONSOLE_IO_SUPPORTED 285 323 # ifdef PNG_ERROR_NUMBERS_SUPPORTED 286 if (*warning_message == '#')324 if (*warning_message == PNG_LITERAL_SHARP) 287 325 { 288 326 int offset; … … 319 357 png_ptr = png_ptr; /* Make compiler happy */ 320 358 } 321 #endif /* PNG_ NO_WARNINGS*/359 #endif /* PNG_WARNINGS_SUPPORTED */ 322 360 323 361 /* This function is called when the application wants to use another method
Note:
See TracChangeset
for help on using the changeset viewer.
