diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2025-05-27 22:08:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2025-05-27 22:08:00 -0700 |
commit | b782a2e60148aae8166330c7b75924dc3926b001 (patch) | |
tree | 645720d3b4b3b9c76a24c1c867d0771897db46e4 | |
parent | 40e0ccbb09a4f80aaec904124d68025e315a9118 (diff) | |
download | txr-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |