From 2ce58c995946f85666e793c4f06efff683e76ae4 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Wed, 12 Nov 2025 00:37:26 +0100 Subject: fixes --- src/drv/tty/private_include/drv/tty/ops.h | 4 ++-- src/drv/tty/src/update.backup.c | 2 +- src/drv/tty/src/update.c | 2 +- src/drv/tty/src/write.c | 6 ++---- 4 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/drv/tty') diff --git a/src/drv/tty/private_include/drv/tty/ops.h b/src/drv/tty/private_include/drv/tty/ops.h index b50b00a..ceab56a 100644 --- a/src/drv/tty/private_include/drv/tty/ops.h +++ b/src/drv/tty/private_include/drv/tty/ops.h @@ -23,8 +23,8 @@ #include #include -int drv_tty_write(const void *buf, size_t n, const struct drv_event_done *done, - void *args); +int drv_tty_write(struct drv_port *p, const void *buf, size_t n, + const struct drv_event_done *done); int drv_tty_setdim(struct drv_port *p, unsigned x, unsigned y); #endif diff --git a/src/drv/tty/src/update.backup.c b/src/drv/tty/src/update.backup.c index d072977..07e2a09 100644 --- a/src/drv/tty/src/update.backup.c +++ b/src/drv/tty/src/update.backup.c @@ -34,7 +34,7 @@ static int init(struct drv_port *const p) const struct drv_event_ops ops = { .write = drv_tty_write, - .args = p + .p = p }; if (ev->status("tty", &ops, true, 0666, ev->args)) diff --git a/src/drv/tty/src/update.c b/src/drv/tty/src/update.c index 7c01678..b5644d0 100644 --- a/src/drv/tty/src/update.c +++ b/src/drv/tty/src/update.c @@ -34,7 +34,7 @@ static int init(struct drv_port *const p) const struct drv_event_ops ops = { .write = drv_tty_write, - .args = p + .p = p }; if (ev->status("tty", &ops, true, 0666, ev->args)) diff --git a/src/drv/tty/src/write.c b/src/drv/tty/src/write.c index d4a988d..c7b90ed 100644 --- a/src/drv/tty/src/write.c +++ b/src/drv/tty/src/write.c @@ -23,11 +23,9 @@ #include #include -int drv_tty_write(const void *const buf, const size_t n, - const struct drv_event_done *const d, void *const args) +int drv_tty_write(struct drv_port *const p, const void *const buf, + const size_t n, const struct drv_event_done *const d) { - struct drv_port *const p = args; - for (const char *s = buf; s - (const char *)buf < n; s++) { struct row *const r = p->last_row; -- cgit v1.2.3