From ef76c075e0052f5699e9ca1575185c60c29fadbd Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 31 Jul 2021 12:41:05 +0530 Subject: [PATCH] Get rid of bits from CellAttrs --- kitty/cursor.c | 4 ++-- kitty/data-types.c | 2 +- kitty/data-types.h | 12 ++++++------ kitty/fonts.c | 28 ++++++++++++++-------------- kitty/line-buf.c | 2 +- kitty/line.c | 38 +++++++++++++++++++------------------- kitty/lineops.h | 10 +++++----- kitty/screen.c | 12 ++++++------ 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/kitty/cursor.c b/kitty/cursor.c index 4378f2a27..f129c438b 100644 --- a/kitty/cursor.c +++ b/kitty/cursor.c @@ -140,7 +140,7 @@ apply_sgr_to_cells(GPUCell *first_cell, unsigned int cell_count, int *params, un #define RANGE for(unsigned c = 0; c < cell_count; c++, cell++) #define SET_COLOR(which) { color_type color = 0; parse_color(params, &i, count, &color); if (color) { RANGE { cell->which = color; }} } break; #define SIMPLE(which, val) RANGE { cell->which = (val); } break; -#define S(which, val) RANGE { cell->attrs.bits.which = (val); } break; +#define S(which, val) RANGE { cell->attrs.which = (val); } break; unsigned int i = 0, attr; if (!count) { params[0] = 0; count = 1; } @@ -171,7 +171,7 @@ apply_sgr_to_cells(GPUCell *first_cell, unsigned int cell_count, int *params, un case 21: S(decoration, 2); case 22: - RANGE { cell->attrs.bits.bold = false; cell->attrs.bits.dim = false; } break; + RANGE { cell->attrs.bold = false; cell->attrs.dim = false; } break; case 23: S(italic, false); case 24: diff --git a/kitty/data-types.c b/kitty/data-types.c index a7d703c8f..fccc9bfef 100644 --- a/kitty/data-types.c +++ b/kitty/data-types.c @@ -295,7 +295,7 @@ PyInit_fast_data_types(void) { if (!init_fonts(m)) return NULL; CellAttrs a; -#define s(name, attr) { a.val = 0; a.bits.attr = 1; PyModule_AddIntConstant(m, #name, shift_to_first_set_bit(a)); } +#define s(name, attr) { a.val = 0; a.attr = 1; PyModule_AddIntConstant(m, #name, shift_to_first_set_bit(a)); } s(BOLD, bold); s(ITALIC, italic); s(REVERSE, reverse); s(MARK, mark); s(STRIKETHROUGH, strike); s(DIM, dim); s(DECORATION, decoration); #undef s diff --git a/kitty/data-types.h b/kitty/data-types.h index dac2378ee..9e64b4e1c 100644 --- a/kitty/data-types.h +++ b/kitty/data-types.h @@ -141,12 +141,12 @@ typedef union CellAttrs { uint16_t strike : 1; uint16_t dim : 1; uint16_t mark : 2; - } bits; + }; uint16_t val; } CellAttrs; #define MARK_MASK (3u) #define WIDTH_MASK (3u) -#define SGR_MASK (~(((CellAttrs){.bits={.width=WIDTH_MASK, .mark=MARK_MASK}}).val)) +#define SGR_MASK (~(((CellAttrs){.width=WIDTH_MASK, .mark=MARK_MASK}).val)) typedef struct { color_type fg, bg, decoration_fg; @@ -290,16 +290,16 @@ typedef struct {FONTS_DATA_HEAD} *FONTS_DATA_HANDLE; static inline CellAttrs cursor_to_attrs(const Cursor *c, const uint16_t width) { - CellAttrs ans = {.bits={ + CellAttrs ans = { .width=width, .decoration=c->decoration, .bold=c->bold, .italic=c->italic, .reverse=c->reverse, - .strike=c->strikethrough, .dim=c->dim}}; + .strike=c->strikethrough, .dim=c->dim}; return ans; } static inline void attrs_to_cursor(const CellAttrs attrs, Cursor *c) { - c->decoration = attrs.bits.decoration; c->bold = attrs.bits.bold; c->italic = attrs.bits.italic; - c->reverse = attrs.bits.reverse; c->strikethrough = attrs.bits.strike; c->dim = attrs.bits.dim; + c->decoration = attrs.decoration; c->bold = attrs.bold; c->italic = attrs.italic; + c->reverse = attrs.reverse; c->strikethrough = attrs.strike; c->dim = attrs.dim; } diff --git a/kitty/fonts.c b/kitty/fonts.c index 13b39f21e..6f460cc70 100644 --- a/kitty/fonts.c +++ b/kitty/fonts.c @@ -378,7 +378,7 @@ face_has_codepoint(PyObject* face, char_type cp) { static bool has_emoji_presentation(CPUCell *cpu_cell, GPUCell *gpu_cell) { - return gpu_cell->attrs.bits.width == 2 && is_emoji(cpu_cell->ch) && cpu_cell->cc_idx[0] != VS15; + return gpu_cell->attrs.width == 2 && is_emoji(cpu_cell->ch) && cpu_cell->cc_idx[0] != VS15; } static bool @@ -458,8 +458,8 @@ load_fallback_font(FontGroup *fg, CPUCell *cell, bool bold, bool italic, bool em static ssize_t fallback_font(FontGroup *fg, CPUCell *cpu_cell, GPUCell *gpu_cell) { - bool bold = gpu_cell->attrs.bits.bold; - bool italic = gpu_cell->attrs.bits.italic; + bool bold = gpu_cell->attrs.bold; + bool italic = gpu_cell->attrs.italic; bool emoji_presentation = has_emoji_presentation(cpu_cell, gpu_cell); // Check if one of the existing fallback fonts has this text @@ -512,7 +512,7 @@ START_ALLOW_CASE_RANGE default: ans = in_symbol_maps(fg, cpu_cell->ch); if (ans > -1) return ans; - switch(gpu_cell->attrs.bits.bold | (gpu_cell->attrs.bits.italic << 1)) { + switch(gpu_cell->attrs.bold | (gpu_cell->attrs.italic << 1)) { case 0: ans = fg->medium_font_idx; break; case 1: @@ -605,7 +605,7 @@ load_hb_buffer(CPUCell *first_cpu_cell, GPUCell *first_gpu_cell, index_type num_ for (num = 0; num_cells && num < arraysz(shape_buffer) - 20 - arraysz(first_cpu_cell->cc_idx); first_cpu_cell++, first_gpu_cell++, num_cells--) { if (prev_width == 2) { prev_width = 0; continue; } shape_buffer[num++] = first_cpu_cell->ch; - prev_width = first_gpu_cell->attrs.bits.width; + prev_width = first_gpu_cell->attrs.width; for (unsigned i = 0; i < arraysz(first_cpu_cell->cc_idx) && first_cpu_cell->cc_idx[i]; i++) { shape_buffer[num++] = codepoint_for_mark(first_cpu_cell->cc_idx[i]); } @@ -660,7 +660,7 @@ render_group(FontGroup *fg, unsigned int num_cells, unsigned int num_glyphs, CPU } ensure_canvas_can_fit(fg, num_cells + 1); - bool was_colored = gpu_cells->attrs.bits.width == 2 && is_emoji(cpu_cells->ch); + bool was_colored = gpu_cells->attrs.width == 2 && is_emoji(cpu_cells->ch); render_glyphs_in_cells(font->face, font->bold, font->italic, info, positions, num_glyphs, fg->canvas.buf, fg->cell_width, fg->cell_height, num_cells, fg->baseline, &was_colored, (FONTS_DATA_HANDLE)fg, center_glyph); if (PyErr_Occurred()) PyErr_Print(); @@ -780,7 +780,7 @@ static unsigned int check_cell_consumed(CellData *cell_data, CPUCell *last_cpu_cell) { cell_data->codepoints_consumed++; if (cell_data->codepoints_consumed >= cell_data->num_codepoints) { - uint16_t width = cell_data->gpu_cell->attrs.bits.width; + uint16_t width = cell_data->gpu_cell->attrs.width; cell_data->cpu_cell += MAX(1, width); cell_data->gpu_cell += MAX(1, width); cell_data->codepoints_consumed = 0; @@ -829,7 +829,7 @@ ligature_type_from_glyph_name(const char *glyph_name, SpacerStrategy strategy) { static void detect_spacer_strategy(hb_font_t *hbf, Font *font) { CPUCell cpu_cells[3] = {{.ch = '='}, {.ch = '='}, {.ch = '='}}; - const CellAttrs w1 = {.bits={.width=1}}; + const CellAttrs w1 = {.width=1}; GPUCell gpu_cells[3] = {{.attrs = w1}, {.attrs = w1}, {.attrs = w1}}; shape(cpu_cells, gpu_cells, arraysz(cpu_cells), hbf, font, false); font->spacer_strategy = SPACERS_BEFORE; @@ -1088,7 +1088,7 @@ merge_groups_for_pua_space_ligature(void) { static bool is_group_calt_ligature(const Group *group) { GPUCell *first_cell = G(first_gpu_cell) + group->first_cell_idx; - return group->num_cells > 1 && group->has_special_glyph && first_cell->attrs.bits.width == 1; + return group->num_cells > 1 && group->has_special_glyph && first_cell->attrs.width == 1; } @@ -1142,7 +1142,7 @@ test_shape(PyObject UNUSED *self, PyObject *args) { int index = 0; if(!PyArg_ParseTuple(args, "O!|zi", &Line_Type, &line, &path, &index)) return NULL; index_type num = 0; - while(num < line->xnum && line->cpu_cells[num].ch) num += line->gpu_cells[num].attrs.bits.width; + while(num < line->xnum && line->cpu_cells[num].ch) num += line->gpu_cells[num].attrs.width; PyObject *face = NULL; Font *font; if (!num_font_groups) { PyErr_SetString(PyExc_RuntimeError, "must create at least one font group first"); return NULL; } @@ -1272,12 +1272,12 @@ render_line(FONTS_DATA_HANDLE fg_, Line *line, index_type lnum, Cursor *cursor, render_run(fg, line->cpu_cells + i, line->gpu_cells + i, num_spaces + 1, cell_font_idx, true, center_glyph, -1, disable_ligature_strategy); run_font_idx = NO_FONT; first_cell_in_run = i + num_spaces + 1; - prev_width = line->gpu_cells[i+num_spaces].attrs.bits.width; + prev_width = line->gpu_cells[i+num_spaces].attrs.width; i += num_spaces; continue; } } - prev_width = gpu_cell->attrs.bits.width; + prev_width = gpu_cell->attrs.width; if (run_font_idx == NO_FONT) run_font_idx = cell_font_idx; if (run_font_idx == cell_font_idx) continue; RENDER @@ -1549,8 +1549,8 @@ get_fallback_font(PyObject UNUSED *self, PyObject *args) { if (!PyUnicode_AsUCS4(text, char_buf, arraysz(char_buf), 1)) return NULL; cpu_cell.ch = char_buf[0]; for (unsigned i = 0; i + 1 < (unsigned) PyUnicode_GetLength(text) && i < arraysz(cpu_cell.cc_idx); i++) cpu_cell.cc_idx[i] = mark_for_codepoint(char_buf[i + 1]); - if (bold) gpu_cell.attrs.bits.bold = true; - if (italic) gpu_cell.attrs.bits.italic = true; + if (bold) gpu_cell.attrs.bold = true; + if (italic) gpu_cell.attrs.italic = true; FontGroup *fg = font_groups; ssize_t ans = fallback_font(fg, &cpu_cell, &gpu_cell); if (ans == MISSING_FONT) { PyErr_SetString(PyExc_ValueError, "No fallback font found"); return NULL; } diff --git a/kitty/line-buf.c b/kitty/line-buf.c index 8e30086d8..a52b01bae 100644 --- a/kitty/line-buf.c +++ b/kitty/line-buf.c @@ -161,7 +161,7 @@ line(LineBuf *self, PyObject *y) { unsigned int linebuf_char_width_at(LineBuf *self, index_type x, index_type y) { - return gpu_lineptr(self, self->line_map[y])[x].attrs.bits.width; + return gpu_lineptr(self, self->line_map[y])[x].attrs.width; } static PyObject* diff --git a/kitty/line.c b/kitty/line.c index 950562963..dcf1ecb7b 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -249,7 +249,7 @@ unicode_in_range(const Line *self, const index_type start, const index_type limi } else { n += cell_as_unicode(self->cpu_cells + i, include_cc, buf + n, ' '); } - previous_width = self->gpu_cells[i].attrs.bits.width; + previous_width = self->gpu_cells[i].attrs.width; } return PyUnicode_FromKindAndData(PyUnicode_4BYTE_KIND, buf, n); } @@ -350,7 +350,7 @@ line_as_ansi(Line *self, ANSIBuf *output, const GPUCell** prev_cell) { WRITE_CH(codepoint_for_mark(self->cpu_cells[pos].cc_idx[c])); } } - previous_width = cell->attrs.bits.width; + previous_width = cell->attrs.width; } #undef CMP_ATTRS #undef CMP @@ -399,14 +399,14 @@ width(Line *self, PyObject *val) { #define width_doc "width(x) -> the width of the character at x" unsigned long x = PyLong_AsUnsignedLong(val); if (x >= self->xnum) { PyErr_SetString(PyExc_ValueError, "Out of bounds"); return NULL; } - return PyLong_FromUnsignedLong((unsigned long) (self->gpu_cells[x].attrs.bits.width)); + return PyLong_FromUnsignedLong((unsigned long) (self->gpu_cells[x].attrs.width)); } void line_add_combining_char(Line *self, uint32_t ch, unsigned int x) { CPUCell *cell = self->cpu_cells + x; if (!cell->ch) { - if (x > 0 && (self->gpu_cells[x-1].attrs.bits.width) == 2 && self->cpu_cells[x-1].ch) cell = self->cpu_cells + x - 1; + if (x > 0 && (self->gpu_cells[x-1].attrs.width) == 2 && self->cpu_cells[x-1].ch) cell = self->cpu_cells + x - 1; else return; // don't allow adding combining chars to a null cell } for (unsigned i = 0; i < arraysz(cell->cc_idx); i++) { @@ -494,7 +494,7 @@ line_clear_text(Line *self, unsigned int at, unsigned int num, char_type ch) { for (index_type i = at; i < MIN(self->xnum, at + num); i++) { self->cpu_cells[i].ch = ch; memset(self->cpu_cells[i].cc_idx, 0, sizeof(self->cpu_cells[i].cc_idx)); self->cpu_cells[i].hyperlink_id = 0; - self->gpu_cells[i].attrs.bits.width = width; + self->gpu_cells[i].attrs.width = width; } } @@ -522,8 +522,8 @@ line_apply_cursor(Line *self, Cursor *cursor, unsigned int at, unsigned int num, self->gpu_cells[i].attrs = attrs; clear_sprite_position(self->gpu_cells[i]); } else { - attrs.bits.width = self->gpu_cells[i].attrs.bits.width; - attrs.bits.mark = self->gpu_cells[i].attrs.bits.mark; + attrs.width = self->gpu_cells[i].attrs.width; + attrs.mark = self->gpu_cells[i].attrs.mark; self->gpu_cells[i].attrs = attrs; } self->gpu_cells[i].fg = fg; self->gpu_cells[i].bg = bg; @@ -547,10 +547,10 @@ void line_right_shift(Line *self, unsigned int at, unsigned int num) { COPY_SELF_CELL(i - num, i) } // Check if a wide character was split at the right edge - if (self->gpu_cells[self->xnum - 1].attrs.bits.width != 1) { + if (self->gpu_cells[self->xnum - 1].attrs.width != 1) { self->cpu_cells[self->xnum - 1].ch = BLANK_CHAR; self->cpu_cells[self->xnum - 1].hyperlink_id = 0; - self->gpu_cells[self->xnum - 1].attrs = (CellAttrs){.bits={.width=BLANK_CHAR ? 1 : 0}}; + self->gpu_cells[self->xnum - 1].attrs = (CellAttrs){.width=BLANK_CHAR ? 1 : 0}; clear_sprite_position(self->gpu_cells[self->xnum - 1]); } } @@ -586,7 +586,7 @@ left_shift(Line *self, PyObject *args) { char_type line_get_char(Line *self, index_type at) { char_type ch = self->cpu_cells[at].ch; - if (!ch && at > 0 && (self->gpu_cells[at-1].attrs.bits.width) > 1) ch = self->cpu_cells[at-1].ch; + if (!ch && at > 0 && (self->gpu_cells[at-1].attrs.width) > 1) ch = self->cpu_cells[at-1].ch; return ch; } @@ -594,7 +594,7 @@ void line_set_char(Line *self, unsigned int at, uint32_t ch, unsigned int width, Cursor *cursor, hyperlink_id_type hyperlink_id) { GPUCell *g = self->gpu_cells + at; if (cursor == NULL) { - g->attrs.bits.width = width; + g->attrs.width = width; } else { g->attrs = cursor_to_attrs(cursor, width); g->fg = cursor->fg & COL_MASK; @@ -668,8 +668,8 @@ cell_as_sgr(const GPUCell *cell, const GPUCell *prev) { #define SZ sizeof(buf) - (p - buf) - 2 #define P(s) { size_t len = strlen(s); if (SZ > len) { memcpy(p, s, len); p += len; } } char *p = buf; -#define CA cell->attrs.bits -#define PA prev->attrs.bits +#define CA cell->attrs +#define PA prev->attrs bool intensity_differs = CA.bold != PA.bold || CA.dim != PA.dim; if (intensity_differs) { if (!CA.bold && !CA.dim) { P("22;"); } @@ -705,7 +705,7 @@ __eq__(Line *a, Line *b) { bool line_has_mark(Line *line, uint16_t mark) { for (index_type x = 0; x < line->xnum; x++) { - const uint16_t m = line->gpu_cells[x].attrs.bits.mark; + const uint16_t m = line->gpu_cells[x].attrs.mark; if (m && (!mark || mark == m)) return true; } return false; @@ -721,7 +721,7 @@ report_marker_error(PyObject *marker) { static void apply_mark(Line *line, const uint16_t mark, index_type *cell_pos, unsigned int *match_pos) { -#define MARK { line->gpu_cells[x].attrs.bits.mark = mark; } +#define MARK { line->gpu_cells[x].attrs.mark = mark; } index_type x = *cell_pos; MARK; (*match_pos)++; @@ -733,7 +733,7 @@ apply_mark(Line *line, const uint16_t mark, index_type *cell_pos, unsigned int * num_cells_to_skip_for_tab--; MARK; } - } else if ((line->gpu_cells[x].attrs.bits.width) > 1 && x + 1 < line->xnum && !line->cpu_cells[x+1].ch) { + } else if ((line->gpu_cells[x].attrs.width) > 1 && x + 1 < line->xnum && !line->cpu_cells[x+1].ch) { x++; MARK; } else { @@ -769,21 +769,21 @@ apply_marker(PyObject *marker, Line *line, const PyObject *text) { } Py_DECREF(iter); - while(x < line->xnum) line->gpu_cells[x++].attrs.bits.mark = 0; + while(x < line->xnum) line->gpu_cells[x++].attrs.mark = 0; if (PyErr_Occurred()) report_marker_error(marker); } void mark_text_in_line(PyObject *marker, Line *line) { if (!marker) { - for (index_type i = 0; i < line->xnum; i++) line->gpu_cells[i].attrs.bits.mark = 0; + for (index_type i = 0; i < line->xnum; i++) line->gpu_cells[i].attrs.mark = 0; return; } PyObject *text = line_as_unicode(line, false); if (PyUnicode_GET_LENGTH(text) > 0) { apply_marker(marker, line, text); } else { - for (index_type i = 0; i < line->xnum; i++) line->gpu_cells[i].attrs.bits.mark = 0; + for (index_type i = 0; i < line->xnum; i++) line->gpu_cells[i].attrs.mark = 0; } Py_DECREF(text); } diff --git a/kitty/lineops.h b/kitty/lineops.h index 9e2ead8d9..cde0c7858 100644 --- a/kitty/lineops.h +++ b/kitty/lineops.h @@ -9,7 +9,7 @@ #include "data-types.h" #define set_attribute_on_line(cells, which, val, xnum) { \ - for (index_type i__ = 0; i__ < xnum; i__++) cells[i__].attrs.bits.which = val; } + for (index_type i__ = 0; i__ < xnum; i__++) cells[i__].attrs.which = val; } static inline bool set_named_attribute_on_line(GPUCell *cells, const char* which, uint16_t val, index_type xnum) { @@ -31,7 +31,7 @@ static inline void clear_chars_in_line(CPUCell *cpu_cells, GPUCell *gpu_cells, index_type xnum, char_type ch) { // Clear only the char part of each cell, the rest must have been cleared by a memset or similar if (ch) { - const CellAttrs empty = {.bits={.width=1}}; + const CellAttrs empty = {.width=1}; for (index_type i = 0; i < xnum; i++) { cpu_cells[i].ch = ch; cpu_cells[i].hyperlink_id = 0; gpu_cells[i].attrs = empty; } } } @@ -41,7 +41,7 @@ xlimit_for_line(const Line *line) { index_type xlimit = line->xnum; if (BLANK_CHAR == 0) { while (xlimit > 0 && (line->cpu_cells[xlimit - 1].ch) == BLANK_CHAR) xlimit--; - if (xlimit < line->xnum && line->gpu_cells[xlimit > 0 ? xlimit - 1 : xlimit].attrs.bits.width == 2) xlimit++; + if (xlimit < line->xnum && line->gpu_cells[xlimit > 0 ? xlimit - 1 : xlimit].attrs.width == 2) xlimit++; } return xlimit; } @@ -63,9 +63,9 @@ left_shift_line(Line *line, index_type at, index_type num) { for (index_type i = at; i < line->xnum - num; i++) { COPY_CELL(line, i + num, line, i); } - const CellAttrs empty = {.bits={.width=1}}; + const CellAttrs empty = {.width=1}; const CellAttrs zero = {0}; - if (at < line->xnum && line->gpu_cells[at].attrs.bits.width != 1) { + if (at < line->xnum && line->gpu_cells[at].attrs.width != 1) { line->cpu_cells[at].ch = BLANK_CHAR; line->cpu_cells[at].hyperlink_id = 0; line->gpu_cells[at].attrs = BLANK_CHAR ? empty : zero; diff --git a/kitty/screen.c b/kitty/screen.c index 2ad09d894..8d221618f 100644 --- a/kitty/screen.c +++ b/kitty/screen.c @@ -594,24 +594,24 @@ draw_combining_char(Screen *self, char_type ch) { if (ch == 0xfe0f) { // emoji presentation variation marker makes default text presentation emoji (narrow emoji) into wide emoji CPUCell *cpu_cell = self->linebuf->line->cpu_cells + xpos; GPUCell *gpu_cell = self->linebuf->line->gpu_cells + xpos; - if (gpu_cell->attrs.bits.width != 2 && cpu_cell->cc_idx[0] == VS16 && is_emoji_presentation_base(cpu_cell->ch)) { + if (gpu_cell->attrs.width != 2 && cpu_cell->cc_idx[0] == VS16 && is_emoji_presentation_base(cpu_cell->ch)) { if (self->cursor->x <= self->columns - 1) line_set_char(self->linebuf->line, self->cursor->x, 0, 0, self->cursor, self->active_hyperlink_id); - gpu_cell->attrs.bits.width = 2; + gpu_cell->attrs.width = 2; if (xpos == self->columns - 1) move_widened_char(self, cpu_cell, gpu_cell, xpos, ypos); else self->cursor->x++; } } else if (ch == 0xfe0e) { CPUCell *cpu_cell = self->linebuf->line->cpu_cells + xpos; GPUCell *gpu_cell = self->linebuf->line->gpu_cells + xpos; - if (gpu_cell->attrs.bits.width == 0 && cpu_cell->ch == 0 && xpos > 0) { + if (gpu_cell->attrs.width == 0 && cpu_cell->ch == 0 && xpos > 0) { xpos--; if (self->cursor->x > 0) self->cursor->x--; cpu_cell = self->linebuf->line->cpu_cells + xpos; gpu_cell = self->linebuf->line->gpu_cells + xpos; } - if (gpu_cell->attrs.bits.width == 2 && cpu_cell->cc_idx[0] == VS15 && is_emoji_presentation_base(cpu_cell->ch)) { - gpu_cell->attrs.bits.width = 1; + if (gpu_cell->attrs.width == 2 && cpu_cell->cc_idx[0] == VS15 && is_emoji_presentation_base(cpu_cell->ch)) { + gpu_cell->attrs.width = 1; } } } @@ -3230,7 +3230,7 @@ marked_cells(Screen *self, PyObject *o UNUSED) { linebuf_init_line(self->linebuf, y); for (index_type x = 0; x < self->columns; x++) { GPUCell *gpu_cell = self->linebuf->line->gpu_cells + x; - const unsigned int mark = gpu_cell->attrs.bits.mark; + const unsigned int mark = gpu_cell->attrs.mark; if (mark) { PyObject *t = Py_BuildValue("III", x, y, mark); if (!t) { Py_DECREF(ans); return NULL; }