Fix some compiler warnings

This commit is contained in:
2026-07-20 01:24:14 +02:00
parent 67d044a426
commit 24c8108f35
2 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -630,7 +630,7 @@ recovery_handler (int signum, siginfo_t *info, void *context)
const char *signal_name = NULL, *reason = NULL;
translate_signal_info (signum, &signal_name, info->si_code, &reason);
char buf[128], numbuf[8];
char buf[128], numbuf[16];
if (!signal_name)
{
snprintf (numbuf, sizeof numbuf, "%d", signum);
+7 -4
View File
@@ -287,12 +287,15 @@ input__str_tputs (struct str *s, const char *attribute)
static bool
input__adjust (struct input_pos *pos, int width)
{
if (pos->x + width > g_terminal.columns)
if (width < 0)
width = 0;
if ((int) pos->x + width > g_terminal.columns)
{
pos->y++;
pos->x = width;
}
else if ((pos->x += width) == g_terminal.columns)
else if ((int) (pos->x += width) == g_terminal.columns)
{
pos->y++;
pos->x = 0;
@@ -13323,7 +13326,7 @@ app_input_format_buffer (void *user_data, struct input_buffer *buffer,
else if (iscntrl_ascii (cp))
{
char escaped[] = { '^', cp == 127 ? '?' : cp + 64 };
if (pos->x + 1 == g_terminal.columns)
if ((int) pos->x + 1 == g_terminal.columns)
str_append_c (output, ' ');
input__adjust (pos, 2);
@@ -13843,7 +13846,7 @@ build_editor_command (struct app_context *ctx, const char *filename)
// XXX: Looks a bit hackish, meddling in internals.
struct input_buffer *buffer = ctx->input->current;
size_t line_one_based = 1, column = 0;
for (int i = 0; i < (size_t) buffer->point; i++)
for (int i = 0; i < buffer->point; i++)
{
// Both VIM and Emacs use the caret notation with columns.
// Consciously leaving tabs broken, they're too difficult to handle.