From d9355d3e0fac58eab16684fed2715cc91f68d39e Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Fri, 11 Feb 2022 10:28:18 +0900 Subject: [PATCH] src-util: set-face-underline is not available in xemacs Lisp --- src-util/anthy-unicode.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-util/anthy-unicode.el b/src-util/anthy-unicode.el index 14a9db4..902c7ac 100644 --- a/src-util/anthy-unicode.el +++ b/src-util/anthy-unicode.el @@ -74,7 +74,8 @@ (defvar anthy-highlight-face nil) (defvar anthy-underline-face nil) (copy-face 'highlight 'anthy-highlight-face) -(set-face-underline 'anthy-highlight-face t) +(if (not (featurep 'xemacs)) + (set-face-underline 'anthy-highlight-face t)) (copy-face 'underline 'anthy-underline-face) ;; -- 2.33.1 From 255323305b3621286cc4025ac59fa7d37fa1e7ce Mon Sep 17 00:00:00 2001 From: fujiwarat Date: Fri, 6 May 2022 20:33:47 +0900 Subject: [PATCH] src-main/context.c: Code reviews --- src-main/context.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src-main/context.c b/src-main/context.c index 20dde71..d84858c 100644 --- a/src-main/context.c +++ b/src-main/context.c @@ -451,7 +451,7 @@ anthy_get_nth_segment(struct segment_list *sl, int n) n < 0) { return NULL; } - for (i = 0, se = sl->list_head.next; i < n; i++, se = se->next); + for (i = 0, se = sl->list_head.next; (i < n) && se; i++, se = se->next); return se; } @@ -499,6 +499,17 @@ get_change_state(struct anthy_context *ac) int i; for (i = 0; i < ac->seg_list.nr_segments; i++) { struct seg_ent *s = anthy_get_nth_segment(&ac->seg_list, i); + if (!ac->split_info.ce) { + anthy_log(0, "ac->split_info.ce is NULL %s:%d\n", __FILE__, __LINE__); + resize = 1; + break; + } + if (!s) { + anthy_log(0, "ac->seg_list %dth entry is NULL %s:%d\n", + i, __FILE__, __LINE__); + resize = 1; + continue; + } if (ac->split_info.ce[s->from].initial_seg_len != s->len) { resize = 1; } @@ -538,6 +549,11 @@ write_history(int fd, struct seg_ent *s = anthy_get_nth_segment(&ac->seg_list, i); char *c; /**/ + if (!s) { + anthy_log(0, "ac->seg_list %dth entry is NULL %s:%d\n", + i, __FILE__, __LINE__); + continue; + } if (s->committed < 0) { dprintf(fd, "?|"); continue ; @@ -647,9 +663,11 @@ print_segment(struct seg_ent *e) { int i; + assert(e); anthy_putxstr(&e->str); printf("("); for ( i = 0 ; i < e->nr_cands ; i++) { + assert(e->cands); anthy_print_candidate(e->cands[i]); printf(","); } -- 2.35.1 From 754f1c8b18ce0bf9c5e25541f4f4707d8a982811 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Thu, 9 Jun 2022 11:47:18 +0800 Subject: [PATCH] word_dic.c: rename master_dic_file to main_dic_file --- src-worddic/word_dic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src-worddic/word_dic.c b/src-worddic/word_dic.c index cc2cf89..0138d17 100644 --- a/src-worddic/word_dic.c +++ b/src-worddic/word_dic.c @@ -46,7 +46,7 @@ static int dic_init_count; /* 辞書 */ /* 全personalityで共有されるファイル辞書 */ -static struct word_dic *master_dic_file; +static struct word_dic *main_dic_file; /* 各パーソナリティごとの辞書 */ struct mem_dic *anthy_current_personal_dic_cache;/* キャッシュ */ @@ -89,7 +89,7 @@ anthy_cache_get_seq_ent(xstr *xs, int is_reverse) int anthy_dic_check_word_relation(int from, int to) { - return anthy_word_dic_check_word_relation(master_dic_file, from, to); + return anthy_word_dic_check_word_relation(main_dic_file, from, to); } static seq_ent_t @@ -349,7 +349,7 @@ do_gang_load_dic(xstr *sentence, int is_reverse) } qsort(array, nr, sizeof(struct gang_elm *), gang_elm_compare_func); /**/ - anthy_gang_fill_seq_ent(master_dic_file, array, nr, is_reverse); + anthy_gang_fill_seq_ent(main_dic_file, array, nr, is_reverse); /**/ scan_misc_dic(array, nr, is_reverse); /* 個人辞書から読む */ @@ -769,8 +769,8 @@ anthy_init_dic(void) anthy_init_features(); anthy_init_word_dic(); - master_dic_file = anthy_create_word_dic(); - if (!master_dic_file) { + main_dic_file = anthy_create_word_dic(); + if (!main_dic_file) { anthy_log(0, "Failed to create file dic.\n"); return -1; } -- 2.35.3