frontend: fix all compiler warnings

This commit is contained in:
2024-12-13 17:20:45 +00:00
parent 97aaffd166
commit b3a9943fe5
14 changed files with 68 additions and 72 deletions

View File

@@ -1,11 +1,11 @@
#include "buffer.h"
#include "line-ed.h"
const char *line_start(struct line_ed *ed, unsigned int y)
const char *line_start(struct line_ed *ed, size_t y)
{
const char *line = ed->l_buf;
for (unsigned int i = 0; i < y; i++) {
for (size_t i = 0; i < y; i++) {
line += strcspn(line, "\n");
if (*line == '\n') {
@@ -16,11 +16,11 @@ const char *line_start(struct line_ed *ed, unsigned int y)
return line;
}
unsigned int line_length(struct line_ed *ed, unsigned int y)
size_t line_length(struct line_ed *ed, size_t y)
{
const char *line = ed->l_buf;
for (unsigned int i = 0; i < y; i++) {
for (size_t i = 0; i < y; i++) {
line += strcspn(line, "\n");
if (*line == '\n') {
line++;
@@ -31,7 +31,7 @@ unsigned int line_length(struct line_ed *ed, unsigned int y)
return 0;
}
unsigned int len = strcspn(line, "\n");
size_t len = strcspn(line, "\n");
if (line[len] == '\n') {
len++;
}