summaryrefslogtreecommitdiff
path: root/pngconf.h
diff options
context:
space:
mode:
authorCosmin Truta <ctruta@gmail.com>2018-06-17 22:37:44 -0400
committerCosmin Truta <ctruta@gmail.com>2018-06-17 22:37:44 -0400
commita74aa9a0028a8e746ec5646a3d3ee1c659f0af8a (patch)
treebd6c99d54c5e07c8c40448598210e2f8218ef13e /pngconf.h
parent916117d97058b37e7eef2558a71919a8a073a3d3 (diff)
downloadlibpng-a74aa9a0028a8e746ec5646a3d3ee1c659f0af8a.tar.gz
[libpng16] Replace the remaining uses of png_size_t with size_t
In v1.6.0, size_t became a required type. It should be used consistently. To maintain backwards compatibility, png_size_t is still maintained in deprecated form.
Diffstat (limited to 'pngconf.h')
-rw-r--r--pngconf.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/pngconf.h b/pngconf.h
index 7ef2c6bda..40bc99ae9 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -515,8 +515,10 @@
# error "libpng requires an unsigned 32-bit (or more) type"
#endif
-/* Prior to 1.6.0 it was possible to disable the use of size_t, 1.6.0, however,
- * requires an ISOC90 compiler and relies on consistent behavior of sizeof.
+/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
+ * From 1.6.0 onwards, an ISO C90 compiler, as well as a standard-compliant
+ * behavior of sizeof and ptrdiff_t are required.
+ * The legacy typedefs are provided here for backwards compatibility.
*/
typedef size_t png_size_t;
typedef ptrdiff_t png_ptrdiff_t;
@@ -537,13 +539,12 @@ typedef ptrdiff_t png_ptrdiff_t;
# endif
#endif
-/* png_alloc_size_t is guaranteed to be no smaller than png_size_t, and no
- * smaller than png_uint_32. Casts from png_size_t or png_uint_32 to
- * png_alloc_size_t are not necessary; in fact, it is recommended not to use
- * them at all so that the compiler can complain when something turns out to be
- * problematic.
+/* png_alloc_size_t is guaranteed to be no smaller than size_t, and no smaller
+ * than png_uint_32. Casts from size_t or png_uint_32 to png_alloc_size_t are
+ * not necessary; in fact, it is recommended not to use them at all, so that
+ * the compiler can complain when something turns out to be problematic.
*
- * Casts in the other direction (from png_alloc_size_t to png_size_t or
+ * Casts in the other direction (from png_alloc_size_t to size_t or
* png_uint_32) should be explicitly applied; however, we do not expect to
* encounter practical situations that require such conversions.
*
@@ -553,7 +554,7 @@ typedef ptrdiff_t png_ptrdiff_t;
#ifdef PNG_SMALL_SIZE_T
typedef png_uint_32 png_alloc_size_t;
#else
- typedef png_size_t png_alloc_size_t;
+ typedef size_t png_alloc_size_t;
#endif
/* Prior to 1.6.0 libpng offered limited support for Microsoft C compiler
@@ -589,8 +590,8 @@ typedef char * png_charp;
typedef const char * png_const_charp;
typedef png_fixed_point * png_fixed_point_p;
typedef const png_fixed_point * png_const_fixed_point_p;
-typedef png_size_t * png_size_tp;
-typedef const png_size_t * png_const_size_tp;
+typedef size_t * png_size_tp;
+typedef const size_t * png_const_size_tp;
#ifdef PNG_STDIO_SUPPORTED
typedef FILE * png_FILE_p;