../3rdparty/pcre/pcre16_utf16_utils.c

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4 -
5 -
6int -
7pcre16_utf16_to_host_byte_order(unsigned short *output, const unsigned short * input, -
8 int length, int *host_byte_order, int keep_boms) -
9{ -
10 -
11 -
12 -
13int host_bo = host_byte_order != ((void *)0) ? *host_byte_order : 1;
never evaluated: host_byte_order != ((void *)0)
0
14pcre_uchar *optr = (pcre_uchar *)output; -
15const pcre_uchar *iptr = (const pcre_uchar *)input; -
16const pcre_uchar *end; -
17 -
18register pcre_uchar c; -
19 -
20if (length < 0)
never evaluated: length < 0
0
21 length = _pcre16_strlen_uc(iptr) + 1;
never executed: length = _pcre16_strlen_uc(iptr) + 1;
0
22end = iptr + length; -
23 -
24while (iptr < end)
never evaluated: iptr < end
0
25 { -
26 c = *iptr++; -
27 if (c == 0xfeff || c == 0xfffe)
never evaluated: c == 0xfeff
never evaluated: c == 0xfffe
0
28 { -
29 -
30 -
31 host_bo = c == 0xfeff; -
32 if (keep_boms != 0)
never evaluated: keep_boms != 0
0
33 *optr++ = 0xfeff;
never executed: *optr++ = 0xfeff;
0
34 else -
35 length--;
never executed: length--;
0
36 } -
37 else -
38 *optr++ = host_bo ? c : ((c >> 8) | (c << 8));
never evaluated: host_bo
never executed: *optr++ = host_bo ? c : ((c >> 8) | (c << 8));
0
39 } -
40if (host_byte_order != ((void *)0))
never evaluated: host_byte_order != ((void *)0)
0
41 *host_byte_order = host_bo;
never executed: *host_byte_order = host_bo;
0
42 -
43 -
44 -
45 -
46 -
47 -
48return length;
never executed: return length;
0
49} -
50 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial