aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-04-27 13:06:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-04-27 13:06:23 +0000
commite478874dd9cefb08011c46d43deb850e68a4458b (patch)
treebe76d07a4e471e225a70ba0ef30b4721dba77879
parentreadme: link to utf8proc was cut off (diff)
term: remove unneeded utf8.left member
-rw-r--r--terminal.h1
-rw-r--r--vt.c15
2 files changed, 0 insertions, 16 deletions
diff --git a/terminal.h b/terminal.h
index 7653daa3..7fcede70 100644
--- a/terminal.h
+++ b/terminal.h
@@ -135,7 +135,6 @@ struct vt {
struct {
uint8_t data[4];
uint8_t idx;
- uint8_t left;
} utf8;
struct {
uint8_t *data;
diff --git a/vt.c b/vt.c
index c6f86bdb..0a34a45e 100644
--- a/vt.c
+++ b/vt.c
@@ -513,27 +513,21 @@ static void
action_utf8_2_entry(struct terminal *term, uint8_t c)
{
term->vt.utf8.idx = 0;
- term->vt.utf8.left = 2;
term->vt.utf8.data[term->vt.utf8.idx++] = c;
- term->vt.utf8.left--;
}
static void
action_utf8_3_entry(struct terminal *term, uint8_t c)
{
term->vt.utf8.idx = 0;
- term->vt.utf8.left = 3;
term->vt.utf8.data[term->vt.utf8.idx++] = c;
- term->vt.utf8.left--;
}
static void
action_utf8_4_entry(struct terminal *term, uint8_t c)
{
term->vt.utf8.idx = 0;
- term->vt.utf8.left = 4;
term->vt.utf8.data[term->vt.utf8.idx++] = c;
- term->vt.utf8.left--;
}
static void
@@ -1068,9 +1062,6 @@ static enum state
state_utf8_collect_1_switch(struct terminal *term, uint8_t data)
{
term->vt.utf8.data[term->vt.utf8.idx++] = data;
- term->vt.utf8.left--;
-
- assert(term->vt.utf8.left == 0);
action_utf8_print(term, data);
return STATE_GROUND;
}
@@ -1079,9 +1070,6 @@ static enum state
state_utf8_collect_2_switch(struct terminal *term, uint8_t data)
{
term->vt.utf8.data[term->vt.utf8.idx++] = data;
- term->vt.utf8.left--;
-
- assert(term->vt.utf8.left == 1);
return STATE_UTF8_COLLECT_1;
}
@@ -1089,9 +1077,6 @@ static enum state
state_utf8_collect_3_switch(struct terminal *term, uint8_t data)
{
term->vt.utf8.data[term->vt.utf8.idx++] = data;
- term->vt.utf8.left--;
-
- assert(term->vt.utf8.left == 2);
return STATE_UTF8_COLLECT_2;
}