Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Linux kernel RD
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitry Osipenko
Linux kernel RD
Commits
2026a1ae
Commit
2026a1ae
authored
May 26, 2022
by
Stephen Rothwell
Browse files
Options
Downloads
Plain Diff
Merge branch 'for-next' of
git://git.kernel.org/pub/scm/linux/kernel/git/krisman/unicode.git
parents
8a7b12f3
b500d6d7
Branches
Branches containing commit
Tags
v7.0.0-rc1
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fs/unicode/mkutf8data.c
+24
-14
24 additions, 14 deletions
fs/unicode/mkutf8data.c
with
24 additions
and
14 deletions
fs/unicode/mkutf8data.c
+
24
−
14
View file @
2026a1ae
...
@@ -486,6 +486,16 @@ static void tree_walk(struct tree *tree)
...
@@ -486,6 +486,16 @@ static void tree_walk(struct tree *tree)
nodes
,
leaves
,
singletons
);
nodes
,
leaves
,
singletons
);
}
}
static
void
*
xmalloc
(
size_t
size
)
{
void
*
p
=
malloc
(
size
);
if
(
p
)
return
p
;
fprintf
(
stderr
,
"Out of memory.
\n
"
);
exit
(
1
);
}
/*
/*
* Allocate an initialize a new internal node.
* Allocate an initialize a new internal node.
*/
*/
...
@@ -494,7 +504,7 @@ static struct node *alloc_node(struct node *parent)
...
@@ -494,7 +504,7 @@ static struct node *alloc_node(struct node *parent)
struct
node
*
node
;
struct
node
*
node
;
int
bitnum
;
int
bitnum
;
node
=
malloc
(
sizeof
(
*
node
));
node
=
x
malloc
(
sizeof
(
*
node
));
node
->
left
=
node
->
right
=
NULL
;
node
->
left
=
node
->
right
=
NULL
;
node
->
parent
=
parent
;
node
->
parent
=
parent
;
node
->
leftnode
=
NODE
;
node
->
leftnode
=
NODE
;
...
@@ -2159,7 +2169,7 @@ static void nfdi_init(void)
...
@@ -2159,7 +2169,7 @@ static void nfdi_init(void)
}
}
mapping
[
i
++
]
=
0
;
mapping
[
i
++
]
=
0
;
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdi
=
um
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
...
@@ -2215,7 +2225,7 @@ static void nfdicf_init(void)
...
@@ -2215,7 +2225,7 @@ static void nfdicf_init(void)
}
}
mapping
[
i
++
]
=
0
;
mapping
[
i
++
]
=
0
;
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
...
@@ -2256,11 +2266,11 @@ static void ignore_init(void)
...
@@ -2256,11 +2266,11 @@ static void ignore_init(void)
line_fail
(
prop_name
,
line
);
line_fail
(
prop_name
,
line
);
for
(
unichar
=
first
;
unichar
<=
last
;
unichar
++
)
{
for
(
unichar
=
first
;
unichar
<=
last
;
unichar
++
)
{
free
(
unicode_data
[
unichar
].
utf32nfdi
);
free
(
unicode_data
[
unichar
].
utf32nfdi
);
um
=
malloc
(
sizeof
(
unsigned
int
));
um
=
x
malloc
(
sizeof
(
unsigned
int
));
*
um
=
0
;
*
um
=
0
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
free
(
unicode_data
[
unichar
].
utf32nfdicf
);
free
(
unicode_data
[
unichar
].
utf32nfdicf
);
um
=
malloc
(
sizeof
(
unsigned
int
));
um
=
x
malloc
(
sizeof
(
unsigned
int
));
*
um
=
0
;
*
um
=
0
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
count
++
;
count
++
;
...
@@ -2277,11 +2287,11 @@ static void ignore_init(void)
...
@@ -2277,11 +2287,11 @@ static void ignore_init(void)
if
(
!
utf32valid
(
unichar
))
if
(
!
utf32valid
(
unichar
))
line_fail
(
prop_name
,
line
);
line_fail
(
prop_name
,
line
);
free
(
unicode_data
[
unichar
].
utf32nfdi
);
free
(
unicode_data
[
unichar
].
utf32nfdi
);
um
=
malloc
(
sizeof
(
unsigned
int
));
um
=
x
malloc
(
sizeof
(
unsigned
int
));
*
um
=
0
;
*
um
=
0
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
free
(
unicode_data
[
unichar
].
utf32nfdicf
);
free
(
unicode_data
[
unichar
].
utf32nfdicf
);
um
=
malloc
(
sizeof
(
unsigned
int
));
um
=
x
malloc
(
sizeof
(
unsigned
int
));
*
um
=
0
;
*
um
=
0
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
if
(
verbose
>
1
)
if
(
verbose
>
1
)
...
@@ -2359,7 +2369,7 @@ static void corrections_init(void)
...
@@ -2359,7 +2369,7 @@ static void corrections_init(void)
}
}
mapping
[
i
++
]
=
0
;
mapping
[
i
++
]
=
0
;
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
corrections
[
count
].
utf32nfdi
=
um
;
corrections
[
count
].
utf32nfdi
=
um
;
...
@@ -2459,12 +2469,12 @@ static void hangul_decompose(void)
...
@@ -2459,12 +2469,12 @@ static void hangul_decompose(void)
mapping
[
i
++
]
=
0
;
mapping
[
i
++
]
=
0
;
assert
(
!
unicode_data
[
unichar
].
utf32nfdi
);
assert
(
!
unicode_data
[
unichar
].
utf32nfdi
);
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdi
=
um
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
assert
(
!
unicode_data
[
unichar
].
utf32nfdicf
);
assert
(
!
unicode_data
[
unichar
].
utf32nfdicf
);
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
...
@@ -2473,7 +2483,7 @@ static void hangul_decompose(void)
...
@@ -2473,7 +2483,7 @@ static void hangul_decompose(void)
* decompositions must not be stored in the generated
* decompositions must not be stored in the generated
* trie.
* trie.
*/
*/
unicode_data
[
unichar
].
utf8nfdi
=
malloc
(
2
);
unicode_data
[
unichar
].
utf8nfdi
=
x
malloc
(
2
);
unicode_data
[
unichar
].
utf8nfdi
[
0
]
=
HANGUL
;
unicode_data
[
unichar
].
utf8nfdi
[
0
]
=
HANGUL
;
unicode_data
[
unichar
].
utf8nfdi
[
1
]
=
'\0'
;
unicode_data
[
unichar
].
utf8nfdi
[
1
]
=
'\0'
;
...
@@ -2523,13 +2533,13 @@ static void nfdi_decompose(void)
...
@@ -2523,13 +2533,13 @@ static void nfdi_decompose(void)
if
(
ret
)
if
(
ret
)
break
;
break
;
free
(
unicode_data
[
unichar
].
utf32nfdi
);
free
(
unicode_data
[
unichar
].
utf32nfdi
);
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdi
=
um
;
unicode_data
[
unichar
].
utf32nfdi
=
um
;
}
}
/* Add this decomposition to nfdicf if there is no entry. */
/* Add this decomposition to nfdicf if there is no entry. */
if
(
!
unicode_data
[
unichar
].
utf32nfdicf
)
{
if
(
!
unicode_data
[
unichar
].
utf32nfdicf
)
{
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
}
}
...
@@ -2577,7 +2587,7 @@ static void nfdicf_decompose(void)
...
@@ -2577,7 +2587,7 @@ static void nfdicf_decompose(void)
if
(
ret
)
if
(
ret
)
break
;
break
;
free
(
unicode_data
[
unichar
].
utf32nfdicf
);
free
(
unicode_data
[
unichar
].
utf32nfdicf
);
um
=
malloc
(
i
*
sizeof
(
unsigned
int
));
um
=
x
malloc
(
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
memcpy
(
um
,
mapping
,
i
*
sizeof
(
unsigned
int
));
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
unicode_data
[
unichar
].
utf32nfdicf
=
um
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment