Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
d5b7c595
Commit
d5b7c595
authored
9 years ago
by
Scott Lahteine
Committed by
Richard Wackerbarth
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use static locals in utf_mapper.h
parent
9bdab4f3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/utf_mapper.h
+14
-11
14 additions, 11 deletions
Marlin/utf_mapper.h
with
14 additions
and
11 deletions
Marlin/utf_mapper.h
+
14
−
11
View file @
d5b7c595
...
@@ -130,9 +130,10 @@
...
@@ -130,9 +130,10 @@
}
}
#elif ENABLED(MAPPER_C2C3)
#elif ENABLED(MAPPER_C2C3)
uint8_t
utf_hi_char
;
// UTF-8 high part
bool
seen_c2
=
false
;
char
charset_mapper
(
char
c
)
{
char
charset_mapper
(
char
c
){
static
uint8_t
utf_hi_char
;
// UTF-8 high part
static
bool
seen_c2
=
false
;
uint8_t
d
=
c
;
uint8_t
d
=
c
;
if
(
d
>=
0x80
)
{
// UTF-8 handling
if
(
d
>=
0x80
)
{
// UTF-8 handling
if
(
(
d
>=
0xc0
)
&&
(
!
seen_c2
)
)
{
if
(
(
d
>=
0xc0
)
&&
(
!
seen_c2
)
)
{
...
@@ -160,12 +161,12 @@
...
@@ -160,12 +161,12 @@
}
}
#elif ENABLED(MAPPER_D0D1_MOD)
#elif ENABLED(MAPPER_D0D1_MOD)
uint8_t
utf_hi_char
;
// UTF-8 high part
bool
seen_d5
=
false
;
char
charset_mapper
(
char
c
)
{
char
charset_mapper
(
char
c
)
{
// it is a Russian alphabet translation
// it is a Russian alphabet translation
// except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
// except 0401 --> 0xa2 = Ё, 0451 --> 0xb5 = ё
static
uint8_t
utf_hi_char
;
// UTF-8 high part
static
bool
seen_d5
=
false
;
uint8_t
d
=
c
;
uint8_t
d
=
c
;
if
(
d
>=
0x80
)
{
// UTF-8 handling
if
(
d
>=
0x80
)
{
// UTF-8 handling
if
(
d
>=
0xd0
&&
!
seen_d5
)
{
if
(
d
>=
0xd0
&&
!
seen_d5
)
{
...
@@ -197,9 +198,10 @@
...
@@ -197,9 +198,10 @@
}
}
#elif ENABLED(MAPPER_D0D1)
#elif ENABLED(MAPPER_D0D1)
uint8_t
utf_hi_char
;
// UTF-8 high part
bool
seen_d5
=
false
;
char
charset_mapper
(
char
c
)
{
char
charset_mapper
(
char
c
)
{
static
uint8_t
utf_hi_char
;
// UTF-8 high part
static
bool
seen_d5
=
false
;
uint8_t
d
=
c
;
uint8_t
d
=
c
;
if
(
d
>=
0x80u
)
{
// UTF-8 handling
if
(
d
>=
0x80u
)
{
// UTF-8 handling
if
(
d
>=
0xd0u
&&
!
seen_d5
)
{
if
(
d
>=
0xd0u
&&
!
seen_d5
)
{
...
@@ -227,10 +229,11 @@
...
@@ -227,10 +229,11 @@
}
}
#elif ENABLED(MAPPER_E382E383)
#elif ENABLED(MAPPER_E382E383)
uint8_t
utf_hi_char
;
// UTF-8 high part
bool
seen_e3
=
false
;
char
charset_mapper
(
char
c
)
{
bool
seen_82_83
=
false
;
static
uint8_t
utf_hi_char
;
// UTF-8 high part
char
charset_mapper
(
char
c
){
static
bool
seen_e3
=
false
;
static
bool
seen_82_83
=
false
;
uint8_t
d
=
c
;
uint8_t
d
=
c
;
if
(
d
>=
0x80
)
{
// UTF-8 handling
if
(
d
>=
0x80
)
{
// UTF-8 handling
if
(
d
==
0xe3
&&
!
seen_e3
)
{
if
(
d
==
0xe3
&&
!
seen_e3
)
{
...
...
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