1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
From d2f68e7d2f1c5b02e7236e1e4c35b1f37981500e Mon Sep 17 00:00:00 2001
From: Jonathan Lin <jonathanylin1111@gmail.com>
Date: Wed, 22 Oct 2025 11:48:46 -0700
Subject: [PATCH] Fix quazip using wrong types
---
src/lib/quazip/crypt.h | 8 ++++----
src/lib/quazip/unzip.c | 2 +-
src/lib/quazip/zip.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/lib/quazip/crypt.h b/src/lib/quazip/crypt.h
index 2ae6fd5..d47260c 100644
--- a/src/lib/quazip/crypt.h
+++ b/src/lib/quazip/crypt.h
@@ -32,7 +32,7 @@
/***********************************************************************
* Return the next byte in the pseudo-random sequence
*/
-static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
+static int decrypt_byte(unsigned long* pkeys, const z_crc_t FAR * pcrc_32_tab)
{
#ifndef _WINDOWS
(void) pcrc_32_tab; /* avoid "unused parameter" warning */
@@ -49,7 +49,7 @@ static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab)
/***********************************************************************
* Update the encryption keys with the next byte of plain text
*/
-static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c)
+static int update_keys(unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab,int c)
{
(*(pkeys+0)) = CRC32((*(pkeys+0)), c);
(*(pkeys+1)) += (*(pkeys+0)) & 0xff;
@@ -66,7 +66,7 @@ static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int
* Initialize the encryption keys and the random header according to
* the given password.
*/
-static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab)
+static void init_keys(const char* passwd,unsigned long* pkeys,const z_crc_t FAR * pcrc_32_tab)
{
*(pkeys+0) = 305419896L;
*(pkeys+1) = 591751049L;
@@ -96,7 +96,7 @@ const char *passwd; /* password string */
unsigned char *buf; /* where to write header */
int bufSize;
unsigned long* pkeys;
-const unsigned long* pcrc_32_tab;
+const z_crc_t FAR * pcrc_32_tab;
unsigned long crcForCrypting;
{
int n; /* index in random header */
diff --git a/src/lib/quazip/unzip.c b/src/lib/quazip/unzip.c
index dde4c34..9526964 100644
--- a/src/lib/quazip/unzip.c
+++ b/src/lib/quazip/unzip.c
@@ -150,7 +150,7 @@ typedef struct
int encrypted;
# ifndef NOUNCRYPT
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
- const unsigned long* pcrc_32_tab;
+ const z_crc_t FAR * pcrc_32_tab;
# endif
} unz_s;
diff --git a/src/lib/quazip/zip.c b/src/lib/quazip/zip.c
index 99f29ce..eb640fe 100644
--- a/src/lib/quazip/zip.c
+++ b/src/lib/quazip/zip.c
@@ -134,7 +134,7 @@ typedef struct
int encrypt;
#ifndef NOCRYPT
unsigned long keys[3]; /* keys defining the pseudo-random sequence */
- const unsigned long* pcrc_32_tab;
+ const z_crc_t FAR * pcrc_32_tab;
int crypt_header_size;
#endif
} curfile_info;
--
2.51.0
|