diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-02-01 18:24:46 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-02-01 18:24:46 +0000 |
| commit | f13adf50dcbbf94da32c271fe38253113ba61d41 (patch) | |
| tree | 001c3b18c9604abd66bd69d11d900c53d9c8d167 | |
| parent | dcs: fix comment: ESU is *End* synchronized update (diff) | |
vt: use 8-bit indices for parameters and sub parameters
We only support 16 (sub) parameters and thus there's no need for
64-bit index variables.
| -rw-r--r-- | csi.c | 6 | ||||
| -rw-r--r-- | terminal.h | 8 |
2 files changed, 7 insertions, 7 deletions
@@ -42,11 +42,11 @@ csi_as_string(struct terminal *term, uint8_t final) } for (size_t i = 0; i < term->vt.params.idx; i++){ - c += snprintf(&msg[c], sizeof(msg) - c, "%d", + c += snprintf(&msg[c], sizeof(msg) - c, "%u", term->vt.params.v[i].value); for (size_t j = 0; j < term->vt.params.v[i].sub.idx; j++) { - c += snprintf(&msg[c], sizeof(msg) - c, ":%d", + c += snprintf(&msg[c], sizeof(msg) - c, ":%u", term->vt.params.v[i].sub.value[j]); } @@ -54,7 +54,7 @@ csi_as_string(struct terminal *term, uint8_t final) i == term->vt.params.idx - 1 ? "" : ";"); } - snprintf(&msg[c], sizeof(msg) - c, "%c (%zu parameters)", + snprintf(&msg[c], sizeof(msg) - c, "%c (%hhu parameters)", final, term->vt.params.idx); return msg; } @@ -100,7 +100,7 @@ struct grid { struct vt_subparams { unsigned value[16]; - size_t idx; + uint8_t idx; }; struct vt_param { @@ -113,7 +113,7 @@ struct vt { wchar_t last_printed; struct { struct vt_param v[16]; - size_t idx; + uint8_t idx; } params; char private[2]; struct { @@ -123,8 +123,8 @@ struct vt { } osc; struct { uint8_t data[4]; - size_t idx; - size_t left; + uint8_t idx; + uint8_t left; } utf8; struct { uint8_t *data; |
