OSDN Git Service

variable types should be more strict.
authorKoji Arai <jca02266@gmail.com>
Tue, 1 Jul 2008 15:12:53 +0000 (00:12 +0900)
committerKoji Arai <jca02266@gmail.com>
Tue, 1 Jul 2008 15:12:53 +0000 (00:12 +0900)
12 files changed:
add.c
ar.c
ar.h
decode.c
encode.c
extract.c
header.c
huf.c
io.c
list.c
maketbl.c
prototypes.h

diff --git a/add.c b/add.c
index ef77eff..0cfcda1 100644 (file)
--- a/add.c
+++ b/add.c
@@ -3,12 +3,12 @@
 #include <sys/stat.h>
 #include "ar.h"
 
-static unsigned long
-store(FILE *rfp, FILE *wfp, unsigned int *crc)
+static off_t
+store(FILE *rfp, FILE *wfp, uint16_t *crc)
 {
-    uint n;
+    size_t n;
     char buf[MAXDICSIZ];
-    unsigned long sz = 0;
+    off_t sz = 0;
 
     *crc = INIT_CRC;
     while ((n = fread(buf, 1, sizeof(buf), rfp)) != 0) {
@@ -41,7 +41,7 @@ static int
 add_1(struct lzh_ostream *wp, int replace_flag, struct lzh_header *h)
 {
     long headerpos, arcpos, arcendpos;
-    uint r;
+    unsigned int r;
     FILE *rfp;
 
     if ((rfp = fopen(h->filename, "rb")) == NULL) {
diff --git a/ar.c b/ar.c
index ad23dd6..c89b148 100644 (file)
--- a/ar.c
+++ b/ar.c
@@ -99,23 +99,23 @@ print_version()
     exit(0);
 }
 
-uint
-ratio(ulong a, ulong b)
+unsigned int
+ratio(off_t a, off_t b)
 {                               /* [(1000a + [b/2]) / b] */
     int i;
 
     for (i = 0; i < 3; i++)
-        if (a <= ULONG_MAX / 10)
+        if (a <= ULONG_MAX / 10) /* XXX: should use max of off_t instead of ULONG_MAX */
             a *= 10;
         else
             b /= 10;
-    if ((ulong) (a + (b >> 1)) < a) {
+    if ((a + (b >> 1)) < a) {
         a >>= 1;
         b >>= 1;
     }
     if (b == 0)
         return 0;
-    return (uint) ((a + (b >> 1)) / b);
+    return (unsigned int) ((a + (b >> 1)) / b);
 }
 
 void
@@ -133,15 +133,15 @@ static void
 copy(FILE *arcfile, FILE *outfile, struct lzh_header *h)
 {
     char buf[BUFSIZ];
-    unsigned long remainder = h->compsize;
+    off_t remainder = h->compsize;
 
     write_header(outfile, h);
     while (remainder != 0) {
-        uint n = (uint) MIN(remainder, sizeof(buf));
+        size_t n = (size_t) MIN(remainder, sizeof(buf));
 
-        if (fread((char *) buf, 1, n, arcfile) != n)
+        if (fread(buf, 1, n, arcfile) != n)
             error("Can't read");
-        if (fwrite((char *) buf, 1, n, outfile) != n)
+        if (fwrite(buf, 1, n, outfile) != n)
             error("Can't write");
         remainder -= n;
     }
diff --git a/ar.h b/ar.h
index 647303f..c365c5c 100644 (file)
--- a/ar.h
+++ b/ar.h
 #endif
 #define TBIT 5                  /* smallest integer such that (1U << TBIT) > NT */
 
-typedef unsigned char uchar;    /*  8 bits or more */
-typedef unsigned int uint;      /* 16 bits or more */
-typedef unsigned short ushort;  /* 16 bits or more */
-typedef unsigned long ulong;    /* 32 bits or more */
-
 struct lzh_istream {
     FILE *fp;
-    unsigned long compsize;
+    off_t compsize;
 
-    unsigned short bitbuf;
-    unsigned char subbitbuf;
+    uint16_t bitbuf;
+    uint8_t subbitbuf;
     int bitcount;
 
     /* huf.c */
     unsigned int blocksize;
 
-    unsigned char c_len[NC];
-    unsigned short c_table[4096];
-    unsigned char p_len[NP];
-    unsigned short p_table[256];
+    uint8_t  c_len[NC];
+    uint16_t c_table[4096];
+    uint8_t  p_len[NP];
+    uint16_t p_table[256];
 
     int np;
     int pbit;
@@ -51,25 +46,25 @@ struct lzh_istream {
 
 struct lzh_ostream {
     FILE *fp;
-    unsigned long compsize;
-    unsigned long origsize;
+    off_t compsize;
+    off_t origsize;
     int unpackable;
 
-    unsigned char subbitbuf;
+    uint8_t subbitbuf;
     int bitcount;
 
-    unsigned int crc;
+    uint16_t crc;
 
     /* huf.c */
-    unsigned char *buf;
-    unsigned int bufsiz;
+    uint8_t *buf;
+    size_t bufsiz;
 
     /* huf.c:output() */
-    unsigned int output_pos, output_mask;
-    unsigned int cpos;
+    size_t output_pos, output_mask;
+    size_t cpos;
 
-    unsigned short c_freq[2 * NC - 1];
-    unsigned short p_freq[2 * NP - 1];
+    uint16_t c_freq[2 * NC - 1];
+    uint16_t p_freq[2 * NP - 1];
 
     int np;
     int pbit;
@@ -79,10 +74,10 @@ struct lzh_header {
     char filename[1024];
     int  namelen;
     char method[5];
-    int compsize;
-    int origsize;
+    off_t compsize;
+    off_t origsize;
     time_t mtime;
-    int file_crc;
+    uint16_t file_crc;
     char os_id;
     int level;
 };
index 5eaff5f..412c0df 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -17,31 +17,32 @@ extern struct lha_opts opts;
         if (remainder == 0) return;                     \
                                                         \
         pos = 0;                                        \
-        n = (uint)MIN(remainder, MAXDICSIZ);            \
+        n = (size_t)MIN(remainder, MAXDICSIZ);          \
     }                                                   \
 } while (0)
 
 
 void
-decode(struct lzh_istream *rp, FILE *outfile, unsigned long remainder, unsigned int *crc)
+decode(struct lzh_istream *rp, FILE *outfile, off_t remainder, uint16_t *crc)
 {
     char buf[MAXDICSIZ];
     struct huf_t huf;
-    unsigned int pos, n;
+    uint32_t pos;
+    size_t n;
 
     huf_decode_start(rp, opts.method);
 
     pos = 0;
-    n = (uint)MIN(remainder, MAXDICSIZ);
+    n = (size_t)MIN(remainder, MAXDICSIZ);
 
     for (;;) {
-        uint c = decode_c(&huf, rp);
+        uint16_t c = decode_c(&huf, rp);
         if (c <= UCHAR_MAX) {
             PUTBUF(c);
         }
         else {
-            unsigned int off;
-            int len, i;
+            uint32_t off;
+            uint16_t len, i;
 
             len = c - (UCHAR_MAX + 1 - THRESHOLD);
             off = (pos - decode_p(&huf, rp) - 1) & (MAXDICSIZ - 1);
index ec26683..10ba446 100644 (file)
--- a/encode.c
+++ b/encode.c
@@ -25,14 +25,14 @@ typedef uint32_t node;          /* need (dicbit+2) bits */
 typedef short node;
 #endif
 
-static uchar *text, *childcount;
+static uint8_t *text, *childcount;
 static node pos, avail, *position, *parent, *prev, *next = NULL;
 static int remainder;
 
 #if MAXMATCH <= (UCHAR_MAX + 1)
-static uchar *level;
+static uint8_t *level;
 #else
-static ushort *level;
+static uint16_t *level;
 #endif
 
 extern struct lha_opts opts;
@@ -84,7 +84,7 @@ init_slide(void)
 }
 
 static node
-child(node q, uchar c)
+child(node q, uint8_t c)
         /* q's child for character c (NIL if not found) */
 {
     node r;
@@ -97,7 +97,7 @@ child(node q, uchar c)
 }
 
 static void
-makechild(node q, uchar c, node r)
+makechild(node q, uint8_t c, node r)
         /* Let r be q's child for character c. */
 {
     node h, t;
@@ -171,7 +171,7 @@ static void
 insert_node(struct match_t *match)
 {
     node q, r, j, t;
-    uchar c, *t1, *t2;
+    uint8_t c, *t1, *t2;
 
     if (match->len >= 4) {
         match->len--;
index 3096561..5a9248c 100644 (file)
--- a/extract.c
+++ b/extract.c
@@ -7,12 +7,12 @@
 
 static void
 copy_stream_crc(FILE *arcfile, FILE *outfile,
-                unsigned long remainder, unsigned int *crc)
+                off_t remainder, uint16_t *crc)
 {
     char buf[BUFSIZ];
 
     while (remainder != 0) {
-        uint n = (uint)MIN(remainder, BUFSIZ);
+        size_t n = (size_t)MIN(remainder, BUFSIZ);
 
         /* no compress */
         if (fread(buf, 1, n, arcfile) != n)
@@ -28,7 +28,7 @@ copy_stream_crc(FILE *arcfile, FILE *outfile,
 static void
 extract(struct lzh_istream *rp, FILE *outfile, struct lzh_header *h)
 {
-    unsigned int crc;
+    uint16_t crc;
     crc = INIT_CRC;
 
     if (opts.method->dicbit != 0)
index 8c55064..49fddef 100644 (file)
--- a/header.c
+++ b/header.c
@@ -6,7 +6,7 @@ static void
 put_header(char *buf, int *i, int n, uint32_t x)
 {
     while (--n >= 0) {
-        buf[(*i)++] = (uchar) (x & 0xFF);
+        buf[(*i)++] = (unsigned char) (x & 0xFF);
         x >>= 8;
     }
 }
@@ -45,11 +45,11 @@ get_string(char *buf, int *i, size_t size, char *p)
     *i += size;
 }
 
-static uint
+static uint8_t
 calc_headersum(char *buf, int size)
 {
     int i;
-    uint s;
+    uint8_t s;
 
     s = 0;
     for (i = 0; i < size; i++)
@@ -337,7 +337,7 @@ read_header_lv1(FILE *fp, char *buf, struct lzh_header *h)
 
     while (ext_headersize != 0) {
         char extbuf[4096];
-        uchar ext_type;
+        unsigned char ext_type;
         int extpos = 0;
 
         h->compsize -= ext_headersize;
@@ -439,7 +439,7 @@ read_header_lv2(FILE *fp, char *buf, struct lzh_header *h)
 
     while (ext_headersize != 0) {
         char extbuf[4096];
-        uchar ext_type;
+        unsigned char ext_type;
         int extpos = 0;
 
         remainder -= ext_headersize;
@@ -494,7 +494,7 @@ read_header(FILE *fp, struct lzh_header *h)
     int ret;
 
     ret = fgetc(fp);
-    buf[0] = (uchar)ret;
+    buf[0] = (unsigned char)ret;
     if (buf[0] == 0 || ret == EOF)
         return 0;               /* end of archive */
     fread_crc(buf + 1, 21 - 1, fp, 0);
@@ -641,7 +641,7 @@ write_header_lv2(FILE *fp, struct lzh_header *h)
 {
     char buf[4096], *crcptr;
     int headersize;
-    extern ushort crctable[];
+    extern uint16_t crctable[];
     char dirname[1024] = "", *fname;
     int dirnamelen, len;
     int pos = 0;
@@ -700,7 +700,7 @@ write_header_lv2(FILE *fp, struct lzh_header *h)
 
     {
         int i;
-        unsigned int crc;
+        uint16_t crc;
 
         crc = INIT_CRC;
         for (i = 0; i < headersize; i++)
diff --git a/huf.c b/huf.c
index cde37d5..84a48e0 100644 (file)
--- a/huf.c
+++ b/huf.c
@@ -7,7 +7,7 @@
 /***** encoding *****/
 
 static void
-count_t_freq(struct lzh_ostream *wp, uchar *c_len, ushort *t_freq)
+count_t_freq(struct lzh_ostream *wp, uint8_t *c_len, uint16_t *t_freq)
 {
     int i, k, n, count;
 
@@ -43,7 +43,7 @@ count_t_freq(struct lzh_ostream *wp, uchar *c_len, ushort *t_freq)
 
 static void
 write_pt_len(struct lzh_ostream *wp, int n, int nbit, int i_special,
-             uchar *pt_len)
+             uint8_t *pt_len)
 {
     int i, k;
 
@@ -66,7 +66,7 @@ write_pt_len(struct lzh_ostream *wp, int n, int nbit, int i_special,
 }
 
 static void
-write_c_len(struct lzh_ostream *wp, uchar *c_len, uchar *t_len, ushort *t_code)
+write_c_len(struct lzh_ostream *wp, uint8_t *c_len, uint8_t *t_len, uint16_t *t_code)
 {
     int i, k, n, count;
 
@@ -107,15 +107,16 @@ write_c_len(struct lzh_ostream *wp, uchar *c_len, uchar *t_len, ushort *t_code)
 }
 
 static void
-encode_c(struct lzh_ostream *wp, int c, uchar *c_len, ushort *c_code)
+encode_c(struct lzh_ostream *wp, int c, uint8_t *c_len, uint16_t *c_code)
 {
     putbits(wp, c_len[c], c_code[c]);
 }
 
 static void
-encode_p(struct lzh_ostream *wp, uint p, uchar *p_len, ushort *p_code)
+encode_p(struct lzh_ostream *wp, uint32_t p, uint8_t *p_len, uint16_t *p_code)
 {
-    uint c, q;
+    uint16_t c;
+    uint32_t q;
 
     c = 0;
     q = p;
@@ -198,23 +199,23 @@ encode_p(struct lzh_ostream *wp, uint p, uchar *p_len, ushort *p_code)
 static void
 send_block(struct lzh_ostream *wp)
 {
-    uint i, k, flags, root, pos, size;
+    unsigned int i, k, flags, root, pos, size; /* XXX: variable type is vague */
 
-    uchar c_len[NC];
-    ushort c_code[NC];
+    uint8_t c_len[NC];
+    uint16_t c_code[NC];
 
-    uchar t_len[NT];
-    ushort t_code[NT];
+    uint8_t t_len[NT];
+    uint16_t t_code[NT];
 
-    uchar p_len[NP];
-    ushort p_code[NP];
+    uint8_t p_len[NP];
+    uint16_t p_code[NP];
 
     /* make Huffman tree for characters and length */
     root = make_tree(NC, wp->c_freq, c_len, c_code);
     size = wp->c_freq[root];
     putbits(wp, 16, size);
     if (root >= NC) {
-        ushort t_freq[2 * NT - 1];
+        uint16_t t_freq[2 * NT - 1];
 
         /* make Huffman tree for c_len */
         count_t_freq(wp, c_len, t_freq);
@@ -298,7 +299,7 @@ c_freq[] has frequency of cN and len.
 p_freq[] has frequency of length of off bits.
 */
 void
-output(struct lzh_ostream *wp, uint c, uint p)
+output(struct lzh_ostream *wp, uint16_t c, uint32_t p)
 {
     wp->output_mask >>= 1;
     if (wp->output_mask == 0) {
@@ -313,14 +314,14 @@ output(struct lzh_ostream *wp, uint c, uint p)
         wp->cpos = wp->output_pos++;
         wp->buf[wp->cpos] = 0;
     }
-    wp->buf[wp->output_pos++] = (uchar) c; /* char or length */
+    wp->buf[wp->output_pos++] = (uint8_t) c; /* char or length */
     wp->c_freq[c]++;
 
     if (c >= (1U << CHAR_BIT)) {
         /* c is length, p is offset */
         wp->buf[wp->cpos] |= wp->output_mask;
-        wp->buf[wp->output_pos++] = (uchar) (p >> CHAR_BIT);
-        wp->buf[wp->output_pos++] = (uchar) p;
+        wp->buf[wp->output_pos++] = (uint8_t) (p >> CHAR_BIT);
+        wp->buf[wp->output_pos++] = (uint8_t) p;
 
         {
             /* count frequency of p's bit length */
@@ -384,10 +385,10 @@ huf_encode_end(struct lzh_ostream *wp)
 
 static void
 read_pt_len(struct huf_t *huf, struct lzh_istream *rp, int nn, int nbit,
-            int i_special, uchar *pt_len, ushort *pt_table)
+            int i_special, uint8_t *pt_len, uint16_t *pt_table)
 {
     int i, c, n;
-    uint mask;
+    unsigned int mask;
 
     n = getbits(rp, nbit);
     if (n == 0) {
@@ -423,10 +424,10 @@ read_pt_len(struct huf_t *huf, struct lzh_istream *rp, int nn, int nbit,
 }
 
 static void
-read_c_len(struct huf_t *huf, struct lzh_istream *rp, uchar *t_len, ushort *t_table)
+read_c_len(struct huf_t *huf, struct lzh_istream *rp, uint8_t *t_len, uint16_t *t_table)
 {
     int i, c, n;
-    uint mask;
+    unsigned int mask;
 
     n = getbits(rp, CBIT);
     if (n == 0) {
@@ -470,14 +471,14 @@ read_c_len(struct huf_t *huf, struct lzh_istream *rp, uchar *t_len, ushort *t_ta
     }
 }
 
-uint
+uint16_t
 decode_c(struct huf_t *huf, struct lzh_istream *rp)
 {
-    uint j, mask;
+    uint16_t j, mask;
 
     if (rp->blocksize == 0) {
-        uchar t_len[NT];
-        unsigned short t_table[256];
+        uint8_t t_len[NT];
+        uint16_t t_table[256];
 
         rp->blocksize = getbits(rp, 16);
         read_pt_len(huf, rp, NT, TBIT, 3, t_len, t_table);
@@ -500,10 +501,10 @@ decode_c(struct huf_t *huf, struct lzh_istream *rp)
     return j;
 }
 
-uint
+uint16_t
 decode_p(struct huf_t *huf, struct lzh_istream *rp)
 {
-    uint j, mask;
+    uint16_t j, mask;
 
     j = rp->p_table[rp->bitbuf >> (BITBUFSIZ - 8)];
     if (j >= rp->np) {
diff --git a/io.c b/io.c
index d8c9562..f4e72be 100644 (file)
--- a/io.c
+++ b/io.c
@@ -7,12 +7,12 @@
 #define CRCPOLY  0xA001         /* ANSI CRC-16 */
                          /* CCITT: 0x8408 */
 
-ushort crctable[UCHAR_MAX + 1];
+uint16_t crctable[UCHAR_MAX + 1];
 
 void
 make_crctable(void)
 {
-    uint i, j, r;
+    unsigned int i, j, r;
 
     for (i = 0; i <= UCHAR_MAX; i++) {
         r = i;
@@ -26,7 +26,7 @@ make_crctable(void)
 }
 
 static const char *
-bitstring(unsigned int bitbuf, int n, char *ptr, size_t sz)
+bitstring(uint16_t bitbuf, int n, char *ptr, size_t sz)
 {
     static char str[256];
     size_t size = sz;
@@ -82,7 +82,7 @@ fillbuf(struct lzh_istream *rp, int n)
         rp->bitbuf |= rp->subbitbuf << n;
         if (rp->compsize != 0) {
             rp->compsize--;
-            rp->subbitbuf = (uchar) getc(rp->fp);
+            rp->subbitbuf = getc(rp->fp);
         }
         else
             rp->subbitbuf = 0;
@@ -93,10 +93,10 @@ fillbuf(struct lzh_istream *rp, int n)
     rp->bitbuf |= rp->subbitbuf >> rp->bitcount;
 }
 
-uint
+unsigned int
 getbits(struct lzh_istream *rp, int n)
 {
-    uint x;
+    unsigned int x;
 
     x = rp->bitbuf >> (BITBUFSIZ - n);
     fillbuf(rp, n);
@@ -104,7 +104,7 @@ getbits(struct lzh_istream *rp, int n)
 }
 
 void
-putbits(struct lzh_ostream *wp, int n, uint x)
+putbits(struct lzh_ostream *wp, int n, unsigned int x)
 {                               /* Write rightmost n bits of x */
     if (n < wp->bitcount) {
         wp->subbitbuf |= x << (wp->bitcount -= n);
@@ -132,7 +132,7 @@ putbits(struct lzh_ostream *wp, int n, uint x)
 }
 
 int
-fread_crc(void *p, int n, FILE * f, unsigned int *crc)
+fread_crc(void *p, int n, FILE * f, uint16_t *crc)
 {
     int i;
 
@@ -145,7 +145,7 @@ fread_crc(void *p, int n, FILE * f, unsigned int *crc)
 }
 
 void
-fwrite_crc(void *p, int n, FILE * f, unsigned int *crc)
+fwrite_crc(void *p, int n, FILE * f, uint16_t *crc)
 {
     if (fwrite(p, 1, n, f) < n)
         error("Unable to write");
diff --git a/list.c b/list.c
index d2897c6..d73a74a 100644 (file)
--- a/list.c
+++ b/list.c
@@ -53,7 +53,7 @@ os_string(char id)
 void
 list(struct lzh_header *h)
 {
-    uint r;
+    unsigned int r;
 
     printf("%-14.*s", h->namelen, h->filename);
     if (h->namelen > 14)
index 23fddbc..ef006a9 100644 (file)
--- a/maketbl.c
+++ b/maketbl.c
@@ -4,10 +4,10 @@
 #include "ar.h"
 
 void
-make_table(struct huf_t *huf, int nchar, uchar bitlen[], int tablebits, ushort table[])
+make_table(struct huf_t *huf, int nchar, uint8_t *bitlen, int tablebits, uint16_t *table)
 {
-    ushort count[17], weight[17], start[18], *p;
-    uint i, k, len, ch, jutbits, avail, nextcode, mask;
+    uint16_t count[17], weight[17], start[18], *p;
+    unsigned int i, k, len, ch, jutbits, avail, nextcode, mask; /* XXX variable type is vague */
 
     for (i = 1; i <= 16; i++)
         count[i] = 0;
@@ -17,7 +17,7 @@ make_table(struct huf_t *huf, int nchar, uchar bitlen[], int tablebits, ushort t
     start[1] = 0;
     for (i = 1; i <= 16; i++)
         start[i + 1] = start[i] + (count[i] << (16 - i));
-    if (start[17] != (ushort) (1U << 16))
+    if (start[17] != (uint16_t) (1U << 16))
         error("Bad table");
 
     jutbits = 16 - tablebits;
index a218feb..c5e551c 100644 (file)
@@ -7,7 +7,7 @@
 
 /* ar.c */
 struct lha_method *which_method P_((char *id));
-uint ratio P_((ulong a, ulong b));
+unsigned int ratio P_((off_t a, off_t b));
 void skip P_((FILE *fp, struct lzh_header *h));
 int get_line P_((char *s, int n));
 void parse_args P_((int argc, char **argv));
@@ -15,26 +15,26 @@ FILE *open_tempfile P_((void));
 /* io.c */
 void make_crctable P_((void));
 void fillbuf P_((struct lzh_istream *rp, int n));
-uint getbits P_((struct lzh_istream *rp, int n));
-void putbits P_((struct lzh_ostream *wp, int n, uint x));
-int fread_crc P_((void *p, int n, FILE *f, unsigned int *crc));
-void fwrite_crc P_((void *p, int n, FILE *f, unsigned int *crc));
+unsigned int getbits P_((struct lzh_istream *rp, int n));
+void putbits P_((struct lzh_ostream *wp, int n, unsigned int x));
+int fread_crc P_((void *p, int n, FILE *f, uint16_t *crc));
+void fwrite_crc P_((void *p, int n, FILE *f, uint16_t *crc));
 void init_getbits P_((struct lzh_istream *rp));
 void init_putbits P_((struct lzh_ostream *wp));
 /* encode.c */
 void encode P_((struct lzh_ostream *wp, FILE *rfp));
 /* decode.c */
-void decode P_((struct lzh_istream *rp, FILE *outfile, unsigned long remainder, unsigned int *crc));
+void decode P_((struct lzh_istream *rp, FILE *outfile, off_t remainder, uint16_t *crc));
 /* maketree.c */
 int make_tree P_((uint16_t nparm, uint16_t *freqparm, uint8_t *lenparm, uint16_t *codeparm));
 /* maketbl.c */
-void make_table P_((struct huf_t *huf, int nchar, uchar bitlen[], int tablebits, ushort table[]));
+void make_table P_((struct huf_t *huf, int nchar, uint8_t *bitlen, int tablebits, uint16_t *table));
 /* huf.c */
-void output P_((struct lzh_ostream *wp, uint c, uint p));
+void output P_((struct lzh_ostream *wp, uint16_t c, uint32_t p));
 void huf_encode_start P_((struct lzh_ostream *wp, struct lha_method *m));
 void huf_encode_end P_((struct lzh_ostream *wp));
-uint decode_c P_((struct huf_t *huf, struct lzh_istream *rp));
-uint decode_p P_((struct huf_t *huf, struct lzh_istream *rp));
+uint16_t decode_c P_((struct huf_t *huf, struct lzh_istream *rp));
+uint16_t decode_p P_((struct huf_t *huf, struct lzh_istream *rp));
 void huf_decode_start P_((struct lzh_istream *rp, struct lha_method *m));
 /* strlib.c */
 int string_equal P_((char *str1, char *str2));