summaryrefslogtreecommitdiff
path: root/unpack.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-12-25 15:12:20 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-12-25 16:13:10 -0800
commitd8425fccd3c0452491faa32aa46efb2d31469e2d (patch)
treedf86f642eda5e7f075df764a0e6d0f35cf8eb11a /unpack.c
parent96cd660ad06675e811505229c029004efe9a3a8f (diff)
downloadgzip-d8425fccd3c0452491faa32aa46efb2d31469e2d.tar.gz
gzip: local → static
* gzip.h (local): Remove. All uses replaced by ‘static’. Previously, the source code was inconsistent about using ‘local’ vs ‘static’ even before the recent changes, and ‘local’ was more trouble than it was worth.
Diffstat (limited to 'unpack.c')
-rw-r--r--unpack.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/unpack.c b/unpack.c
index 2a87457..39ca75d 100644
--- a/unpack.c
+++ b/unpack.c
@@ -38,26 +38,26 @@
* Huffman tree.
*/
-local ulg orig_len; /* original uncompressed length */
-local int max_len; /* maximum bit length of Huffman codes */
+static ulg orig_len; /* original uncompressed length */
+static int max_len; /* maximum bit length of Huffman codes */
-local uch literal[LITERALS];
+static uch literal[LITERALS];
/* The literal bytes present in the Huffman tree. The EOB code is not
* represented.
*/
-local int lit_base[MAX_BITLEN+1];
+static int lit_base[MAX_BITLEN+1];
/* All literals of a given bit length are contiguous in literal[] and
* have contiguous codes. literal[code+lit_base[len]] is the literal
* for a code of len bits.
*/
-local int leaves [MAX_BITLEN+1]; /* Number of leaves for each bit length */
-local int parents[MAX_BITLEN+1]; /* Number of parents for each bit length */
+static int leaves [MAX_BITLEN+1]; /* Number of leaves for each bit length */
+static int parents[MAX_BITLEN+1]; /* Number of parents for each bit length */
-local int peek_bits; /* Number of peek bits currently used */
+static int peek_bits; /* Number of peek bits currently used */
-/* local uch prefix_len[1 << MAX_PEEK]; */
+/* static uch prefix_len[1 << MAX_PEEK]; */
#define prefix_len outbuf
/* For each bit pattern b of peek_bits bits, prefix_len[b] is the length
* of the Huffman code starting with a prefix of b (upper bits), or 0
@@ -70,10 +70,10 @@ local int peek_bits; /* Number of peek bits currently used */
error cannot overlay prefix_len and outbuf
#endif
-local ulg bitbuf;
+static ulg bitbuf;
/* Bits are added on the low part of bitbuf and read from the high part. */
-local int valid; /* number of valid bits in bitbuf */
+static int valid; /* number of valid bits in bitbuf */
/* all bits above the last valid bit are always zero */
/* Read an input byte, reporting an error at EOF. */
@@ -104,13 +104,14 @@ read_byte ()
/* Local functions */
-local void read_tree (void);
-local void build_tree (void);
+static void read_tree (void);
+static void build_tree (void);
/* ===========================================================================
* Read the Huffman tree.
*/
-local void read_tree()
+static void
+read_tree ()
{
int len; /* bit length */
int base; /* base offset for a sequence of leaves */
@@ -167,7 +168,8 @@ local void read_tree()
/* ===========================================================================
* Build the Huffman tree and the prefix table.
*/
-local void build_tree()
+static void
+build_tree ()
{
int nodes = 0; /* number of nodes (parents+leaves) at current bit length */
int len; /* current bit length */