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
This commit is contained in:
tb
2023-05-08 10:03:39 +00:00
parent 41b318ac7c
commit 204d8f31d7
2 changed files with 2 additions and 2 deletions

2
grid.c
View File

@ -53,7 +53,7 @@ static const struct grid_cell grid_cleared_cell = {
{ { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0, 0 { { ' ' }, 0, 1, 1 }, 0, GRID_FLAG_CLEARED, 8, 8, 0, 0
}; };
static const struct grid_cell_entry grid_cleared_entry = { 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. */ /* Store cell in entry. */

2
tmux.h
View File

@ -723,7 +723,6 @@ struct grid_extd_entry {
/* Grid cell entry. */ /* Grid cell entry. */
struct grid_cell_entry { struct grid_cell_entry {
u_char flags;
union { union {
u_int offset; u_int offset;
struct { struct {
@ -733,6 +732,7 @@ struct grid_cell_entry {
u_char data; u_char data;
} data; } data;
}; };
u_char flags;
} __packed; } __packed;
/* Grid line. */ /* Grid line. */