This commit is contained in:
Kovid Goyal 2024-11-09 07:51:16 +05:30
parent 0356f28576
commit 38607369aa
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 2 additions and 2 deletions

View file

@ -834,7 +834,7 @@ shape(CPUCell *first_cpu_cell, GPUCell *first_gpu_cell, index_type num_cells, hb
group_state.prev_was_empty = false;
group_state.current_cell_data.cpu_cell = first_cpu_cell;
group_state.current_cell_data.gpu_cell = first_gpu_cell;
group_state.current_cell_data.num_codepoints = MAX(1, lc.count);
group_state.current_cell_data.num_codepoints = MAX(1u, lc.count);
group_state.current_cell_data.codepoints_consumed = 0;
group_state.current_cell_data.current_codepoint = lc.chars[0];
zero_at_ptr_count(group_state.groups, group_state.groups_capacity);

View file

@ -260,7 +260,7 @@ unicode_in_range(const Line *self, const index_type start, const index_type limi
for (index_type i = start; i < limit; i++) {
lc.chars = global_unicode_in_range_buf.chars + n; lc.capacity = global_unicode_in_range_buf.capacity - n;
while (!text_in_cell_without_alloc(self->cpu_cells + i, self->text_cache, &lc)) {
size_t ns = MAX(4096, 2 * global_unicode_in_range_buf.capacity);
size_t ns = MAX(4096u, 2 * global_unicode_in_range_buf.capacity);
char_type *np = realloc(global_unicode_in_range_buf.chars, ns);
if (!np) return PyErr_NoMemory();
global_unicode_in_range_buf.capacity = ns; global_unicode_in_range_buf.chars = np;