[devel] Fixed some inconsistent indentation in pngconf.h

and mentioned use of 2-space indentation in macro definitions in
the libpng style guide.
This commit is contained in:
Glenn Randers-Pehrson 2009-09-30 12:28:07 -05:00
parent d237dacd83
commit 6076da8079
4 changed files with 101 additions and 83 deletions

View File

@ -1,5 +1,5 @@
Libpng 1.4.0beta84 - September 25, 2009 Libpng 1.4.0beta84 - September 30, 2009
This is not intended to be a public release. It will be replaced 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. within a few weeks by a public version or by another test version.
@ -566,6 +566,9 @@ version 1.4.0beta82 [September 25, 2009]
version 1.4.0beta83 [September 25, 2009] version 1.4.0beta83 [September 25, 2009]
Revised png_check_IHDR() to eliminate bogus complaint about filter_type. Revised png_check_IHDR() to eliminate bogus complaint about filter_type.
version 1.4.0beta84 [September 30, 2009]
Fixed some inconsistent indentation in pngconf.h
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

View File

@ -2252,6 +2252,9 @@ version 1.4.0beta82 [September 25, 2009]
version 1.4.0beta83 [September 25, 2009] version 1.4.0beta83 [September 25, 2009]
Revised png_check_IHDR() to eliminate bogus complaint about filter_type. Revised png_check_IHDR() to eliminate bogus complaint about filter_type.
version 1.4.0beta84 [September 30, 2009]
Fixed some inconsistent indentation in pngconf.h
version 1.4.0betaN [future] version 1.4.0betaN [future]
Build shared libraries with -lz and sometimes -lm. Build shared libraries with -lz and sometimes -lm.

View File

@ -1,6 +1,6 @@
libpng.txt - A description on how to use and modify libpng libpng.txt - A description on how to use and modify libpng
libpng version 1.4.0beta84 - September 25, 2009 libpng version 1.4.0beta84 - September 30, 2009
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2009 Glenn Randers-Pehrson Copyright (c) 1998-2009 Glenn Randers-Pehrson
@ -11,7 +11,7 @@ libpng.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.4.0beta84 - September 25, 2009 libpng versions 0.97, January 1998, through 1.4.0beta84 - September 30, 2009
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2009 Glenn Randers-Pehrson Copyright (c) 1998-2009 Glenn Randers-Pehrson
@ -1884,7 +1884,6 @@ width, height, bit_depth, and color_type must be the same in each call.
png_set_tRNS(png_ptr, info_ptr, trans_alpha, png_set_tRNS(png_ptr, info_ptr, trans_alpha,
num_trans, trans_color); num_trans, trans_color);
trans - array of transparent entries
trans_alpha - array of alpha (transparency) trans_alpha - array of alpha (transparency)
entries for palette (PNG_INFO_tRNS) entries for palette (PNG_INFO_tRNS)
trans_color - graylevel or color sample values trans_color - graylevel or color sample values
@ -3121,6 +3120,15 @@ We use 3-space indentation, except for continued statements which
are usually indented the same as the first line of the statement are usually indented the same as the first line of the statement
plus four more spaces. plus four more spaces.
For macro definitions we use 2-space indentation, always leaving the "#"
in the first column.
#ifndef PNG_NO_FEATURE
# ifndef PNG_FEATURE_SUPPORTED
# define PNG_FEATURE_SUPPORTED
# endif
#endif
Comments appear with the leading "/*" at the same indentation as Comments appear with the leading "/*" at the same indentation as
the statement that follows the comment: the statement that follows the comment:
@ -3197,7 +3205,7 @@ source.
XIII. Y2K Compliance in libpng XIII. Y2K Compliance in libpng
September 25, 2009 September 30, 2009
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.

160
pngconf.h
View File

@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.4.0beta84 - September 25, 2009 * libpng version 1.4.0beta84 - September 30, 2009
* For conditions of distribution and use, see copyright notice in png.h * For conditions of distribution and use, see copyright notice in png.h
* Copyright (c) 1998-2009 Glenn Randers-Pehrson * Copyright (c) 1998-2009 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -23,16 +23,16 @@
#define PNGCONF_H #define PNGCONF_H
#ifndef PNG_NO_LIMITS_H #ifndef PNG_NO_LIMITS_H
#include <limits.h> # include <limits.h>
#endif #endif
/* Added at libpng-1.2.9 */ /* Added at libpng-1.2.9 */
/* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure" script. */ /* config.h is created by and PNG_CONFIGURE_LIBPNG is set by the "configure" script. */
#ifdef PNG_CONFIGURE_LIBPNG #ifdef PNG_CONFIGURE_LIBPNG
#ifdef HAVE_CONFIG_H # ifdef HAVE_CONFIG_H
#include "config.h" # include "config.h"
#endif # endif
#endif #endif
/* /*
@ -45,7 +45,7 @@
# ifndef PNG_USER_PRIVATEBUILD # ifndef PNG_USER_PRIVATEBUILD
# define PNG_USER_PRIVATEBUILD # define PNG_USER_PRIVATEBUILD
# endif # endif
#include "pngusr.h" # include "pngusr.h"
#endif #endif
/* /*
@ -68,16 +68,16 @@
*/ */
#ifdef __STDC__ #ifdef __STDC__
#ifdef SPECIALBUILD # ifdef SPECIALBUILD
# pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\ # pragma message("PNG_LIBPNG_SPECIALBUILD (and deprecated SPECIALBUILD)\
are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.") are now LIBPNG reserved macros. Use PNG_USER_PRIVATEBUILD instead.")
#endif # endif
#ifdef PRIVATEBUILD # ifdef PRIVATEBUILD
# pragma message("PRIVATEBUILD is deprecated.\ # pragma message("PRIVATEBUILD is deprecated.\
Use PNG_USER_PRIVATEBUILD instead.") Use PNG_USER_PRIVATEBUILD instead.")
# define PNG_USER_PRIVATEBUILD PRIVATEBUILD # define PNG_USER_PRIVATEBUILD PRIVATEBUILD
#endif # endif
#endif /* __STDC__ */ #endif /* __STDC__ */
/* End of material added to libpng-1.2.8 */ /* End of material added to libpng-1.2.8 */
@ -152,7 +152,9 @@
# endif # endif
#endif #endif
/* Added at libpng-1.4.0beta49 for testing (no longer used in libpng) */ /* Added at libpng-1.4.0beta49 for testing (this test is no longer used
in libpng and png_calloc() is always present)
*/
#define PNG_CALLOC_SUPPORTED #define PNG_CALLOC_SUPPORTED
/* If you are running on a machine where you cannot allocate more /* If you are running on a machine where you cannot allocate more
@ -568,7 +570,7 @@
#ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_SUPPORTED
/* PNG_WRITE_TRANSFORMS_NOT_SUPPORTED is deprecated. */ /* PNG_WRITE_TRANSFORMS_NOT_SUPPORTED is deprecated. */
# if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \ #if !defined(PNG_WRITE_TRANSFORMS_NOT_SUPPORTED) && \
!defined(PNG_NO_WRITE_TRANSFORMS) !defined(PNG_NO_WRITE_TRANSFORMS)
# define PNG_WRITE_TRANSFORMS_SUPPORTED # define PNG_WRITE_TRANSFORMS_SUPPORTED
#endif #endif
@ -608,9 +610,10 @@
#if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \ #if !defined(PNG_NO_WRITE_INTERLACING_SUPPORTED) && \
!defined(PNG_WRITE_INTERLACING_SUPPORTED) !defined(PNG_WRITE_INTERLACING_SUPPORTED)
#define PNG_WRITE_INTERLACING_SUPPORTED /* not required for PNG-compliant /* This is not required for PNG-compliant encoders, but can cause
encoders, but can cause trouble * trouble if left undefined
if left undefined */ */
# define PNG_WRITE_INTERLACING_SUPPORTED
#endif #endif
#if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \ #if !defined(PNG_NO_WRITE_WEIGHTED_FILTER) && \
@ -665,15 +668,16 @@
# define PNG_EASY_ACCESS_SUPPORTED # define PNG_EASY_ACCESS_SUPPORTED
#endif #endif
/* Added at libpng-1.2.0 */
#if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED) #if !defined(PNG_NO_USER_MEM) && !defined(PNG_USER_MEM_SUPPORTED)
# define PNG_USER_MEM_SUPPORTED # define PNG_USER_MEM_SUPPORTED
#endif #endif
/* Added at libpng-1.2.6 */ /* Added at libpng-1.2.6 */
#ifndef PNG_SET_USER_LIMITS_SUPPORTED #ifndef PNG_SET_USER_LIMITS_SUPPORTED
#if !defined(PNG_NO_SET_USER_LIMITS) && !defined(PNG_SET_USER_LIMITS_SUPPORTED) # ifndef PNG_NO_SET_USER_LIMITS
# define PNG_SET_USER_LIMITS_SUPPORTED # define PNG_SET_USER_LIMITS_SUPPORTED
#endif # endif
#endif #endif
/* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter /* Added at libpng-1.0.16 and 1.2.6. To accept all valid PNGs no matter
@ -1028,7 +1032,7 @@
# define PNG_INFO_IMAGE_SUPPORTED # define PNG_INFO_IMAGE_SUPPORTED
#endif #endif
/* need the time information for reading tIME chunks */ /* Need the time information for reading tIME chunks */
#ifdef PNG_tIME_SUPPORTED #ifdef PNG_tIME_SUPPORTED
# ifndef _WIN32_WCE # ifndef _WIN32_WCE
/* "time.h" functions are not supported on WindowsCE */ /* "time.h" functions are not supported on WindowsCE */
@ -1072,7 +1076,8 @@ typedef unsigned char png_byte;
*/ */
/* Separate compiler dependencies (problem here is that zlib.h always /* Separate compiler dependencies (problem here is that zlib.h always
defines FAR. (SJT) */ * defines FAR. (SJT)
*/
#ifdef __BORLANDC__ #ifdef __BORLANDC__
# if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__) # if defined(__LARGE__) || defined(__HUGE__) || defined(__COMPACT__)
# define LDATA 1 # define LDATA 1
@ -1137,11 +1142,11 @@ typedef char FAR * png_charp;
typedef png_fixed_point FAR * png_fixed_point_p; typedef png_fixed_point FAR * png_fixed_point_p;
#ifndef PNG_NO_STDIO #ifndef PNG_NO_STDIO
#ifdef _WIN32_WCE # ifdef _WIN32_WCE
typedef HANDLE png_FILE_p; typedef HANDLE png_FILE_p;
#else # else
typedef FILE * png_FILE_p; typedef FILE * png_FILE_p;
#endif # endif
#endif #endif
#ifdef PNG_FLOATING_POINT_SUPPORTED #ifdef PNG_FLOATING_POINT_SUPPORTED
@ -1164,8 +1169,7 @@ typedef double FAR * FAR * png_doublepp;
/* Pointers to pointers to pointers; i.e., pointer to array */ /* Pointers to pointers to pointers; i.e., pointer to array */
typedef char FAR * FAR * FAR * png_charppp; typedef char FAR * FAR * FAR * png_charppp;
/* /* Define PNG_BUILD_DLL if the module being built is a Windows
* Define PNG_BUILD_DLL if the module being built is a Windows
* LIBPNG DLL. * LIBPNG DLL.
* *
* Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL. * Define PNG_USE_DLL if you want to *link* to the Windows LIBPNG DLL.
@ -1231,41 +1235,40 @@ typedef char FAR * FAR * FAR * png_charppp;
# ifndef PNG_IMPEXP # ifndef PNG_IMPEXP
# define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol # define PNG_EXPORT_TYPE1(type,symbol) PNG_IMPEXP type PNGAPI symbol
# define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol # define PNG_EXPORT_TYPE2(type,symbol) type PNG_IMPEXP PNGAPI symbol
/* Borland/Microsoft */ /* Borland/Microsoft */
# if defined(_MSC_VER) || defined(__BORLANDC__) # if defined(_MSC_VER) || defined(__BORLANDC__)
# if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500) # if (_MSC_VER >= 800) || (__BORLANDC__ >= 0x500)
# define PNG_EXPORT PNG_EXPORT_TYPE1 # define PNG_EXPORT PNG_EXPORT_TYPE1
# else # else
# define PNG_EXPORT PNG_EXPORT_TYPE2 # define PNG_EXPORT PNG_EXPORT_TYPE2
# ifdef PNG_BUILD_DLL # ifdef PNG_BUILD_DLL
# define PNG_IMPEXP __export # define PNG_IMPEXP __export
# else # else
# define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in # define PNG_IMPEXP /*__import */ /* doesn't exist AFAIK in VC++ */
VC++ */ # endif /* Exists in Borland C++ for
# endif /* Exists in Borland C++ for C++ classes (== huge) */
C++ classes (== huge) */ # endif
# endif # endif
# endif
# ifndef PNG_IMPEXP # ifndef PNG_IMPEXP
# ifdef PNG_BUILD_DLL # ifdef PNG_BUILD_DLL
# define PNG_IMPEXP __declspec(dllexport) # define PNG_IMPEXP __declspec(dllexport)
# else # else
# define PNG_IMPEXP __declspec(dllimport) # define PNG_IMPEXP __declspec(dllimport)
# endif # endif
# endif # endif
# endif /* PNG_IMPEXP */ # endif /* PNG_IMPEXP */
#else /* !(DLL || non-cygwin WINDOWS) */ #else /* !(DLL || non-cygwin WINDOWS) */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__) # if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
# ifndef PNGAPI # ifndef PNGAPI
# define PNGAPI _System # define PNGAPI _System
# endif # endif
# else # else
# if 0 /* ... other platforms, with other meanings */ # if 0 /* ... other platforms, with other meanings */
# endif # endif
# endif # endif
#endif #endif
@ -1340,27 +1343,28 @@ typedef char FAR * FAR * FAR * png_charppp;
# define png_memcpy memcpy # define png_memcpy memcpy
# define png_memset memset # define png_memset memset
# define png_sprintf sprintf # define png_sprintf sprintf
# ifndef PNG_NO_SNPRINTF # ifndef PNG_NO_SNPRINTF
# ifdef _MSC_VER # ifdef _MSC_VER
# define png_snprintf _snprintf /* Added to v 1.2.19 */ # define png_snprintf _snprintf /* Added to v 1.2.19 */
# define png_snprintf2 _snprintf # define png_snprintf2 _snprintf
# define png_snprintf6 _snprintf # define png_snprintf6 _snprintf
# else
# define png_snprintf snprintf /* Added to v 1.2.19 */
# define png_snprintf2 snprintf
# define png_snprintf6 snprintf
# endif
# else # else
# define png_snprintf snprintf /* Added to v 1.2.19 */ /* You don't have or don't want to use snprintf(). Caution: Using
# define png_snprintf2 snprintf * sprintf instead of snprintf exposes your application to accidental
# define png_snprintf6 snprintf * or malevolent buffer overflows. If you don't have snprintf()
* as a general rule you should provide one (you can get one from
* Portable OpenSSH).
*/
# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
# endif # endif
# else
/* You don't have or don't want to use snprintf(). Caution: Using
* sprintf instead of snprintf exposes your application to accidental
* or malevolent buffer overflows. If you don't have snprintf()
* as a general rule you should provide one (you can get one from
* Portable OpenSSH). */
# define png_snprintf(s1,n,fmt,x1) sprintf(s1,fmt,x1)
# define png_snprintf2(s1,n,fmt,x1,x2) sprintf(s1,fmt,x1,x2)
# define png_snprintf6(s1,n,fmt,x1,x2,x3,x4,x5,x6) \
sprintf(s1,fmt,x1,x2,x3,x4,x5,x6)
# endif
# endif # endif
#endif #endif