From 45f4eb48fb6b4b651df6b466936dd425d9647400 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 25 Jun 2024 10:26:07 +0200 Subject: grid: refactor: remove union range_data_for_insertion This union is identical to row_range_data, except the URI char pointer is const. Let's ignore that, and re-use row_range_data, casting the URI pointer when necessary. Also remove uri_range_insert() and curly_range_insert(), and use the generic version of range_insert() everywhere. --- terminal.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 9fdd3dc0..21eb7cee 100644 --- a/terminal.h +++ b/terminal.h @@ -129,8 +129,14 @@ struct row_range { int end; union { - struct uri_range_data uri; - struct curly_range_data curly; + /* This is just an expanded union row_range_data, but + * anonymous, so that we don't have to write range->u.uri.id, + * but can instead do range->uri.id */ + union { + struct uri_range_data uri; + struct curly_range_data curly; + }; + union row_range_data data; }; }; -- cgit v1.3