aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/pklib/explode.c16
-rw-r--r--src/pklib/pklib.h2
2 files changed, 9 insertions, 9 deletions
diff --git a/src/pklib/explode.c b/src/pklib/explode.c
index 35210fb..21246b3 100644
--- a/src/pklib/explode.c
+++ b/src/pklib/explode.c
@@ -31,7 +31,7 @@ char CopyrightPkware[] = "PKWARE Data Compression Library for Win32\r\n"
//-----------------------------------------------------------------------------
// Tables
-const unsigned char DistBits[0x40] =
+const unsigned char DistBits[DIST_SIZES] =
{
0x02, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07,
@@ -39,7 +39,7 @@ const unsigned char DistBits[0x40] =
0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08
};
-const unsigned char DistCode[0x40] =
+const unsigned char DistCode[DIST_SIZES] =
{
0x03, 0x0D, 0x05, 0x19, 0x09, 0x11, 0x01, 0x3E, 0x1E, 0x2E, 0x0E, 0x36, 0x16, 0x26, 0x06, 0x3A,
0x1A, 0x2A, 0x0A, 0x32, 0x12, 0x22, 0x42, 0x02, 0x7C, 0x3C, 0x5C, 0x1C, 0x6C, 0x2C, 0x4C, 0x0C,
@@ -47,28 +47,28 @@ const unsigned char DistCode[0x40] =
0xF0, 0x70, 0xB0, 0x30, 0xD0, 0x50, 0x90, 0x10, 0xE0, 0x60, 0xA0, 0x20, 0xC0, 0x40, 0x80, 0x00
};
-const unsigned char ExLenBits[0x10] =
+const unsigned char ExLenBits[LENS_SIZES] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
};
-const unsigned short LenBase[0x10] =
+const unsigned short LenBase[LENS_SIZES] =
{
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
0x0008, 0x000A, 0x000E, 0x0016, 0x0026, 0x0046, 0x0086, 0x0106
};
-const unsigned char LenBits[0x10] =
+const unsigned char LenBits[LENS_SIZES] =
{
0x03, 0x02, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x07, 0x07
};
-const unsigned char LenCode[0x10] =
+const unsigned char LenCode[LENS_SIZES] =
{
0x05, 0x03, 0x01, 0x06, 0x0A, 0x02, 0x0C, 0x14, 0x04, 0x18, 0x08, 0x30, 0x10, 0x20, 0x40, 0x00
};
-const unsigned char ChBitsAsc[0x100] =
+const unsigned char ChBitsAsc[CH_BITS_ASC_SIZE] =
{
0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x08, 0x07, 0x0C, 0x0C, 0x07, 0x0C, 0x0C,
0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C,
@@ -88,7 +88,7 @@ const unsigned char ChBitsAsc[0x100] =
0x0D, 0x0D, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D
};
-const unsigned short ChCodeAsc[0x100] =
+const unsigned short ChCodeAsc[CH_BITS_ASC_SIZE] =
{
0x0490, 0x0FE0, 0x07E0, 0x0BE0, 0x03E0, 0x0DE0, 0x05E0, 0x09E0,
0x01E0, 0x00B8, 0x0062, 0x0EE0, 0x06E0, 0x0022, 0x0AE0, 0x02E0,
diff --git a/src/pklib/pklib.h b/src/pklib/pklib.h
index c951d11..10d3e1d 100644
--- a/src/pklib/pklib.h
+++ b/src/pklib/pklib.h
@@ -116,7 +116,7 @@ typedef struct
unsigned int (*read_buf)(char *buf, unsigned int *size, void *param); // Pointer to function that reads data from the input stream
void (*write_buf)(char *buf, unsigned int *size, void *param);// Pointer to function that writes data to the output stream
- unsigned char out_buff[0x2204]; // 0030: Output circle buffer.
+ unsigned char out_buff[BUFF_SIZE]; // 0030: Output circle buffer.
// 0x0000 - 0x0FFF: Previous uncompressed data, kept for repetitions
// 0x1000 - 0x1FFF: Currently decompressed data
// 0x2000 - 0x2203: Reserve space for the longest possible repetition