|
21 | 21 | Copyright (c) 2017 José Gutiérrez de la Concha <[email protected]>
|
22 | 22 | Copyright (c) 2019 David Loffredo <[email protected]>
|
23 | 23 | Copyright (c) 2021 Dong-hee Na <[email protected]>
|
| 24 | + Copyright (c) 2022 Martin Ettl <[email protected]> |
24 | 25 | Licensed under the MIT license:
|
25 | 26 |
|
26 | 27 | Permission is hereby granted, free of charge, to any person obtaining
|
@@ -296,7 +297,7 @@ sb_charMatches(const ENCODING *enc, const char *p, int c) {
|
296 | 297 | }
|
297 | 298 | #else
|
298 | 299 | /* c is an ASCII character */
|
299 |
| -# define CHAR_MATCHES(enc, p, c) (*(p) == c) |
| 300 | +# define CHAR_MATCHES(enc, p, c) (*(p) == (c)) |
300 | 301 | #endif
|
301 | 302 |
|
302 | 303 | #define PREFIX(ident) normal_##ident
|
@@ -740,7 +741,7 @@ DEFINE_UTF16_TO_UTF16(big2_)
|
740 | 741 | ((p)[1] == 0 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
|
741 | 742 | : unicode_byte_type((p)[1], (p)[0]))
|
742 | 743 | #define LITTLE2_BYTE_TO_ASCII(p) ((p)[1] == 0 ? (p)[0] : -1)
|
743 |
| -#define LITTLE2_CHAR_MATCHES(p, c) ((p)[1] == 0 && (p)[0] == c) |
| 744 | +#define LITTLE2_CHAR_MATCHES(p, c) ((p)[1] == 0 && (p)[0] == (c)) |
744 | 745 | #define LITTLE2_IS_NAME_CHAR_MINBPC(p) \
|
745 | 746 | UCS2_GET_NAMING(namePages, (unsigned char)p[1], (unsigned char)p[0])
|
746 | 747 | #define LITTLE2_IS_NMSTRT_CHAR_MINBPC(p) \
|
@@ -875,7 +876,7 @@ static const struct normal_encoding internal_little2_encoding
|
875 | 876 | ? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
|
876 | 877 | : unicode_byte_type((p)[0], (p)[1]))
|
877 | 878 | #define BIG2_BYTE_TO_ASCII(p) ((p)[0] == 0 ? (p)[1] : -1)
|
878 |
| -#define BIG2_CHAR_MATCHES(p, c) ((p)[0] == 0 && (p)[1] == c) |
| 879 | +#define BIG2_CHAR_MATCHES(p, c) ((p)[0] == 0 && (p)[1] == (c)) |
879 | 880 | #define BIG2_IS_NAME_CHAR_MINBPC(p) \
|
880 | 881 | UCS2_GET_NAMING(namePages, (unsigned char)p[0], (unsigned char)p[1])
|
881 | 882 | #define BIG2_IS_NMSTRT_CHAR_MINBPC(p) \
|
|
0 commit comments