Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/japanese/FreeWnn-lib/files/patch-Wnn-etc-hindo.c
18157 views
1
Index: Wnn/etc/hindo.c
2
===================================================================
3
RCS file: /home/cvs/private/hrs/freewnn/Wnn/etc/hindo.c,v
4
retrieving revision 1.1.1.1
5
retrieving revision 1.2
6
diff -u -p -r1.1.1.1 -r1.2
7
--- Wnn/etc/hindo.c 20 Dec 2008 07:13:30 -0000 1.1.1.1
8
+++ Wnn/etc/hindo.c 20 Dec 2008 15:22:40 -0000 1.2
9
@@ -5,7 +5,7 @@
10
/*
11
* FreeWnn is a network-extensible Kana-to-Kanji conversion system.
12
* This file is part of FreeWnn.
13
- *
14
+ *
15
* Copyright Kyoto University Research Institute for Mathematical Sciences
16
* 1987, 1988, 1989, 1990, 1991, 1992
17
* Copyright OMRON Corporation. 1987, 1988, 1989, 1990, 1991, 1992, 1999
18
@@ -49,8 +49,8 @@
19
�����٤�b�ΤȤ������٤ι����γ�Ψ�� 1 / ([b��4]��1)
20
â�� b��0�λ��ϡ����ٹ�����Ψ 0
21
22
-
23
- a == -1 <==> b == 0x7f = 127;
24
+
25
+ a == -1 <==> b == 0x7f = 127;
26
���λ������Υ���ȥ꡼�ϡ��Ѵ��˷褷���Ѥ����ʤ�
27
(�����ȥ����Ȥ���Ƥ���)���Ȥ�ɽ����
28
9/1/89 H.T.
29
@@ -58,47 +58,48 @@
30
31
/** ����������ʿ�����ؿ���â������<0�λ��Υ��顼�����å��Ϥʤ���0���֤��ˡ�*/
32
static int
33
-isqrt (i)
34
- int i;
35
+isqrt(int i)
36
{
37
- register int a, b;
38
+ register int a, b;
39
+
40
+ if (i <= 0)
41
+ return (0);
42
+
43
+ for (a = i, b = 1; b <<= 1, a >>= 2;);
44
+
45
+ while ((a = i / b) < b)
46
+ b = (b + a) >> 1;
47
48
- if (i <= 0)
49
- return (0);
50
- for (a = i, b = 1; b <<= 1, a >>= 2;);
51
- while ((a = i / b) < b)
52
- b = (b + a) >> 1;
53
- return (b);
54
+ return (b);
55
}
56
57
/** ������a��������b */
58
int
59
-asshuku (hin)
60
- int hin;
61
+asshuku(int hin)
62
{
63
- register int c;
64
+ register int c;
65
66
- if (hin == -1)
67
- return (127);
68
- if (hin <= 4)
69
- return (hin);
70
- /* ��Ⱦ������0�����ꤷ�ƤΥ��ԡ��ɥ��åס�motoni1,2�Ǥ�Ʊ�� */
71
-
72
- c = (isqrt ((hin <<= 1) + 1) + 1) & ~1;
73
- c += hin / c - 2;
74
- return (c < 126 ? c : 126);
75
+ if (hin == -1)
76
+ return (127);
77
+ if (hin <= 4)
78
+ return (hin);
79
+ /* ��Ⱦ������0�����ꤷ�ƤΥ��ԡ��ɥ��åס�motoni1,2�Ǥ�Ʊ�� */
80
+
81
+ c = (isqrt((hin <<= 1) + 1) + 1) & ~1;
82
+ c += hin / c - 2;
83
+
84
+ return (c < 126 ? c : 126);
85
}
86
87
/** ������b��������(min)a */
88
/*
89
int
90
-motoni1(hin)
91
-int hin;
92
+motoni1(int hin)
93
{
94
register int c;
95
96
if(hin == 127) return(-1);
97
- if(hin <= 4) return(hin);
98
+ if(hin <= 4) return(hin);
99
c = hin >> 2;
100
return( (hin - (c << 1)) * (c + 1) );
101
}
102
@@ -106,15 +107,17 @@ int hin;
103
104
/** ������b��������(mid)a */
105
int
106
-motoni2 (hin)
107
- int hin;
108
+motoni2(int hin)
109
{
110
- register int c;
111
+ register int c;
112
+
113
+ if (hin == 127)
114
+ return (-1);
115
+
116
+ if (hin <= 4)
117
+ return (hin);
118
+
119
+ c = hin >> 2;
120
121
- if (hin == 127)
122
- return (-1);
123
- if (hin <= 4)
124
- return (hin);
125
- c = hin >> 2;
126
- return ((hin - (c << 1)) * (c + 1) + (c >> 1));
127
+ return ((hin - (c << 1)) * (c + 1) + (c >> 1));
128
}
129
130