Changeset 561 for trunk/src/3rdparty/libpng/pngerror.c
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
src/3rdparty/libpng/pngerror.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/3rdparty/libpng/pngerror.c
r2 r561 2 2 /* pngerror.c - stub functions for i/o and memory allocation 3 3 * 4 * Last changed in libpng 1.2.22 [October 13, 2007] 5 * For conditions of distribution and use, see copyright notice in png.h 6 * Copyright (c) 1998-2007 Glenn Randers-Pehrson 4 * Last changed in libpng 1.2.37 [June 4, 2009] 5 * Copyright (c) 1998-2009 Glenn Randers-Pehrson 7 6 * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) 8 7 * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) 8 * 9 * This code is released under the libpng license. 10 * For conditions of distribution and use, see the disclaimer 11 * and license in png.h 9 12 * 10 13 * This file provides a location for all error handling. Users who … … 16 19 #define PNG_INTERNAL 17 20 #include "png.h" 18 19 21 #if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) 22 20 23 static void /* PRIVATE */ 21 24 png_default_error PNGARG((png_structp png_ptr, … … 45 48 if (*error_message == '#') 46 49 { 50 /* Strip "#nnnn " from beginning of error message. */ 47 51 int offset; 48 for (offset =1; offset<15; offset++)49 if ( *(error_message+offset)== ' ')52 for (offset = 1; offset<15; offset++) 53 if (error_message[offset] == ' ') 50 54 break; 51 55 if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) 52 56 { 53 57 int i; 54 for (i =0; i<offset-1; i++)55 msg[i] =error_message[i+1];56 msg[i ]='\0';57 error_message =msg;58 for (i = 0; i < offset - 1; i++) 59 msg[i] = error_message[i + 1]; 60 msg[i - 1] = '\0'; 61 error_message = msg; 58 62 } 59 63 else 60 error_message +=offset;64 error_message += offset; 61 65 } 62 66 else … … 64 68 if (png_ptr->flags&PNG_FLAG_STRIP_ERROR_TEXT) 65 69 { 66 msg[0] ='0';67 msg[1] ='\0';68 error_message =msg;70 msg[0] = '0'; 71 msg[1] = '\0'; 72 error_message = msg; 69 73 } 70 74 } … … 111 115 if (*warning_message == '#') 112 116 { 113 for (offset =1; offset<15; offset++)114 if ( *(warning_message+offset)== ' ')117 for (offset = 1; offset < 15; offset++) 118 if (warning_message[offset] == ' ') 115 119 break; 116 120 } 117 121 } 118 if (png_ptr != NULL && png_ptr->warning_fn != NULL)119 (*(png_ptr->warning_fn))(png_ptr, warning_message+offset);120 }121 else 122 png_default_warning(png_ptr, warning_message +offset);122 } 123 if (png_ptr != NULL && png_ptr->warning_fn != NULL) 124 (*(png_ptr->warning_fn))(png_ptr, warning_message + offset); 125 else 126 png_default_warning(png_ptr, warning_message + offset); 123 127 } 124 128 #endif /* PNG_NO_WARNINGS */ … … 168 172 buffer[iout++] = ':'; 169 173 buffer[iout++] = ' '; 170 png_memcpy(buffer +iout, error_message, PNG_MAX_ERROR_TEXT);171 buffer[iout +PNG_MAX_ERROR_TEXT-1] = '\0';174 png_memcpy(buffer + iout, error_message, PNG_MAX_ERROR_TEXT); 175 buffer[iout + PNG_MAX_ERROR_TEXT - 1] = '\0'; 172 176 } 173 177 } … … 217 221 if (*error_message == '#') 218 222 { 223 /* Strip "#nnnn " from beginning of error message. */ 219 224 int offset; 220 225 char error_number[16]; 221 for (offset =0; offset<15; offset++)222 { 223 error_number[offset] = *(error_message+offset+1);224 if ( *(error_message+offset)== ' ')226 for (offset = 0; offset<15; offset++) 227 { 228 error_number[offset] = error_message[offset + 1]; 229 if (error_message[offset] == ' ') 225 230 break; 226 231 } 227 if((offset > 1) && (offset < 15)) 228 { 229 error_number[offset-1]='\0'; 230 fprintf(stderr, "libpng error no. %s: %s\n", error_number, 231 error_message+offset); 232 if ((offset > 1) && (offset < 15)) 233 { 234 error_number[offset - 1] = '\0'; 235 fprintf(stderr, "libpng error no. %s: %s", 236 error_number, error_message + offset + 1); 237 fprintf(stderr, PNG_STRING_NEWLINE); 232 238 } 233 239 else 234 fprintf(stderr, "libpng error: %s, offset=%d\n", error_message,offset); 235 } 236 else 237 #endif 238 fprintf(stderr, "libpng error: %s\n", error_message); 240 { 241 fprintf(stderr, "libpng error: %s, offset=%d", 242 error_message, offset); 243 fprintf(stderr, PNG_STRING_NEWLINE); 244 } 245 } 246 else 247 #endif 248 { 249 fprintf(stderr, "libpng error: %s", error_message); 250 fprintf(stderr, PNG_STRING_NEWLINE); 251 } 239 252 #endif 240 253 … … 256 269 #endif 257 270 #ifdef PNG_NO_CONSOLE_IO 258 error_message = error_message; /* make compiler happy */271 error_message = error_message; /* Make compiler happy */ 259 272 #endif 260 273 } … … 275 288 int offset; 276 289 char warning_number[16]; 277 for (offset =0; offset<15; offset++)278 { 279 warning_number[offset] =*(warning_message+offset+1);280 if ( *(warning_message+offset)== ' ')290 for (offset = 0; offset < 15; offset++) 291 { 292 warning_number[offset] = warning_message[offset + 1]; 293 if (warning_message[offset] == ' ') 281 294 break; 282 295 } 283 if((offset > 1) && (offset < 15)) 284 { 285 warning_number[offset-1]='\0'; 286 fprintf(stderr, "libpng warning no. %s: %s\n", warning_number, 287 warning_message+offset); 296 if ((offset > 1) && (offset < 15)) 297 { 298 warning_number[offset + 1] = '\0'; 299 fprintf(stderr, "libpng warning no. %s: %s", 300 warning_number, warning_message + offset); 301 fprintf(stderr, PNG_STRING_NEWLINE); 288 302 } 289 303 else 290 fprintf(stderr, "libpng warning: %s\n", warning_message); 304 { 305 fprintf(stderr, "libpng warning: %s", 306 warning_message); 307 fprintf(stderr, PNG_STRING_NEWLINE); 308 } 291 309 } 292 310 else 293 311 # endif 294 fprintf(stderr, "libpng warning: %s\n", warning_message); 312 { 313 fprintf(stderr, "libpng warning: %s", warning_message); 314 fprintf(stderr, PNG_STRING_NEWLINE); 315 } 295 316 #else 296 warning_message = warning_message; /* make compiler happy */297 #endif 298 png_ptr = png_ptr; /* make compiler happy */317 warning_message = warning_message; /* Make compiler happy */ 318 #endif 319 png_ptr = png_ptr; /* Make compiler happy */ 299 320 } 300 321 #endif /* PNG_NO_WARNINGS */ … … 334 355 png_set_strip_error_numbers(png_structp png_ptr, png_uint_32 strip_mode) 335 356 { 336 if (png_ptr != NULL)357 if (png_ptr != NULL) 337 358 { 338 359 png_ptr->flags &=
Note:
See TracChangeset
for help on using the changeset viewer.
