aboutsummaryrefslogtreecommitdiff
path: root/adler32.c
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2023-04-14 01:42:03 -0700
committerMark Adler <madler@alumni.caltech.edu>2023-04-15 21:17:31 -0700
commite9d5486e6635141f589e110fd789648aa08e9544 (patch)
treea78b9ccd92b05af7cd5776b688d9c3eb3a81a40a /adler32.c
parent5799c14c8526bf1aaa130c021982f831d155b46d (diff)
downloadzlib-e9d5486e6635141f589e110fd789648aa08e9544.tar.gz
zlib-e9d5486e6635141f589e110fd789648aa08e9544.tar.bz2
zlib-e9d5486e6635141f589e110fd789648aa08e9544.zip
Remove K&R function definitions from zlib.
C2X has removed K&R definitions from the C function syntax. Though the standard has not yet been approved, some high-profile compilers are now issuing warnings when such definitions are encountered.
Diffstat (limited to 'adler32.c')
-rw-r--r--adler32.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/adler32.c b/adler32.c
index d0be438..04b81d2 100644
--- a/adler32.c
+++ b/adler32.c
@@ -7,8 +7,6 @@
7 7
8#include "zutil.h" 8#include "zutil.h"
9 9
10local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
11
12#define BASE 65521U /* largest prime smaller than 65536 */ 10#define BASE 65521U /* largest prime smaller than 65536 */
13#define NMAX 5552 11#define NMAX 5552
14/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ 12/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
@@ -60,11 +58,7 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
60#endif 58#endif
61 59
62/* ========================================================================= */ 60/* ========================================================================= */
63uLong ZEXPORT adler32_z(adler, buf, len) 61uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
64 uLong adler;
65 const Bytef *buf;
66 z_size_t len;
67{
68 unsigned long sum2; 62 unsigned long sum2;
69 unsigned n; 63 unsigned n;
70 64
@@ -131,20 +125,12 @@ uLong ZEXPORT adler32_z(adler, buf, len)
131} 125}
132 126
133/* ========================================================================= */ 127/* ========================================================================= */
134uLong ZEXPORT adler32(adler, buf, len) 128uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
135 uLong adler;
136 const Bytef *buf;
137 uInt len;
138{
139 return adler32_z(adler, buf, len); 129 return adler32_z(adler, buf, len);
140} 130}
141 131
142/* ========================================================================= */ 132/* ========================================================================= */
143local uLong adler32_combine_(adler1, adler2, len2) 133local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
144 uLong adler1;
145 uLong adler2;
146 z_off64_t len2;
147{
148 unsigned long sum1; 134 unsigned long sum1;
149 unsigned long sum2; 135 unsigned long sum2;
150 unsigned rem; 136 unsigned rem;
@@ -169,18 +155,10 @@ local uLong adler32_combine_(adler1, adler2, len2)
169} 155}
170 156
171/* ========================================================================= */ 157/* ========================================================================= */
172uLong ZEXPORT adler32_combine(adler1, adler2, len2) 158uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
173 uLong adler1;
174 uLong adler2;
175 z_off_t len2;
176{
177 return adler32_combine_(adler1, adler2, len2); 159 return adler32_combine_(adler1, adler2, len2);
178} 160}
179 161
180uLong ZEXPORT adler32_combine64(adler1, adler2, len2) 162uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
181 uLong adler1;
182 uLong adler2;
183 z_off64_t len2;
184{
185 return adler32_combine_(adler1, adler2, len2); 163 return adler32_combine_(adler1, adler2, len2);
186} 164}