summaryrefslogtreecommitdiffstats
path: root/chinese/srecite
diff options
context:
space:
mode:
authorclive <clive@FreeBSD.org>2004-11-21 13:42:25 +0000
committerclive <clive@FreeBSD.org>2004-11-21 13:42:25 +0000
commit0bb2053faeeb2af17c09357b8b14bc718b86683d (patch)
tree7d66c5d0135ce8ca53f0c1820b016efdba71177c /chinese/srecite
parentbd92cea27e314e577275332605d72d23b21cf696 (diff)
downloadFreeBSD-ports-0bb2053faeeb2af17c09357b8b14bc718b86683d.zip
FreeBSD-ports-0bb2053faeeb2af17c09357b8b14bc718b86683d.tar.gz
*Cough cough*, declare variables before anything, because gcc 2.95.4
in RELENG_4 is not C99 compliant.
Diffstat (limited to 'chinese/srecite')
-rw-r--r--chinese/srecite/files/patch-minidict.c58
-rw-r--r--chinese/srecite/files/patch-readword.c58
-rw-r--r--chinese/srecite/files/patch-sentencewin.c12
-rw-r--r--chinese/srecite/files/patch-testgame.c48
-rw-r--r--chinese/srecite/files/patch-wordfile.c37
5 files changed, 213 insertions, 0 deletions
diff --git a/chinese/srecite/files/patch-minidict.c b/chinese/srecite/files/patch-minidict.c
new file mode 100644
index 0000000..d96b7e9
--- /dev/null
+++ b/chinese/srecite/files/patch-minidict.c
@@ -0,0 +1,58 @@
+--- src/minidict.c~ Sun Nov 21 20:58:43 2004
++++ src/minidict.c Sun Nov 21 21:00:12 2004
+@@ -195,12 +195,12 @@
+ int do_CH_search(gchar word[256],int begin,int end)
+ {
+
+- g_print("CH search \n");
+ int i ;
+ int flag=0;
+
+ //init 0
+ CH_line_index = 0;
++ g_print("CH search \n");
+
+ for(i=begin;i<=end;i++)
+ {
+@@ -228,12 +228,12 @@
+ //search EN successfully,show result
+ void dict_show_EN_success()
+ {
+- g_print("search successfully !\n");
+ gchar result_str[256];
+ gchar ps1_str[256];
+ gchar ps2_str[256];
+ gchar ps3_str[256];
+
++ g_print("search successfully !\n");
+ strcpy(result_str,"");
+ strcpy(ps1_str,"");
+ strcpy(ps2_str,"");
+@@ -260,13 +260,13 @@
+ //search CH successfully,show result
+ void dict_show_CH_success()
+ {
+- g_print("search successfully !\n");
+ int i;
+ struct line_st myline;
+
+ gchar result_str[256];
+ gchar ps1_str[256];
+
++ g_print("search successfully !\n");
+ strcpy(result_str,"");
+ strcpy(ps1_str,"");
+
+@@ -315,11 +315,10 @@
+ //search dict
+ static void dict_search()
+ {
+- g_print("dict search!!\n");
+ gchar word[256];
+ int flag;
+
+-
++ g_print("dict search!!\n");
+ strcpy(word,gtk_entry_get_text(GTK_ENTRY(input_entry)));
+
+ if( (word[0] & 0x80) == 0x80 )
diff --git a/chinese/srecite/files/patch-readword.c b/chinese/srecite/files/patch-readword.c
new file mode 100644
index 0000000..0d1467a
--- /dev/null
+++ b/chinese/srecite/files/patch-readword.c
@@ -0,0 +1,58 @@
+--- src/readword.c~ Sun Nov 21 20:55:42 2004
++++ src/readword.c Sun Nov 21 20:58:22 2004
+@@ -26,13 +26,14 @@
+
+ gboolean return_val = 0;
+
+- int n,i;
++ int n=0,i;
+
+
+ if(have_data_file && word && g_ascii_isalpha(word[0]))
+ {
+- n=strlen(word);
+ gchar *lowerword = (gchar *)g_malloc(n+1);
++ gchar *filename;
++ n=strlen(word);
+
+ for (i=0;i < n;i++)
+ {
+@@ -40,7 +41,7 @@
+ }
+ lowerword[n] = '\0';
+
+- gchar *filename = g_strdup_printf(
++ filename = g_strdup_printf(
+ RP_TTS_DIR"%c/%s.wav",
+ lowerword[0],lowerword);
+
+@@ -61,9 +62,11 @@
+ int n,i;
+ if (word && g_ascii_isalpha(word[0]))
+ {
+- n=strlen(word);
+
+ gchar *lowerword = (gchar *)g_malloc(n+1);
++ gchar *filename;
++ int fd;
++ n=strlen(word);
+
+ for (i=0;i < n;i++)
+ {
+@@ -72,15 +75,12 @@
+
+ lowerword[n] = '\0';
+
+-
+- gchar *filename;
+-
+ filename = g_strdup_printf(
+ RP_TTS_DIR"%c/%s.wav",
+ lowerword[0],lowerword);
+
+ //gnome_sound_play(filename);
+- int fd = esd_open_sound(NULL);
++ fd = esd_open_sound(NULL);
+ if (fd >= 0)
+ {
+ esd_play_file(NULL,filename, 0);
diff --git a/chinese/srecite/files/patch-sentencewin.c b/chinese/srecite/files/patch-sentencewin.c
new file mode 100644
index 0000000..9a6f4b3
--- /dev/null
+++ b/chinese/srecite/files/patch-sentencewin.c
@@ -0,0 +1,12 @@
+--- src/sentencewin.c~ Sun Nov 21 20:55:21 2004
++++ src/sentencewin.c Sun Nov 21 20:55:28 2004
+@@ -114,8 +114,8 @@
+ //sentence read aloudly
+ static void sentence_read()
+ {
+- g_print("sentence read!!\n");
+ gchar word[256];
++ g_print("sentence read!!\n");
+
+ strcpy(word,gtk_entry_get_text(GTK_ENTRY(input_entry)));
+
diff --git a/chinese/srecite/files/patch-testgame.c b/chinese/srecite/files/patch-testgame.c
new file mode 100644
index 0000000..84e0e3e
--- /dev/null
+++ b/chinese/srecite/files/patch-testgame.c
@@ -0,0 +1,48 @@
+--- src/testgame.c~ Sun Nov 21 21:00:23 2004
++++ src/testgame.c Sun Nov 21 21:01:21 2004
+@@ -42,14 +42,12 @@
+ {
+ GtkWidget *vbox,*hbox,*h_line;
+ GtkWidget *text_label,*xpm_label;
++ gchar temp[10];
+
+ // init
+ r_num=0;w_num=0;t_num=0;
+ counter = S_conf.test_counter;
+
+- gchar temp[10];
+-
+-
+ /* test window */
+ test_win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW(test_win),"Test Game");
+@@ -262,7 +260,6 @@
+ //test start
+ static void test_start()
+ {
+- g_print("start button clicked!\n");
+
+ // clean up
+ //gtk_entry_set_text(GTK_ENTRY(input_entry),"");
+@@ -271,6 +268,7 @@
+ //gchar temp[10];
+ gchar prompt_str[256];
+
++ g_print("start button clicked!\n");
+ randnum = rand() % word_count;// 0< random num < word_count
+ S_state.word_index = randnum;
+
+@@ -391,12 +389,12 @@
+ //test counter over,show result
+ static void test_over()
+ {
+- g_print("counter over!\n");
+
+ gchar str[256];
+ gchar temp[256];
+ float percent;
+
++ g_print("counter over!\n");
+ if(t_num == 0)
+ percent = 0.0000;
+ else
diff --git a/chinese/srecite/files/patch-wordfile.c b/chinese/srecite/files/patch-wordfile.c
new file mode 100644
index 0000000..32e2506
--- /dev/null
+++ b/chinese/srecite/files/patch-wordfile.c
@@ -0,0 +1,37 @@
+--- src/wordfile.c~ Sun Nov 21 21:01:43 2004
++++ src/wordfile.c Sun Nov 21 21:02:37 2004
+@@ -44,12 +44,11 @@
+ //read wordfile to wordbook[][],10000 words limition
+ void init_wordbook()
+ {
++ gchar * strtemp;//temp string
++ gchar str[256];//temp string
+ word_count = 0;
+ S_state.word_index = 0;
+
+- gchar * strtemp;//temp string
+- gchar str[256];//temp string
+-
+ g_print("init wordbook!\n");
+
+ //open word file
+@@ -91,16 +90,14 @@
+ //get S_line from wordfile
+ void read_line()
+ {
++ gchar line[256],EN_word[256],TK_word[256],CH_word[256],*p;
++ gint n;// count for line
++
+ if(S_state.word_index <= 0 )
+ gtk_widget_set_sensitive(back_button,0);
+ else
+ gtk_widget_set_sensitive(back_button,1);
+
+-
+- gchar line[256],EN_word[256],TK_word[256],CH_word[256],*p;
+-
+- gint n;// count for line
+-
+ // '#' is special char defined by me,to show TK_word is end
+ TK_word[0]='#';
+
OpenPOWER on IntegriCloud