summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2025-05-27 22:08:00 -0700
committerKaz Kylheku <kaz@kylheku.com>2025-05-27 22:08:00 -0700
commitb782a2e60148aae8166330c7b75924dc3926b001 (patch)
tree645720d3b4b3b9c76a24c1c867d0771897db46e4
parent40e0ccbb09a4f80aaec904124d68025e315a9118 (diff)
downloadtxr-b782a2e60148aae8166330c7b75924dc3926b001.tar.gz
txr-b782a2e60148aae8166330c7b75924dc3926b001.tar.bz2
txr-b782a2e60148aae8166330c7b75924dc3926b001.zip
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.
-rw-r--r--buf.c2
1 files changed, 1 insertions, 1 deletions
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);
}