Fast and reasonably complete (framebuffer) terminal emulator (Zig fork)

Fix -Wsign-conversion warnings

suhaspai a124a2e0 b94be177

Changed files
+5 -5
+5 -5
flanterm.c
···
}
ctx->unicode_remaining--;
-
ctx->code_point |= (c & 0x3f) << (6 * ctx->unicode_remaining);
if (ctx->unicode_remaining != 0) {
return;
}
···
int cc = unicode_to_cp437(ctx->code_point);
if (cc == -1) {
-
size_t replacement_width = mk_wcwidth(ctx->code_point);
if (replacement_width > 0) {
ctx->raw_putchar(ctx, 0xfe);
}
···
if (c >= 0xc0 && c <= 0xf7) {
if (c >= 0xc0 && c <= 0xdf) {
ctx->unicode_remaining = 1;
-
ctx->code_point = (c & 0x1f) << 6;
} else if (c >= 0xe0 && c <= 0xef) {
ctx->unicode_remaining = 2;
-
ctx->code_point = (c & 0x0f) << (6 * 2);
} else if (c >= 0xf0 && c <= 0xf7) {
ctx->unicode_remaining = 3;
-
ctx->code_point = (c & 0x07) << (6 * 3);
}
return;
}
···
}
ctx->unicode_remaining--;
+
ctx->code_point |= (uint64_t)(c & 0x3f) << (6 * ctx->unicode_remaining);
if (ctx->unicode_remaining != 0) {
return;
}
···
int cc = unicode_to_cp437(ctx->code_point);
if (cc == -1) {
+
size_t replacement_width = (size_t)mk_wcwidth(ctx->code_point);
if (replacement_width > 0) {
ctx->raw_putchar(ctx, 0xfe);
}
···
if (c >= 0xc0 && c <= 0xf7) {
if (c >= 0xc0 && c <= 0xdf) {
ctx->unicode_remaining = 1;
+
ctx->code_point = (uint64_t)(c & 0x1f) << 6;
} else if (c >= 0xe0 && c <= 0xef) {
ctx->unicode_remaining = 2;
+
ctx->code_point = (uint64_t)(c & 0x0f) << (6 * 2);
} else if (c >= 0xf0 && c <= 0xf7) {
ctx->unicode_remaining = 3;
+
ctx->code_point = (uint64_t)(c & 0x07) << (6 * 3);
}
return;
}