mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
d4c3076cb0
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
172 lines
4.2 KiB
Diff
172 lines
4.2 KiB
Diff
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;
|