-
Notifications
You must be signed in to change notification settings - Fork 1
/
sword-patch-mingw64.diff
177 lines (156 loc) · 7.67 KB
/
sword-patch-mingw64.diff
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
diff -ur orig/sword-1.9.0/CMakeLists.txt sword-1.9.0/CMakeLists.txt
--- orig/sword-1.9.0/CMakeLists.txt 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/CMakeLists.txt 2024-03-12 23:54:55.338703800 +0100
@@ -50,7 +50,7 @@
FIND_PACKAGE(BZIP2 QUIET)
FIND_PACKAGE(XZ QUIET)
FIND_PACKAGE(ICU QUIET
- COMPONENTS data i18n io uc)
+ COMPONENTS data i18n io uc in)
FIND_PACKAGE(CURL QUIET)
FIND_PACKAGE(CLucene QUIET)
FIND_PACKAGE(ZLIB QUIET)
diff -ur orig/sword-1.9.0/src/modules/common/rawstr4.cpp sword-1.9.0/src/modules/common/rawstr4.cpp
--- orig/sword-1.9.0/src/modules/common/rawstr4.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/common/rawstr4.cpp 2024-03-07 15:09:42.872374600 +0100
@@ -113,7 +113,7 @@
{
int size;
char ch;
- if ((unsigned long)datfd > 0) {
+ if ((size_t)datfd > 0) {
datfd->seek(ioffset, SEEK_SET);
for (size = 0; datfd->read(&ch, 1) == 1; size++) {
if ((ch == '\\') || (ch == 10) || (ch == 13))
@@ -147,7 +147,7 @@
{
SW_u32 offset;
- if ((unsigned long)idxfd > 0) {
+ if ((size_t)idxfd > 0) {
idxfd->seek(ioffset, SEEK_SET);
idxfd->read(&offset, 4);
diff -ur orig/sword-1.9.0/src/modules/filters/cipherfil.cpp sword-1.9.0/src/modules/filters/cipherfil.cpp
--- orig/sword-1.9.0/src/modules/filters/cipherfil.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/cipherfil.cpp 2024-03-07 15:14:23.766209000 +0100
@@ -56,7 +56,7 @@
text.setSize(len + 5);
memcpy(text.getRawData(), cipher->getUncipheredBuf(), len);
}
- else if ((unsigned long)key == 1) {
+ else if ((size_t)key == 1) {
cipher->setUncipheredBuf(text.getRawData(), len);
cipher->getCipheredBuf(&len);
text.setSize(len + 5);
diff -ur orig/sword-1.9.0/src/modules/filters/latin1utf16.cpp sword-1.9.0/src/modules/filters/latin1utf16.cpp
--- orig/sword-1.9.0/src/modules/filters/latin1utf16.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/latin1utf16.cpp 2024-03-07 15:11:58.923215500 +0100
@@ -34,7 +34,7 @@
char Latin1UTF16::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
const unsigned char *from;
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return (char)-1;
diff -ur orig/sword-1.9.0/src/modules/filters/latin1utf8.cpp sword-1.9.0/src/modules/filters/latin1utf8.cpp
--- orig/sword-1.9.0/src/modules/filters/latin1utf8.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/latin1utf8.cpp 2024-03-07 15:11:32.228011900 +0100
@@ -38,7 +38,7 @@
{
const unsigned char *from;
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return (char)-1;
SWBuf orig = text;
diff -ur orig/sword-1.9.0/src/modules/filters/scsuutf8.cpp sword-1.9.0/src/modules/filters/scsuutf8.cpp
--- orig/sword-1.9.0/src/modules/filters/scsuutf8.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/scsuutf8.cpp 2024-03-07 15:13:09.864633000 +0100
@@ -139,7 +139,7 @@
#endif
char SCSUUTF8::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
#ifdef _ICU_
diff -ur orig/sword-1.9.0/src/modules/filters/utf8arshaping.cpp sword-1.9.0/src/modules/filters/utf8arshaping.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8arshaping.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8arshaping.cpp 2024-03-07 15:57:33.225523500 +0100
@@ -43,7 +43,7 @@
char UTF8arShaping::processText(SWBuf &text, const SWKey *key, const SWModule *module)
{
UChar *ustr, *ustr2;
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
int32_t len = text.length();
diff -ur orig/sword-1.9.0/src/modules/filters/utf8bidireorder.cpp sword-1.9.0/src/modules/filters/utf8bidireorder.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8bidireorder.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8bidireorder.cpp 2024-03-07 15:58:04.154140800 +0100
@@ -50,7 +50,7 @@
char UTF8BiDiReorder::processText(SWBuf &text, const SWKey *key, const SWModule *module)
{
UChar *ustr, *ustr2;
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
int32_t len = text.length();
diff -ur orig/sword-1.9.0/src/modules/filters/utf8html.cpp sword-1.9.0/src/modules/filters/utf8html.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8html.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8html.cpp 2024-03-07 15:12:26.113215700 +0100
@@ -38,7 +38,7 @@
unsigned char *from;
char digit[10];
unsigned long ch;
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return (char)-1;
SWBuf orig = text;
diff -ur orig/sword-1.9.0/src/modules/filters/utf8latin1.cpp sword-1.9.0/src/modules/filters/utf8latin1.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8latin1.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8latin1.cpp 2024-03-07 15:12:49.702549500 +0100
@@ -38,7 +38,7 @@
unsigned long uchar;
unsigned char significantFirstBits, subsequent;
- if ((unsigned long)key < 2) {// hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) {// hack, we're en(1)/de(0)ciphering
return (char)-1;
}
diff -ur orig/sword-1.9.0/src/modules/filters/utf8nfc.cpp sword-1.9.0/src/modules/filters/utf8nfc.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8nfc.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8nfc.cpp 2024-03-07 15:56:53.106935500 +0100
@@ -42,7 +42,7 @@
char UTF8NFC::processText(SWBuf &text, const SWKey *key, const SWModule *module)
{
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
err = U_ZERO_ERROR;
diff -ur orig/sword-1.9.0/src/modules/filters/utf8nfkd.cpp sword-1.9.0/src/modules/filters/utf8nfkd.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8nfkd.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8nfkd.cpp 2024-03-07 15:57:12.657769400 +0100
@@ -56,7 +56,7 @@
UErrorCode err = U_ZERO_ERROR;
UChar *source, *target;
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
int32_t len = 5 + text.length() * 5;
diff -ur orig/sword-1.9.0/src/modules/filters/utf8scsu.cpp sword-1.9.0/src/modules/filters/utf8scsu.cpp
--- orig/sword-1.9.0/src/modules/filters/utf8scsu.cpp 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/modules/filters/utf8scsu.cpp 2024-03-07 15:56:01.729907300 +0100
@@ -42,7 +42,7 @@
}
char UTF8SCSU::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
- if ((unsigned long)key < 2) // hack, we're en(1)/de(0)ciphering
+ if ((size_t)key < 2) // hack, we're en(1)/de(0)ciphering
return -1;
err = U_ZERO_ERROR;
diff -ur orig/sword-1.9.0/src/utilfuns/regex.c sword-1.9.0/src/utilfuns/regex.c
--- orig/sword-1.9.0/src/utilfuns/regex.c 2020-11-05 01:00:51.000000000 +0100
+++ sword-1.9.0/src/utilfuns/regex.c 2024-08-17 12:17:49.117610310 +0200
@@ -122,7 +122,7 @@
even if config.h says that we can. */
# undef REL_ALLOC
-# if defined STDC_HEADERS || defined _LIBC
+# if defined STDC_HEADERS || defined _LIBC || defined __MINGW32__
# include <stdlib.h>
# else
char *malloc ();