Skip to content

Commit 6d1a756

Browse files
committed
Fix type-conflict warning when in clang.
修改: ChangeLog 修改: lib/cp950ext.h 修改: lib/hkscs2001.h 修改: lib/hkscs2008.h
1 parent 99c92c1 commit 6d1a756

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-08-29 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
2+
3+
Fix type-conflict warning when in clang.
4+
15
2023-08-27 ChenPi11 <wushengwuxi-msctinoulk@outlook.com>
26

37
Add codepage definitions.

lib/cp950ext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static int
3535
cp950ext_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
3636
{
3737
unsigned char c1 = s[0];
38-
if ((c1 == 0xf9)) {
38+
if ((c1 == (unsigned char)0xf9)) {
3939
if (n >= 2) {
4040
unsigned char c2 = s[1];
4141
if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {

lib/hkscs2001.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static int
5959
hkscs2001_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
6060
{
6161
unsigned char c1 = s[0];
62-
if ((c1 == 0x8c)) {
62+
if ((c1 == (unsigned char)0x8c)) {
6363
if (n >= 2) {
6464
unsigned char c2 = s[1];
6565
if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {

lib/hkscs2008.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static int
5555
hkscs2008_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, size_t n)
5656
{
5757
unsigned char c1 = s[0];
58-
if ((c1 == 0x87)) {
58+
if ((c1 == (unsigned char)0x87)) {
5959
if (n >= 2) {
6060
unsigned char c2 = s[1];
6161
if ((c2 >= 0x40 && c2 < 0x7f) || (c2 >= 0xa1 && c2 < 0xff)) {

0 commit comments

Comments
 (0)