summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1998-05-30 02:20:55 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1998-05-30 02:20:55 +0000
commit3edf440f3da4a184bf108a4e25258d32b1305b9a (patch)
tree53e6f04e1446624a9f0467d6ccd28a1aacea24fa
parentff59d907975e66d4d2b18d0903f3dfed8a7fdb5d (diff)
more const here and there; so would benefit everyone
-rw-r--r--sys/lib/libz/crc32.c4
-rw-r--r--sys/lib/libz/infblock.c4
-rw-r--r--sys/lib/libz/inftrees.c18
-rw-r--r--sys/lib/libz/infutil.c4
-rw-r--r--sys/lib/libz/infutil.h4
5 files changed, 17 insertions, 17 deletions
diff --git a/sys/lib/libz/crc32.c b/sys/lib/libz/crc32.c
index 88a8cc86dca..fb2be41b985 100644
--- a/sys/lib/libz/crc32.c
+++ b/sys/lib/libz/crc32.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crc32.c,v 1.3 1997/11/07 15:57:46 niklas Exp $ */
+/* $OpenBSD: crc32.c,v 1.4 1998/05/30 02:20:50 mickey Exp $ */
/* crc32.c -- compute the CRC-32 of a data stream
* Copyright (C) 1995-1996 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
@@ -47,7 +47,7 @@ local void make_crc_table()
int n, k;
uLong poly; /* polynomial exclusive-or pattern */
/* terms of polynomial defining this crc (except x^32): */
- static Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
+ static const Byte p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26};
/* make exclusive-or pattern from polynomial (0xedb88320L) */
poly = 0L;
diff --git a/sys/lib/libz/infblock.c b/sys/lib/libz/infblock.c
index b6f1fab48a3..dd93f18f754 100644
--- a/sys/lib/libz/infblock.c
+++ b/sys/lib/libz/infblock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: infblock.c,v 1.3 1997/11/07 15:57:47 niklas Exp $ */
+/* $OpenBSD: infblock.c,v 1.4 1998/05/30 02:20:51 mickey Exp $ */
/* infblock.c -- interpret and process block types to last block
* Copyright (C) 1995-1996 Mark Adler
@@ -14,7 +14,7 @@
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
/* Table for deflate from PKZIP's appnote.txt. */
-local uInt border[] = { /* Order of the bit length code lengths */
+local const uInt border[] = { /* Order of the bit length code lengths */
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15};
/*
diff --git a/sys/lib/libz/inftrees.c b/sys/lib/libz/inftrees.c
index ab872d65fdc..02ddb678223 100644
--- a/sys/lib/libz/inftrees.c
+++ b/sys/lib/libz/inftrees.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inftrees.c,v 1.5 1997/11/07 15:57:50 niklas Exp $ */
+/* $OpenBSD: inftrees.c,v 1.6 1998/05/30 02:20:52 mickey Exp $ */
/* inftrees.c -- generate Huffman trees for efficient decoding
* Copyright (C) 1995-1996 Mark Adler
@@ -29,8 +29,8 @@ local int huft_build OF((
uIntf *, /* code lengths in bits */
uInt, /* number of codes */
uInt, /* number of "simple" codes */
- uIntf *, /* list of base values for non-simple codes */
- uIntf *, /* list of extra bits for non-simple codes */
+ const uIntf *, /* list of base values for non-simple codes */
+ const uIntf *, /* list of extra bits for non-simple codes */
inflate_huft * FAR*,/* result: starting table */
uIntf *, /* maximum lookup bits (returns actual) */
z_streamp )); /* for zalloc function */
@@ -41,18 +41,18 @@ local voidpf falloc OF((
uInt)); /* size of item */
/* Tables for deflate from PKZIP's appnote.txt. */
-local uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
+local const uInt cplens[31] = { /* Copy lengths for literal codes 257..285 */
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
/* actually lengths - 2; also see note #13 above about 258 */
-local uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
+local const uInt cplext[31] = { /* Extra bits for literal codes 257..285 */
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 192, 192}; /* 192==invalid */
-local uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
+local const uInt cpdist[30] = { /* Copy offsets for distance codes 0..29 */
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577};
-local uInt cpdext[30] = { /* Extra bits for distance codes */
+local const uInt cpdext[30] = { /* Extra bits for distance codes */
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13};
@@ -102,8 +102,8 @@ local int huft_build(b, n, s, d, e, t, m, zs)
uIntf *b; /* code lengths in bits (all assumed <= BMAX) */
uInt n; /* number of codes (assumed <= N_MAX) */
uInt s; /* number of simple-valued codes (0..s-1) */
-uIntf *d; /* list of base values for non-simple codes */
-uIntf *e; /* list of extra bits for non-simple codes */
+const uIntf *d; /* list of base values for non-simple codes */
+const uIntf *e; /* list of extra bits for non-simple codes */
inflate_huft * FAR *t; /* result: starting table */
uIntf *m; /* maximum lookup bits, returns actual */
z_streamp zs; /* for zalloc function */
diff --git a/sys/lib/libz/infutil.c b/sys/lib/libz/infutil.c
index 67ce0b0a1be..48583a0981f 100644
--- a/sys/lib/libz/infutil.c
+++ b/sys/lib/libz/infutil.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: infutil.c,v 1.2 1997/11/07 15:57:51 niklas Exp $ */
+/* $OpenBSD: infutil.c,v 1.3 1998/05/30 02:20:53 mickey Exp $ */
/* inflate_util.c -- data and routines common to blocks and codes
* Copyright (C) 1995-1996 Mark Adler
@@ -14,7 +14,7 @@
struct inflate_codes_state {int dummy;}; /* for buggy compilers */
/* And'ing with mask[n] masks the lower n bits */
-uInt inflate_mask[17] = {
+const uInt inflate_mask[17] = {
0x0000,
0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
diff --git a/sys/lib/libz/infutil.h b/sys/lib/libz/infutil.h
index 1518e34188f..285c85c8950 100644
--- a/sys/lib/libz/infutil.h
+++ b/sys/lib/libz/infutil.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: infutil.h,v 1.2 1997/11/07 15:57:51 niklas Exp $ */
+/* $OpenBSD: infutil.h,v 1.3 1998/05/30 02:20:54 mickey Exp $ */
/* infutil.h -- types and macros common to blocks and codes
* Copyright (C) 1995-1996 Mark Adler
@@ -88,7 +88,7 @@ struct inflate_blocks_state {
#define LOAD {LOADIN LOADOUT}
/* masks for lower bits (size given to avoid silly warnings with Visual C++) */
-extern uInt inflate_mask[17];
+extern const uInt inflate_mask[17];
/* copy as much as possible from the sliding window to the output area */
extern int inflate_flush OF((