Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/3rdparty/libpng/example.c

    r561 r846  
    33
    44/* example.c - an example of using libpng
    5  * Last changed in libpng 1.2.37 [June 4, 2009]
     5 * Last changed in libpng 1.4.0 [January 3, 2010]
    66 * This file has been placed in the public domain by the authors.
    7  * Maintained 1998-2009 Glenn Randers-Pehrson
     7 * Maintained 1998-2010 Glenn Randers-Pehrson
    88 * Maintained 1996, 1997 Andreas Dilger)
    99 * Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
     
    122122   {
    123123      fclose(fp);
    124       png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
     124      png_destroy_read_struct(&png_ptr, NULL, NULL);
    125125      return (ERROR);
    126126   }
     
    134134   {
    135135      /* Free all of the memory associated with the png_ptr and info_ptr */
    136       png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
     136      png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
    137137      fclose(fp);
    138138      /* If we get here, we had a problem reading the file */
     
    165165    * pixels) into the info structure with this call:
    166166    */
    167    png_read_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL);
     167   png_read_png(png_ptr, info_ptr, png_transforms, NULL);
    168168
    169169#else
     
    176176
    177177   png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
    178        &interlace_type, int_p_NULL, int_p_NULL);
     178       &interlace_type, NULL, NULL);
    179179
    180180   /* Set up the data transformations you want.  Note that these are all
     
    287287
    288288         png_set_dither(png_ptr, std_color_cube, MAX_SCREEN_COLORS,
    289             MAX_SCREEN_COLORS, png_uint_16p_NULL, 0);
     289            MAX_SCREEN_COLORS, NULL, 0);
    290290      }
    291291      /* This reduces the image to the palette supplied in the file */
     
    366366      for (y = 0; y < height; y++)
    367367      {
    368          png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL, 1);
     368         png_read_rows(png_ptr, &row_pointers[y], NULL, 1);
    369369      }
    370370
     
    373373      {
    374374#ifdef sparkle /* Read the image using the "sparkle" effect. */
    375          png_read_rows(png_ptr, &row_pointers[y], png_bytepp_NULL,
     375         png_read_rows(png_ptr, &row_pointers[y], NULL,
    376376            number_of_rows);
    377377#else no_sparkle /* Read the image using the "rectangle" effect */
    378          png_read_rows(png_ptr, png_bytepp_NULL, &row_pointers[y],
     378         png_read_rows(png_ptr, NULL, &row_pointers[y],
    379379            number_of_rows);
    380380#endif no_sparkle /* Use only one of these two methods */
     
    393393
    394394   /* Clean up after the read, and free any memory allocated - REQUIRED */
    395    png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
     395   png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
    396396
    397397   /* Close the file */
     
    426426   if (*info_ptr == NULL)
    427427   {
    428       png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
     428      png_destroy_read_struct(png_ptr, info_ptr, NULL);
    429429      return (ERROR);
    430430   }
     
    432432   if (setjmp(png_jmpbuf((*png_ptr))))
    433433   {
    434       png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
     434      png_destroy_read_struct(png_ptr, info_ptr, NULL);
    435435      return (ERROR);
    436436   }
     
    461461   {
    462462      /* Free the png_ptr and info_ptr memory on error */
    463       png_destroy_read_struct(png_ptr, info_ptr, png_infopp_NULL);
     463      png_destroy_read_struct(png_ptr, info_ptr, NULL);
    464464      return (ERROR);
    465465   }
     
    594594   {
    595595      fclose(fp);
    596       png_destroy_write_struct(&png_ptr,  png_infopp_NULL);
     596      png_destroy_write_struct(&png_ptr,  NULL);
    597597      return (ERROR);
    598598   }
     
    629629    * PNG_TRANSFORM flags into the png_transforms integer here.
    630630    */
    631    png_write_png(png_ptr, info_ptr, png_transforms, png_voidp_NULL);
     631   png_write_png(png_ptr, info_ptr, png_transforms, NULL);
    632632
    633633#else
Note: See TracChangeset for help on using the changeset viewer.