summaryrefslogtreecommitdiffhomepage
path: root/src/utf8code.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-01-02 10:33:04 +0100
committerTyge Løvset <[email protected]>2023-01-02 10:33:04 +0100
commit5c454e721656618c36674e0df676091106592c2d (patch)
tree95d7e4f6355c8fbfebd8aba5474ab90e3f13f120 /src/utf8code.c
parent8c6ba8a3444e4b8640e7fe04f565cef57c850432 (diff)
downloadSTC-modified-5c454e721656618c36674e0df676091106592c2d.tar.gz
STC-modified-5c454e721656618c36674e0df676091106592c2d.zip
Fixes prev. commit.
Diffstat (limited to 'src/utf8code.c')
-rw-r--r--src/utf8code.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/utf8code.c b/src/utf8code.c
index 6fe8515e..8f2ce107 100644
--- a/src/utf8code.c
+++ b/src/utf8code.c
@@ -125,7 +125,6 @@ typedef struct {
static const UGroup unicode_groups[];
static const int num_unicode_groups;
-static const int Lt_group;
bool utf8_isgroup(int group, uint32_t c) {
for (int j=0; j<unicode_groups[group].nr16; ++j) {
@@ -153,7 +152,7 @@ bool utf8_isalnum(uint32_t c) {
bool utf8_isalpha(uint32_t c) {
if (c < 128) return isalpha(c) != 0;
- return utf8_islower(c) || utf8_isupper(c) || utf8_isgroup(Lt_group, c);
+ return utf8_islower(c) || utf8_isupper(c) || utf8_isgroup(U8G_Lt, c);
}
static const URange16 Cc_range16[] = { // Control
@@ -321,24 +320,23 @@ static const URange16 Zs_range16[] = { // Space separator
};
#define UNI_ENTRY(Code) \
- { #Code, Code##_range16, sizeof(Code##_range16)/2 }
+ { #Code, Code##_range16, sizeof(Code##_range16)/(2*2) }
static const UGroup unicode_groups[] = {
- UNI_ENTRY(Cc),
- UNI_ENTRY(Lt),
- UNI_ENTRY(Nd),
- UNI_ENTRY(Nl),
- UNI_ENTRY(Pc),
- UNI_ENTRY(Pd),
- UNI_ENTRY(Pf),
- UNI_ENTRY(Pi),
- UNI_ENTRY(Sc),
- UNI_ENTRY(Zl),
- UNI_ENTRY(Zp),
- UNI_ENTRY(Zs),
+ [U8G_Cc] = UNI_ENTRY(Cc),
+ [U8G_Lt] = UNI_ENTRY(Lt),
+ [U8G_Nd] = UNI_ENTRY(Nd),
+ [U8G_Nl] = UNI_ENTRY(Nl),
+ [U8G_Pc] = UNI_ENTRY(Pc),
+ [U8G_Pd] = UNI_ENTRY(Pd),
+ [U8G_Pf] = UNI_ENTRY(Pf),
+ [U8G_Pi] = UNI_ENTRY(Pi),
+ [U8G_Sc] = UNI_ENTRY(Sc),
+ [U8G_Zl] = UNI_ENTRY(Zl),
+ [U8G_Zp] = UNI_ENTRY(Zp),
+ [U8G_Zs] = UNI_ENTRY(Zs),
};
-static const int Lt_group = 1;
static const int num_unicode_groups = sizeof unicode_groups / sizeof unicode_groups[0];
#endif