From b782a2e60148aae8166330c7b75924dc3926b001 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 27 May 2025 22:08:00 -0700 Subject: buf: obtaining a buf handle doesn't require cast. * buf.c (buf_handle): We don't need to coerce here, since we can just take the address of the union member. This function was written that way back in 2017. Why? I may have had a different implementation going in which the Lisp cell was pointing to a separately allocated structure, but then changed it to all fit into the cell (except for the buffer itself) before making the first commit. --- buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buf.c b/buf.c index d095472a..50319083 100644 --- a/buf.c +++ b/buf.c @@ -255,7 +255,7 @@ static val make_ubuf(ucnum clen) static struct buf *buf_handle(val buf, val ctx) { if (type(buf) == BUF) - return coerce(struct buf *, buf); + return &buf->b; uw_throwf(error_s, lit("~a: ~s isn't a buffer"), ctx, buf, nao); } -- cgit v1.2.3