From: tb Date: Mon, 8 May 2023 10:03:39 +0000 (+0000) Subject: Reorder struct grid_cell_entry X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4b9d1c52dbc5d7e6cf1227d1435f847b53e98438;p=openbsd Reorder struct grid_cell_entry On aarch64 with llvm 15, the new -Wunaligned-access emits noise on every one of tmux's source files. This avoids this warning by moving a u_char to the end of the struct. This does not change the size of the struct on any architecture. ok nicm --- diff --git a/usr.bin/tmux/grid.c b/usr.bin/tmux/grid.c index 552a88eb073..09816b5a6af 100644 --- a/usr.bin/tmux/grid.c +++ b/usr.bin/tmux/grid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: grid.c,v 1.127 2022/09/28 07:55:29 nicm Exp $ */ +/* $OpenBSD: grid.c,v 1.128 2023/05/08 10:03:39 tb Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -53,7 +53,7 @@ static const struct grid_cell grid_cleared_cell = { { { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0, 0 }; static const struct grid_cell_entry grid_cleared_entry = { - GRID_FLAG_CLEARED, { .data = { 0, 8, 8, ' ' } } + { .data = { 0, 8, 8, ' ' } }, GRID_FLAG_CLEARED }; /* Store cell in entry. */ diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 5f1397e381e..ff4512e97f9 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.1197 2023/04/25 09:31:50 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.1198 2023/05/08 10:03:39 tb Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -723,7 +723,6 @@ struct grid_extd_entry { /* Grid cell entry. */ struct grid_cell_entry { - u_char flags; union { u_int offset; struct { @@ -733,6 +732,7 @@ struct grid_cell_entry { u_char data; } data; }; + u_char flags; } __packed; /* Grid line. */