qtsciicodec.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/corelib/codecs/qtsciicodec.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6static unsigned char qt_UnicodeToTSCII(ushort u1, ushort u2, ushort u3);-
7static unsigned int qt_TSCIIToUnicode(unsigned int code, uint *s);-
8QTsciiCodec::~QTsciiCodec()-
9{-
10}-
11-
12-
13-
14-
15-
16-
17-
18QByteArray QTsciiCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *state) const-
19{-
20 char replacement = '?';-
21 if (state
stateDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTextCodec
) {
0-3
22 if (state->flags & ConvertInvalidToNull
state->flags &...tInvalidToNullDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
23 replacement = 0;
never executed: replacement = 0;
0
24 }
never executed: end of block
0
25 int invalid = 0;-
26-
27 QByteArray rstr(len, Qt::Uninitialized);-
28 uchar* cursor = (uchar*)rstr.data();-
29 for (int i = 0; i < len
i < lenDescription
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QTextCodec
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTextCodec
; i++) {
3-12
30 QChar ch = uc[i];-
31 uchar j;-
32 if (ch.row() == 0x00
ch.row() == 0x00Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QTextCodec
FALSEnever evaluated
&& ch.cell() < 0x80
ch.cell() < 0x80Description
TRUEevaluated 12 times by 1 test
Evaluated by:
  • tst_QTextCodec
FALSEnever evaluated
) {
0-12
33-
34 j = ch.cell();-
35 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_QTextCodec
else if ((
(j = qt_Unicod...2].unicode()))Description
TRUEnever evaluated
FALSEnever evaluated
j = qt_UnicodeToTSCII(uc[i].unicode(),
(j = qt_Unicod...2].unicode()))Description
TRUEnever evaluated
FALSEnever evaluated
0-12
36 uc[i + 1].unicode(),
(j = qt_Unicod...2].unicode()))Description
TRUEnever evaluated
FALSEnever evaluated
0
37 uc[i + 2].unicode()))
(j = qt_Unicod...2].unicode()))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
38-
39 i += 2;-
40 }
never executed: end of block
else if ((
(j = qt_Unicod...unicode(), 0))Description
TRUEnever evaluated
FALSEnever evaluated
j = qt_UnicodeToTSCII(uc[i].unicode(),
(j = qt_Unicod...unicode(), 0))Description
TRUEnever evaluated
FALSEnever evaluated
0
41 uc[i + 1].unicode(), 0))
(j = qt_Unicod...unicode(), 0))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
42 i++;-
43 }
never executed: end of block
else if ((
(j = qt_Unicod...code(), 0, 0))Description
TRUEnever evaluated
FALSEnever evaluated
j = qt_UnicodeToTSCII(uc[i].unicode(), 0, 0))
(j = qt_Unicod...code(), 0, 0))Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
44 }
never executed: end of block
else {
0
45-
46 j = replacement;-
47 ++invalid;-
48 }
never executed: end of block
0
49 *cursor++ = j;-
50 }
executed 12 times by 1 test: end of block
Executed by:
  • tst_QTextCodec
12
51 rstr.resize(cursor - (const uchar*)rstr.constData());-
52-
53 if (state
stateDescription
TRUEnever evaluated
FALSEevaluated 3 times by 1 test
Evaluated by:
  • tst_QTextCodec
) {
0-3
54 state->invalidChars += invalid;-
55 }
never executed: end of block
0
56 return
executed 3 times by 1 test: return rstr;
Executed by:
  • tst_QTextCodec
rstr;
executed 3 times by 1 test: return rstr;
Executed by:
  • tst_QTextCodec
3
57}-
58-
59-
60-
61-
62-
63-
64-
65QString QTsciiCodec::convertToUnicode(const char* chars, int len, ConverterState *state) const-
66{-
67 QChar replacement = QChar::ReplacementCharacter;-
68 if (state
stateDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTextCodec
) {
0-2
69 if (state->flags & ConvertInvalidToNull
state->flags &...tInvalidToNullDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
70 replacement = QChar::Null;
never executed: replacement = QChar::Null;
0
71 }
never executed: end of block
0
72 int invalid = 0;-
73-
74 QString result;-
75 for (int i = 0; i < len
i < lenDescription
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QTextCodec
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTextCodec
; i++) {
2-9
76 uchar ch = chars[i];-
77 if (ch < 0x80
ch < 0x80Description
TRUEevaluated 9 times by 1 test
Evaluated by:
  • tst_QTextCodec
FALSEnever evaluated
) {
0-9
78-
79 result += QLatin1Char(ch);-
80 }
executed 9 times by 1 test: end of block
Executed by:
  • tst_QTextCodec
else if ((((
((ch) >= 0x80)Description
TRUEnever evaluated
FALSEnever evaluated
ch) >= 0x80)
((ch) >= 0x80)Description
TRUEnever evaluated
FALSEnever evaluated
&& ((
((ch) <= 0xfd)Description
TRUEnever evaluated
FALSEnever evaluated
ch) <= 0xfd)
((ch) <= 0xfd)Description
TRUEnever evaluated
FALSEnever evaluated
)) {
0-9
81-
82 uint s[3];-
83 uint u = qt_TSCIIToUnicode(ch, s);-
84 uint *p = s;-
85 while (u--
u--Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
86 uint c = *p++;-
87 if (c
cDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
88 result += QChar(c);
never executed: result += QChar(c);
0
89 else {-
90 result += replacement;-
91 ++invalid;-
92 }
never executed: end of block
0
93 }-
94 }
never executed: end of block
else {
0
95-
96 result += replacement;-
97 ++invalid;-
98 }
never executed: end of block
0
99 }-
100-
101 if (state
stateDescription
TRUEnever evaluated
FALSEevaluated 2 times by 1 test
Evaluated by:
  • tst_QTextCodec
) {
0-2
102 state->invalidChars += invalid;-
103 }
never executed: end of block
0
104 return
executed 2 times by 1 test: return result;
Executed by:
  • tst_QTextCodec
result;
executed 2 times by 1 test: return result;
Executed by:
  • tst_QTextCodec
2
105}-
106-
107-
108-
109-
110-
111-
112QByteArray QTsciiCodec::name() const-
113{-
114 return
executed 27 times by 1 test: return "TSCII";
Executed by:
  • tst_QTextCodec
"TSCII";
executed 27 times by 1 test: return "TSCII";
Executed by:
  • tst_QTextCodec
27
115}-
116-
117-
118-
119-
120-
121-
122int QTsciiCodec::mibEnum() const-
123{-
124 return
executed 113 times by 1 test: return 2107;
Executed by:
  • tst_QTextCodec
2107;
executed 113 times by 1 test: return 2107;
Executed by:
  • tst_QTextCodec
113
125}-
126-
127static const int UnToTsLast = 124;-
128static const ushort UnToTs [][4] = {-
129-
130-
131 {0x00A0, 0x0000, 0x0000, 0xA0},-
132 {0x00A9, 0x0000, 0x0000, 0xA9},-
133 {0x0B83, 0x0000, 0x0000, 0xB7},-
134 {0x0B85, 0x0000, 0x0000, 0xAB},-
135 {0x0B86, 0x0000, 0x0000, 0xAC},-
136 {0x0B87, 0x0000, 0x0000, 0xAD},-
137 {0x0B88, 0x0000, 0x0000, 0xAE},-
138 {0x0B89, 0x0000, 0x0000, 0xAF},-
139 {0x0B8A, 0x0000, 0x0000, 0xB0},-
140 {0x0B8E, 0x0000, 0x0000, 0xB1},-
141 {0x0B8F, 0x0000, 0x0000, 0xB2},-
142 {0x0B90, 0x0000, 0x0000, 0xB3},-
143 {0x0B92, 0x0000, 0x0000, 0xB4},-
144 {0x0B93, 0x0000, 0x0000, 0xB5},-
145 {0x0B94, 0x0000, 0x0000, 0xB6},-
146 {0x0B95, 0x0000, 0x0000, 0xB8},-
147 {0x0B95, 0x0B82, 0x0000, 0xEC},-
148 {0x0B95, 0x0BC1, 0x0000, 0xCC},-
149 {0x0B95, 0x0BC2, 0x0000, 0xDC},-
150 {0x0B99, 0x0000, 0x0000, 0xB9},-
151 {0x0B99, 0x0B82, 0x0000, 0xED},-
152 {0x0B99, 0x0BC1, 0x0000, 0x99},-
153 {0x0B99, 0x0BC2, 0x0000, 0x9B},-
154 {0x0B9A, 0x0000, 0x0000, 0xBA},-
155 {0x0B9A, 0x0B82, 0x0000, 0xEE},-
156 {0x0B9A, 0x0BC1, 0x0000, 0xCD},-
157 {0x0B9A, 0x0BC2, 0x0000, 0xDD},-
158 {0x0B9C, 0x0000, 0x0000, 0x83},-
159 {0x0B9C, 0x0B82, 0x0000, 0x88},-
160 {0x0B9E, 0x0000, 0x0000, 0xBB},-
161 {0x0B9E, 0x0B82, 0x0000, 0xEF},-
162 {0x0B9E, 0x0BC1, 0x0000, 0x9A},-
163 {0x0B9E, 0x0BC2, 0x0000, 0x9C},-
164 {0x0B9F, 0x0000, 0x0000, 0xBC},-
165 {0x0B9F, 0x0B82, 0x0000, 0xF0},-
166 {0x0B9F, 0x0BBF, 0x0000, 0xCA},-
167 {0x0B9F, 0x0BC0, 0x0000, 0xCB},-
168 {0x0B9F, 0x0BC1, 0x0000, 0xCE},-
169 {0x0B9F, 0x0BC2, 0x0000, 0xDE},-
170 {0x0BA1, 0x0B82, 0x0000, 0xF2},-
171 {0x0BA3, 0x0000, 0x0000, 0xBD},-
172 {0x0BA3, 0x0B82, 0x0000, 0xF1},-
173 {0x0BA3, 0x0BC1, 0x0000, 0xCF},-
174 {0x0BA3, 0x0BC2, 0x0000, 0xDF},-
175 {0x0BA4, 0x0000, 0x0000, 0xBE},-
176 {0x0BA4, 0x0BC1, 0x0000, 0xD0},-
177 {0x0BA4, 0x0BC2, 0x0000, 0xE0},-
178 {0x0BA8, 0x0000, 0x0000, 0xBF},-
179 {0x0BA8, 0x0B82, 0x0000, 0xF3},-
180 {0x0BA8, 0x0BC1, 0x0000, 0xD1},-
181 {0x0BA8, 0x0BC2, 0x0000, 0xE1},-
182 {0x0BA9, 0x0000, 0x0000, 0xC9},-
183 {0x0BA9, 0x0B82, 0x0000, 0xFD},-
184 {0x0BA9, 0x0BC1, 0x0000, 0xDB},-
185 {0x0BA9, 0x0BC2, 0x0000, 0xEB},-
186 {0x0BAA, 0x0000, 0x0000, 0xC0},-
187 {0x0BAA, 0x0B82, 0x0000, 0xF4},-
188 {0x0BAA, 0x0BC1, 0x0000, 0xD2},-
189 {0x0BAA, 0x0BC2, 0x0000, 0xE2},-
190 {0x0BAE, 0x0000, 0x0000, 0xC1},-
191 {0x0BAE, 0x0B82, 0x0000, 0xF5},-
192 {0x0BAE, 0x0BC1, 0x0000, 0xD3},-
193 {0x0BAE, 0x0BC2, 0x0000, 0xE3},-
194 {0x0BAF, 0x0000, 0x0000, 0xC2},-
195 {0x0BAF, 0x0B82, 0x0000, 0xF6},-
196 {0x0BAF, 0x0BC1, 0x0000, 0xD4},-
197 {0x0BAF, 0x0BC2, 0x0000, 0xE4},-
198 {0x0BB0, 0x0000, 0x0000, 0xC3},-
199 {0x0BB0, 0x0B82, 0x0000, 0xF7},-
200 {0x0BB0, 0x0BC1, 0x0000, 0xD5},-
201 {0x0BB0, 0x0BC2, 0x0000, 0xE5},-
202 {0x0BB1, 0x0000, 0x0000, 0xC8},-
203 {0x0BB1, 0x0B82, 0x0000, 0xFC},-
204 {0x0BB1, 0x0BC1, 0x0000, 0xDA},-
205 {0x0BB1, 0x0BC2, 0x0000, 0xEA},-
206 {0x0BB2, 0x0000, 0x0000, 0xC4},-
207 {0x0BB2, 0x0B82, 0x0000, 0xF8},-
208 {0x0BB2, 0x0BC1, 0x0000, 0xD6},-
209 {0x0BB2, 0x0BC2, 0x0000, 0xE6},-
210 {0x0BB3, 0x0000, 0x0000, 0xC7},-
211 {0x0BB3, 0x0B82, 0x0000, 0xFB},-
212 {0x0BB3, 0x0BC1, 0x0000, 0xD9},-
213 {0x0BB3, 0x0BC2, 0x0000, 0xE9},-
214 {0x0BB4, 0x0000, 0x0000, 0xC6},-
215 {0x0BB4, 0x0B82, 0x0000, 0xFA},-
216 {0x0BB4, 0x0BC1, 0x0000, 0xD8},-
217 {0x0BB4, 0x0BC2, 0x0000, 0xE8},-
218 {0x0BB5, 0x0000, 0x0000, 0xC5},-
219 {0x0BB5, 0x0B82, 0x0000, 0xF9},-
220 {0x0BB5, 0x0BC1, 0x0000, 0xD7},-
221 {0x0BB5, 0x0BC2, 0x0000, 0xE7},-
222 {0x0BB7, 0x0000, 0x0000, 0x84},-
223 {0x0BB7, 0x0B82, 0x0000, 0x89},-
224 {0x0BB8, 0x0000, 0x0000, 0x85},-
225 {0x0BB8, 0x0B82, 0x0000, 0x8A},-
226 {0x0BB9, 0x0000, 0x0000, 0x86},-
227 {0x0BB9, 0x0B82, 0x0000, 0x8B},-
228 {0x0BBE, 0x0000, 0x0000, 0xA1},-
229 {0x0BBF, 0x0000, 0x0000, 0xA2},-
230 {0x0BC0, 0x0000, 0x0000, 0xA3},-
231 {0x0BC1, 0x0000, 0x0000, 0xA4},-
232 {0x0BC2, 0x0000, 0x0000, 0xA5},-
233 {0x0BC6, 0x0000, 0x0000, 0xA6},-
234 {0x0BC7, 0x0000, 0x0000, 0xA7},-
235 {0x0BC8, 0x0000, 0x0000, 0xA8},-
236 {0x0BCC, 0x0000, 0x0000, 0xAA},-
237 {0x0BE6, 0x0000, 0x0000, 0x80},-
238 {0x0BE7, 0x0000, 0x0000, 0x81},-
239 {0x0BE7, 0x0BB7, 0x0000, 0x87},-
240 {0x0BE7, 0x0BB7, 0x0B82, 0x8C},-
241 {0x0BE8, 0x0000, 0x0000, 0x8D},-
242 {0x0BE9, 0x0000, 0x0000, 0x8E},-
243 {0x0BEA, 0x0000, 0x0000, 0x8F},-
244 {0x0BEB, 0x0000, 0x0000, 0x90},-
245 {0x0BEC, 0x0000, 0x0000, 0x95},-
246 {0x0BED, 0x0000, 0x0000, 0x96},-
247 {0x0BEE, 0x0000, 0x0000, 0x97},-
248 {0x0BEF, 0x0000, 0x0000, 0x98},-
249 {0x0BF0, 0x0000, 0x0000, 0x9D},-
250 {0x0BF1, 0x0000, 0x0000, 0x9E},-
251 {0x0BF2, 0x0000, 0x0000, 0x9F},-
252 {0x2018, 0x0000, 0x0000, 0x91},-
253 {0x2019, 0x0000, 0x0000, 0x92},-
254 {0x201C, 0x0000, 0x0000, 0x93},-
255 {0x201C, 0x0000, 0x0000, 0x94}-
256};-
257-
258static const ushort TsToUn [][3] = {-
259-
260 {0x0BE6, 0x0000, 0x0000},-
261 {0x0BE7, 0x0000, 0x0000},-
262 {0x0000, 0x0000, 0x0000},-
263 {0x0B9C, 0x0000, 0x0000},-
264 {0x0BB7, 0x0000, 0x0000},-
265 {0x0BB8, 0x0000, 0x0000},-
266 {0x0BB9, 0x0000, 0x0000},-
267 {0x0BE7, 0x0BB7, 0x0000},-
268 {0x0B9C, 0x0B82, 0x0000},-
269 {0x0BB7, 0x0B82, 0x0000},-
270 {0x0BB8, 0x0B82, 0x0000},-
271 {0x0BB9, 0x0B82, 0x0000},-
272 {0x0BE7, 0x0BB7, 0x0B82},-
273 {0x0BE8, 0x0000, 0x0000},-
274 {0x0BE9, 0x0000, 0x0000},-
275 {0x0BEA, 0x0000, 0x0000},-
276 {0x0BEB, 0x0000, 0x0000},-
277 {0x2018, 0x0000, 0x0000},-
278 {0x2019, 0x0000, 0x0000},-
279 {0x201C, 0x0000, 0x0000},-
280 {0x201C, 0x0000, 0x0000},-
281 {0x0BEC, 0x0000, 0x0000},-
282 {0x0BED, 0x0000, 0x0000},-
283 {0x0BEE, 0x0000, 0x0000},-
284 {0x0BEF, 0x0000, 0x0000},-
285 {0x0B99, 0x0BC1, 0x0000},-
286 {0x0B9E, 0x0BC1, 0x0000},-
287 {0x0B99, 0x0BC2, 0x0000},-
288 {0x0B9E, 0x0BC2, 0x0000},-
289 {0x0BF0, 0x0000, 0x0000},-
290 {0x0BF1, 0x0000, 0x0000},-
291 {0x0BF2, 0x0000, 0x0000},-
292 {0x00A0, 0x0000, 0x0000},-
293 {0x0BBE, 0x0000, 0x0000},-
294 {0x0BBF, 0x0000, 0x0000},-
295 {0x0BC0, 0x0000, 0x0000},-
296 {0x0BC1, 0x0000, 0x0000},-
297 {0x0BC2, 0x0000, 0x0000},-
298 {0x0BC6, 0x0000, 0x0000},-
299 {0x0BC7, 0x0000, 0x0000},-
300 {0x0BC8, 0x0000, 0x0000},-
301 {0x00A9, 0x0000, 0x0000},-
302 {0x0BCC, 0x0000, 0x0000},-
303 {0x0B85, 0x0000, 0x0000},-
304 {0x0B86, 0x0000, 0x0000},-
305 {0x0B87, 0x0000, 0x0000},-
306 {0x0B88, 0x0000, 0x0000},-
307 {0x0B89, 0x0000, 0x0000},-
308 {0x0B8A, 0x0000, 0x0000},-
309 {0x0B8E, 0x0000, 0x0000},-
310 {0x0B8F, 0x0000, 0x0000},-
311 {0x0B90, 0x0000, 0x0000},-
312 {0x0B92, 0x0000, 0x0000},-
313 {0x0B93, 0x0000, 0x0000},-
314 {0x0B94, 0x0000, 0x0000},-
315 {0x0B83, 0x0000, 0x0000},-
316 {0x0B95, 0x0000, 0x0000},-
317 {0x0B99, 0x0000, 0x0000},-
318 {0x0B9A, 0x0000, 0x0000},-
319 {0x0B9E, 0x0000, 0x0000},-
320 {0x0B9F, 0x0000, 0x0000},-
321 {0x0BA3, 0x0000, 0x0000},-
322 {0x0BA4, 0x0000, 0x0000},-
323 {0x0BA8, 0x0000, 0x0000},-
324 {0x0BAA, 0x0000, 0x0000},-
325 {0x0BAE, 0x0000, 0x0000},-
326 {0x0BAF, 0x0000, 0x0000},-
327 {0x0BB0, 0x0000, 0x0000},-
328 {0x0BB2, 0x0000, 0x0000},-
329 {0x0BB5, 0x0000, 0x0000},-
330 {0x0BB4, 0x0000, 0x0000},-
331 {0x0BB3, 0x0000, 0x0000},-
332 {0x0BB1, 0x0000, 0x0000},-
333 {0x0BA9, 0x0000, 0x0000},-
334 {0x0B9F, 0x0BBF, 0x0000},-
335 {0x0B9F, 0x0BC0, 0x0000},-
336 {0x0B95, 0x0BC1, 0x0000},-
337 {0x0B9A, 0x0BC1, 0x0000},-
338 {0x0B9F, 0x0BC1, 0x0000},-
339 {0x0BA3, 0x0BC1, 0x0000},-
340 {0x0BA4, 0x0BC1, 0x0000},-
341 {0x0BA8, 0x0BC1, 0x0000},-
342 {0x0BAA, 0x0BC1, 0x0000},-
343 {0x0BAE, 0x0BC1, 0x0000},-
344 {0x0BAF, 0x0BC1, 0x0000},-
345 {0x0BB0, 0x0BC1, 0x0000},-
346 {0x0BB2, 0x0BC1, 0x0000},-
347 {0x0BB5, 0x0BC1, 0x0000},-
348 {0x0BB4, 0x0BC1, 0x0000},-
349 {0x0BB3, 0x0BC1, 0x0000},-
350 {0x0BB1, 0x0BC1, 0x0000},-
351 {0x0BA9, 0x0BC1, 0x0000},-
352 {0x0B95, 0x0BC2, 0x0000},-
353 {0x0B9A, 0x0BC2, 0x0000},-
354 {0x0B9F, 0x0BC2, 0x0000},-
355 {0x0BA3, 0x0BC2, 0x0000},-
356 {0x0BA4, 0x0BC2, 0x0000},-
357 {0x0BA8, 0x0BC2, 0x0000},-
358 {0x0BAA, 0x0BC2, 0x0000},-
359 {0x0BAE, 0x0BC2, 0x0000},-
360 {0x0BAF, 0x0BC2, 0x0000},-
361 {0x0BB0, 0x0BC2, 0x0000},-
362 {0x0BB2, 0x0BC2, 0x0000},-
363 {0x0BB5, 0x0BC2, 0x0000},-
364 {0x0BB4, 0x0BC2, 0x0000},-
365 {0x0BB3, 0x0BC2, 0x0000},-
366 {0x0BB1, 0x0BC2, 0x0000},-
367 {0x0BA9, 0x0BC2, 0x0000},-
368 {0x0B95, 0x0B82, 0x0000},-
369 {0x0B99, 0x0B82, 0x0000},-
370 {0x0B9A, 0x0B82, 0x0000},-
371 {0x0B9E, 0x0B82, 0x0000},-
372 {0x0B9F, 0x0B82, 0x0000},-
373 {0x0BA3, 0x0B82, 0x0000},-
374 {0x0BA1, 0x0B82, 0x0000},-
375 {0x0BA8, 0x0B82, 0x0000},-
376 {0x0BAA, 0x0B82, 0x0000},-
377 {0x0BAE, 0x0B82, 0x0000},-
378 {0x0BAF, 0x0B82, 0x0000},-
379 {0x0BB0, 0x0B82, 0x0000},-
380 {0x0BB2, 0x0B82, 0x0000},-
381 {0x0BB5, 0x0B82, 0x0000},-
382 {0x0BB4, 0x0B82, 0x0000},-
383 {0x0BB3, 0x0B82, 0x0000},-
384 {0x0BB1, 0x0B82, 0x0000},-
385 {0x0BA9, 0x0B82, 0x0000}-
386};-
387-
388static int cmp(const ushort *s1, const ushort *s2, size_t len)-
389{-
390 int diff = 0;-
391-
392 while (len--
len--Description
TRUEnever evaluated
FALSEnever evaluated
&& (
(diff = *s1++ - *s2++) == 0Description
TRUEnever evaluated
FALSEnever evaluated
diff = *s1++ - *s2++) == 0
(diff = *s1++ - *s2++) == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
393 ;
never executed: ;
0
394-
395 return
never executed: return diff;
diff;
never executed: return diff;
0
396}-
397-
398static unsigned char qt_UnicodeToTSCII(ushort u1, ushort u2, ushort u3)-
399{-
400 ushort s[3];-
401 s[0] = u1;-
402 s[1] = u2;-
403 s[2] = u3;-
404-
405 int a = 0;-
406 int b = UnToTsLast;-
407-
408-
409 while (a <= b
a <= bDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
410 int w = (a + b) / 2;-
411 int j = cmp(UnToTs[w], s, 3);-
412-
413 if (j == 0
j == 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
414-
415 return
never executed: return UnToTs[w][3];
UnToTs[w][3];
never executed: return UnToTs[w][3];
0
416-
417 if (j < 0
j < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
418 a = w + 1;
never executed: a = w + 1;
0
419 else-
420 b = w - 1;
never executed: b = w - 1;
0
421 }-
422-
423 return
never executed: return 0;
0;
never executed: return 0;
0
424}-
425-
426static unsigned int qt_TSCIIToUnicode(uint code, uint *s)-
427{-
428 int len = 0;-
429 for (int i = 0; i < 3
i < 3Description
TRUEnever evaluated
FALSEnever evaluated
; i++) {
0
430 uint u = TsToUn[code & 0x7f][i];-
431 s[i] = u;-
432 if (s[i]
s[i]Description
TRUEnever evaluated
FALSEnever evaluated
) len = i + 1;
never executed: len = i + 1;
0
433 }
never executed: end of block
0
434-
435 return
never executed: return len;
len;
never executed: return len;
0
436}-
437-
438-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9