From cdb493cf50034fcf0995aaed34ff623c7e3d0b95 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 4 Jul 2019 09:15:13 +0530 Subject: [PATCH] Couple more MIN/MAX type fixes --- kitty/core_text.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/core_text.m b/kitty/core_text.m index bd67a254f..be244c69b 100644 --- a/kitty/core_text.m +++ b/kitty/core_text.m @@ -325,7 +325,7 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u if (w > width) width = w; } } - *cell_width = MAX(1, width); + *cell_width = MAX(1u, width); *underline_position = floor(self->ascent - self->underline_position + 0.5); *underline_thickness = (unsigned int)ceil(MAX(0.1, self->underline_thickness)); *baseline = (unsigned int)self->ascent; @@ -347,7 +347,7 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u CTFrameGetLineOrigins(test_frame, CFRangeMake(1, 1), &origin2); CGFloat line_height = origin1.y - origin2.y; CFRelease(test_frame); CFRelease(path); CFRelease(framesetter); - *cell_height = MAX(4, (unsigned int)ceilf(line_height)); + *cell_height = MAX(4u, (unsigned int)ceilf(line_height)); #undef count }