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

@@ -7,8 +7,7 @@
#include <stdlib.h>
#include <string.h>
int compare_coords(
unsigned int ax, unsigned int ay, unsigned int bx, unsigned int by)
int compare_coords(size_t ax, size_t ay, size_t bx, size_t by)
{
if (ay > by) {
return 1;
@@ -29,7 +28,7 @@ int compare_coords(
return 0;
}
struct hl_range *get_hl_range(struct line_ed *ed, unsigned int x, unsigned int y)
struct hl_range *get_hl_range(struct line_ed *ed, size_t x, size_t y)
{
if (b_queue_empty(&ed->l_hl_ranges)) {
return NULL;
@@ -64,7 +63,7 @@ struct hl_range *get_next_hl_range(struct hl_range *range)
return range;
}
int apply_hl_range(struct hl_range *range, b_tty *tty, unsigned int x, unsigned int y)
int apply_hl_range(struct hl_range *range, b_tty *tty, size_t x, size_t y)
{
if (!range) {
b_tty_reset_vmode(tty);
@@ -90,8 +89,8 @@ int apply_hl_range(struct hl_range *range, b_tty *tty, unsigned int x, unsigned
}
struct hl_range *create_highlight(
unsigned long start_x, unsigned long start_y, unsigned long end_x,
unsigned long end_y, const b_tty_vmode *vmode)
size_t start_x, size_t start_y, size_t end_x, size_t end_y,
const b_tty_vmode *vmode)
{
struct hl_range *out = malloc(sizeof *out);
if (!out) {
@@ -280,7 +279,7 @@ void line_ed_print_highlights(struct line_ed *ed)
b_queue_iterator it;
b_queue_foreach (&it, &ed->l_hl_ranges) {
struct hl_range *h = b_unbox(struct hl_range, it.entry, h_entry);
printf("(%u, %u) -> (%u, %u)\n", h->h_start_x, h->h_start_y,
printf("(%zu, %zu) -> (%zu, %zu)\n", h->h_start_x, h->h_start_y,
h->h_end_x, h->h_end_y);
}
}