From 9632602478bca5744fcf4a045c05fe5c2f848442 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 29 Oct 2022 22:00:48 +0300 Subject: [PATCH 39/39] sdl2: Make some popup_diplomatic_objects() vars unsigned There can't be negative count, nor size (width or height) Helps compilers' (and other tools) heuristics See osdn #45985 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/diplodlg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/gui-sdl2/diplodlg.c b/client/gui-sdl2/diplodlg.c index 03b8e15529..d5a2a45e52 100644 --- a/client/gui-sdl2/diplodlg.c +++ b/client/gui-sdl2/diplodlg.c @@ -465,11 +465,13 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, { struct advanced_dialog *dlg = fc_calloc(1, sizeof(struct advanced_dialog)); struct container *cont = fc_calloc(1, sizeof(struct container)); - int width, height, count = 0, scroll_w = 0; + unsigned width, height; + unsigned count = 0; + unsigned scroll_w = 0; char cbuf[128]; struct widget *buf = NULL, *pwindow; utf8_str *pstr; - int window_x = 0, window_y = 0; + unsigned window_x = 0, window_y = 0; SDL_Rect area; enum diplstate_type type = player_diplstate_get(pplayer0, pplayer1)->type; -- 2.35.1