summaryrefslogtreecommitdiffstats
path: root/misc/stardict-tools/stardict-tools.patch
blob: e7b5aa7243c3d61bd395aca56786b8dd609ef945 (plain)
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
Author:       Cezary M. Kruk <c.kruk@bigfoot.com>
Date:         2014-11-06
Package:      stardict-tools
Version:      3.0.1
Origin:       https://code.google.com/p/stardict-3/downloads/list/stardict-3.0.1.tar.bz2
Description:  fixes things up for gcc-4.8.2

diff -us src/KangXi.cpp src/KangXi.cpp
--- src/KangXi.cpp	2007-07-10 09:16:06.000000000 +0200
+++ src/KangXi.cpp	2014-11-06 04:08:47.000000000 +0100
@@ -6,6 +6,9 @@
 #include <list>
 #include <string>
 
+#include <cstring>
+using std::strrchr;
+
 static int hexalpha_to_int(int c)
 {
 	char hexalpha[] = "aAbBcCdDeEfF";
@@ -57,7 +60,7 @@
 	gchar utf8[7];
 	gint n = g_unichar_to_utf8(uc, utf8);
 	utf8[n] = '\0';
-	char *p;
+	const char *p;
 	p = strchr(line, '\t');
 	if (!p) {
 		g_print("Error: %s\n", line);
diff -us src/Unihan.cpp src/Unihan.cpp
--- src/Unihan.cpp	2007-07-10 09:16:06.000000000 +0200
+++ src/Unihan.cpp	2014-11-06 04:15:20.000000000 +0100
@@ -57,13 +57,13 @@
 	}
 	const char *han = line+2;
 
-	char *p;
+	const char *p;
 	p = strchr(han, '\t');
 	if (!p) {
 		g_print("Error: %s\n", line);
 		return;
 	}
-	*p = '\0';
+	p = '\0';
 	p++;
 	const char *key = p;
 
@@ -72,7 +72,7 @@
 		g_print("Error: %s\n", line);
 		return;
 	}
-	*p = '\0';
+	p = '\0';
 	p++;
 	const char *def = p;
 
diff -us src/bgl2txt.cpp src/bgl2txt.cpp
--- src/bgl2txt.cpp	2007-08-01 05:00:02.000000000 +0200
+++ src/bgl2txt.cpp	2014-11-06 04:20:23.000000000 +0100
@@ -1,5 +1,8 @@
 #include "libbgl2txt.h"
 
+#include <string.h>
+#include <stdio.h>
+
 int main(int argc, char * argv[])
 {
 	if (argc<2) {
diff -us src/bgl_babylon.cpp src/bgl_babylon.cpp
--- src/bgl_babylon.cpp	2007-08-16 07:14:35.000000000 +0200
+++ src/bgl_babylon.cpp	2014-11-06 05:02:40.090014886 +0100
@@ -25,6 +25,8 @@
 #include <glib/gstdio.h>
 #include <iconv.h>
 
+#include <string.h>
+
 #ifdef _WIN32
 #include <io.h>
 #define DUP _dup
diff -us src/bgl_stardictbuilder.cpp src/bgl_stardictbuilder.cpp
--- src/bgl_stardictbuilder.cpp	2007-09-05 05:48:06.000000000 +0200
+++ src/bgl_stardictbuilder.cpp	2014-11-06 05:03:42.639927341 +0100
@@ -23,6 +23,9 @@
 #include <iostream>
 #include <glib.h>
 
+#include <cstring>
+using std::strrchr;
+
 StarDictBuilder::StarDictBuilder( std::string filename )
 {
   const char *p = strrchr(filename.c_str(), G_DIR_SEPARATOR);
diff -us src/dictbuilder.cpp src/dictbuilder.cpp
--- src/dictbuilder.cpp	2007-07-10 09:16:06.000000000 +0200
+++ src/dictbuilder.cpp	2014-11-06 03:36:56.000000000 +0100
@@ -14,6 +14,9 @@
 
 #include "dictbuilder-tree.h"
 
+#include <string.h>
+#include <stdio.h>
+
 struct sectionEntry
 {
     char   sign;
diff -us src/libbgl2txt.cpp src/libbgl2txt.cpp
--- src/libbgl2txt.cpp	2007-08-01 05:01:10.000000000 +0200
+++ src/libbgl2txt.cpp	2014-11-06 05:04:31.950070070 +0100
@@ -2,6 +2,9 @@
 #include "bgl_babylonreader.h"
 #include "bgl_stardictbuilder.h"
 
+#include <cstring>
+using std::strrchr;
+
 void convert_bglfile(std::string infile, std::string source_charset, std::string target_charset)
 {
 	std::string outfile;
diff -us src/tabfile2sql.cpp src/tabfile2sql.cpp
--- src/tabfile2sql.cpp	2007-08-15 07:56:06.000000000 +0200
+++ src/tabfile2sql.cpp	2014-11-06 03:38:08.000000000 +0100
@@ -9,6 +9,9 @@
 
 #include <string>
 
+#include <cstring>
+using std::strrchr;
+
 void print_info(const char *info)
 {
 	g_print("%s", info);
diff -us src/wordnet.cpp src/wordnet.cpp
--- src/wordnet.cpp	2007-09-10 09:49:15.000000000 +0200
+++ src/wordnet.cpp	2014-11-06 05:08:15.152193594 +0100
@@ -3,6 +3,7 @@
 #include <glib.h>
 #include <string> 
 
+#include <string.h>
 
 static int hexalpha_to_int(int c)
 {
@@ -42,12 +43,12 @@
 	return answer;
 }
 
-void convert(std::string &filename, std::string &content)
+int convert(std::string &filename, std::string &content)
 {
 	gchar *contents;
 	if (!g_file_get_contents(filename.c_str(), &contents, NULL, NULL)) {
 		g_print("Open file %s failed!\n", filename.c_str());
-		return;
+//		return;
 	}
 	char *p, *p1, *p2, *p3, *p4;
 	p = contents;
diff -us src/wubi.cpp src/wubi.cpp
--- src/wubi.cpp	2007-07-10 09:16:06.000000000 +0200
+++ src/wubi.cpp	2014-11-06 04:18:16.000000000 +0100
@@ -6,6 +6,9 @@
 #include <glib.h>
 #include <string>
 
+#include <cstring>
+#include <cstdlib>
+
 void convert(const char *filename)
 {
 	struct stat stats;