Skip to content

Commit c61d24f

Browse files
committed
Fix all LSP errors and format the code.
1 parent 3984ac9 commit c61d24f

File tree

238 files changed

+17149
-12943
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+17149
-12943
lines changed

lib/converters.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,6 @@
112112
#include "converters/viscii.h"
113113
#pragma endregion
114114

115-
/* [CCS = coded character set] [CJKV.INF chapter 3] */
116-
typedef struct
117-
{
118-
unsigned short indx; /* Index into big table. */
119-
unsigned short used; /* Bitmask of used entries. */
120-
} Summary16;
121-
122115
#pragma region CJK character sets
123116
#include "converters/iso646_jp.h"
124117
#include "converters/jisx0201.h"

lib/converters/armscii_8.h

Lines changed: 51 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
/**
2+
* @file armscii_8.h
3+
* @brief ARMSCII-8
4+
* @copyright Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
5+
* @copyright Copyright (C) 2024 The C++ Plus Project.
6+
*/
17
/*
2-
* Copyright (C) 1999-2002, 2016 Free Software Foundation, Inc.
38
* This file is part of the cppp-reiconv library.
49
*
510
* The cppp-reiconv library is free software; you can redistribute it
@@ -17,9 +22,10 @@
1722
* If not, see <https://www.gnu.org/licenses/>.
1823
*/
1924

20-
/*
21-
* ARMSCII-8
22-
*/
25+
#ifndef _ARMSCII_8_H_
26+
#define _ARMSCII_8_H_
27+
28+
#include "reiconv_defines.h"
2329

2430
static const unsigned short armscii_8_2uni[96] = {
2531
/* 0xa0 */
@@ -42,22 +48,24 @@ static const unsigned short armscii_8_2uni[96] = {
4248
0x0554, 0x0584, 0x0555, 0x0585, 0x0556, 0x0586, 0x055a, 0xfffd,
4349
};
4450

45-
static int
46-
armscii_8_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
51+
static int armscii_8_mbtowc(conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
4752
{
48-
unsigned char c = *s;
49-
if (c < 0xa0) {
50-
*pwc = (ucs4_t) c;
51-
return 1;
52-
}
53-
else {
54-
unsigned short wc = armscii_8_2uni[c-0xa0];
55-
if (wc != 0xfffd) {
56-
*pwc = (ucs4_t) wc;
57-
return 1;
53+
unsigned char c = *s;
54+
if (c < 0xa0)
55+
{
56+
*pwc = (ucs4_t)c;
57+
return 1;
5858
}
59-
}
60-
return RET_ILSEQ;
59+
else
60+
{
61+
unsigned short wc = armscii_8_2uni[c - 0xa0];
62+
if (wc != 0xfffd)
63+
{
64+
*pwc = (ucs4_t)wc;
65+
return 1;
66+
}
67+
}
68+
return RET_ILSEQ;
6169
}
6270

6371
static const unsigned char armscii_8_page00[8] = {
@@ -89,27 +97,30 @@ static const unsigned char armscii_8_page20[24] = {
8997
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xae, 0x00, /* 0x20-0x27 */
9098
};
9199

92-
static int
93-
armscii_8_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
100+
static int armscii_8_wctomb(conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
94101
{
95-
unsigned char c = 0;
96-
if (wc < 0x0028) {
97-
*r = wc;
98-
return 1;
99-
}
100-
else if (wc >= 0x0028 && wc < 0x0030)
101-
c = armscii_8_page00[wc-0x0028];
102-
else if (wc >= 0x0030 && wc < 0x00a0)
103-
c = wc;
104-
else if (wc >= 0x00a0 && wc < 0x00c0)
105-
c = armscii_8_page00_1[wc-0x00a0];
106-
else if (wc >= 0x0530 && wc < 0x0590)
107-
c = armscii_8_page05[wc-0x0530];
108-
else if (wc >= 0x2010 && wc < 0x2028)
109-
c = armscii_8_page20[wc-0x2010];
110-
if (c != 0) {
111-
*r = c;
112-
return 1;
113-
}
114-
return RET_ILUNI;
102+
unsigned char c = 0;
103+
if (wc < 0x0028)
104+
{
105+
*r = wc;
106+
return 1;
107+
}
108+
else if (wc >= 0x0028 && wc < 0x0030)
109+
c = armscii_8_page00[wc - 0x0028];
110+
else if (wc >= 0x0030 && wc < 0x00a0)
111+
c = wc;
112+
else if (wc >= 0x00a0 && wc < 0x00c0)
113+
c = armscii_8_page00_1[wc - 0x00a0];
114+
else if (wc >= 0x0530 && wc < 0x0590)
115+
c = armscii_8_page05[wc - 0x0530];
116+
else if (wc >= 0x2010 && wc < 0x2028)
117+
c = armscii_8_page20[wc - 0x2010];
118+
if (c != 0)
119+
{
120+
*r = c;
121+
return 1;
122+
}
123+
return RET_ILUNI;
115124
}
125+
126+
#endif /* _ARMSCII_8_H_ */

lib/converters/ascii.h

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
/**
2+
* @file ascii.h
3+
* @brief ASCII
4+
* @copyright Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
5+
* @copyright Copyright (C) 2024 The C++ Plus Project.
6+
*/
17
/*
2-
* Copyright (C) 1999-2001, 2016 Free Software Foundation, Inc.
38
* This file is part of the cppp-reiconv library.
49
*
510
* The cppp-reiconv library is free software; you can redistribute it
@@ -17,27 +22,30 @@
1722
* If not, see <https://www.gnu.org/licenses/>.
1823
*/
1924

20-
/*
21-
* ASCII
22-
*/
25+
#ifndef _ASCII_H_
26+
#define _ASCII_H_
2327

24-
static int
25-
ascii_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
28+
#include "reiconv_defines.h"
29+
30+
static int ascii_mbtowc(conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
2631
{
27-
unsigned char c = *s;
28-
if (c < 0x80) {
29-
*pwc = (ucs4_t) c;
30-
return 1;
31-
}
32-
return RET_ILSEQ;
32+
unsigned char c = *s;
33+
if (c < 0x80)
34+
{
35+
*pwc = (ucs4_t)c;
36+
return 1;
37+
}
38+
return RET_ILSEQ;
3339
}
3440

35-
static int
36-
ascii_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
41+
static int ascii_wctomb(conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
3742
{
38-
if (wc < 0x0080) {
39-
*r = wc;
40-
return 1;
41-
}
42-
return RET_ILUNI;
43+
if (wc < 0x0080)
44+
{
45+
*r = wc;
46+
return 1;
47+
}
48+
return RET_ILUNI;
4349
}
50+
51+
#endif /* _ASCII_H_ */

lib/converters/atarist.h

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
/**
2+
* @file atarist.h
3+
* @brief Atari ST
4+
* @copyright Copyright (C) 1999-2005, 2016 Free Software Foundation, Inc.
5+
* @copyright Copyright (C) 2024 The C++ Plus Project.
6+
*/
17
/*
2-
* Copyright (C) 1999-2005, 2016 Free Software Foundation, Inc.
38
* This file is part of the cppp-reiconv library.
49
*
510
* The cppp-reiconv library is free software; you can redistribute it
@@ -17,9 +22,10 @@
1722
* If not, see <https://www.gnu.org/licenses/>.
1823
*/
1924

20-
/*
21-
* Atari ST
22-
*/
25+
#ifndef _ATARIST_H_
26+
#define _ATARIST_H_
27+
28+
#include "reiconv_defines.h"
2329

2430
static const unsigned short atarist_2uni[128] = {
2531
/* 0x80 */
@@ -48,15 +54,14 @@ static const unsigned short atarist_2uni[128] = {
4854
0x00b0, 0x2219, 0x00b7, 0x221a, 0x207f, 0x00b2, 0x00b3, 0x00af,
4955
};
5056

51-
static int
52-
atarist_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
57+
static int atarist_mbtowc(conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
5358
{
54-
unsigned char c = *s;
55-
if (c < 0x80)
56-
*pwc = (ucs4_t) c;
57-
else
58-
*pwc = (ucs4_t) atarist_2uni[c-0x80];
59-
return 1;
59+
unsigned char c = *s;
60+
if (c < 0x80)
61+
*pwc = (ucs4_t)c;
62+
else
63+
*pwc = (ucs4_t)atarist_2uni[c - 0x80];
64+
return 1;
6065
}
6166

6267
static const unsigned char atarist_page00[96] = {
@@ -123,35 +128,38 @@ static const unsigned char atarist_page23[24] = {
123128
0xf4, 0xf5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */
124129
};
125130

126-
static int
127-
atarist_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
131+
static int atarist_wctomb(conv_t conv, unsigned char *r, ucs4_t wc, size_t n)
128132
{
129-
unsigned char c = 0;
130-
if (wc < 0x0080) {
131-
*r = wc;
132-
return 1;
133-
}
134-
else if (wc >= 0x00a0 && wc < 0x0100)
135-
c = atarist_page00[wc-0x00a0];
136-
else if (wc >= 0x0130 && wc < 0x0198)
137-
c = atarist_page01[wc-0x0130];
138-
else if (wc >= 0x0390 && wc < 0x03c8)
139-
c = atarist_page03[wc-0x0390];
140-
else if (wc >= 0x05d0 && wc < 0x05f0)
141-
c = atarist_page05[wc-0x05d0];
142-
else if (wc == 0x2020)
143-
c = 0xbb;
144-
else if (wc == 0x207f)
145-
c = 0xfc;
146-
else if (wc == 0x2122)
147-
c = 0xbf;
148-
else if (wc >= 0x2208 && wc < 0x2268)
149-
c = atarist_page22[wc-0x2208];
150-
else if (wc >= 0x2310 && wc < 0x2328)
151-
c = atarist_page23[wc-0x2310];
152-
if (c != 0) {
153-
*r = c;
154-
return 1;
155-
}
156-
return RET_ILUNI;
133+
unsigned char c = 0;
134+
if (wc < 0x0080)
135+
{
136+
*r = wc;
137+
return 1;
138+
}
139+
else if (wc >= 0x00a0 && wc < 0x0100)
140+
c = atarist_page00[wc - 0x00a0];
141+
else if (wc >= 0x0130 && wc < 0x0198)
142+
c = atarist_page01[wc - 0x0130];
143+
else if (wc >= 0x0390 && wc < 0x03c8)
144+
c = atarist_page03[wc - 0x0390];
145+
else if (wc >= 0x05d0 && wc < 0x05f0)
146+
c = atarist_page05[wc - 0x05d0];
147+
else if (wc == 0x2020)
148+
c = 0xbb;
149+
else if (wc == 0x207f)
150+
c = 0xfc;
151+
else if (wc == 0x2122)
152+
c = 0xbf;
153+
else if (wc >= 0x2208 && wc < 0x2268)
154+
c = atarist_page22[wc - 0x2208];
155+
else if (wc >= 0x2310 && wc < 0x2328)
156+
c = atarist_page23[wc - 0x2310];
157+
if (c != 0)
158+
{
159+
*r = c;
160+
return 1;
161+
}
162+
return RET_ILUNI;
157163
}
164+
165+
#endif /* _ATARIST_H_ */

0 commit comments

Comments
 (0)