From a541d0f24ad297ecb5af74a1c3a575592f977ab0 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 3 Oct 2022 10:19:22 +0300 Subject: [PATCH] Fix type warnings --- src/config.cc | 2 +- src/message.cc | 2 +- src/window_manager_private.cc | 8 ++++---- src/window_manager_private.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config.cc b/src/config.cc index 161b68a..719b429 100644 --- a/src/config.cc +++ b/src/config.cc @@ -471,7 +471,7 @@ static bool configTrimString(char* string) return false; } - int length = strlen(string); + size_t length = strlen(string); if (length == 0) { return true; } diff --git a/src/message.cc b/src/message.cc index 938c2ab..ebd6f73 100644 --- a/src/message.cc +++ b/src/message.cc @@ -83,7 +83,7 @@ int badwordsInit() break; } - int len = strlen(word); + size_t len = strlen(word); if (word[len - 1] == '\n') { len--; word[len] = '\0'; diff --git a/src/window_manager_private.cc b/src/window_manager_private.cc index fbeee5e..8d55be8 100644 --- a/src/window_manager_private.cc +++ b/src/window_manager_private.cc @@ -1001,7 +1001,7 @@ int _win_input_str(int win, char* dest, int maxLength, int x, int y, int textCol Window* window = windowGetWindow(win); unsigned char* buffer = window->buffer + window->width * y + x; - int cursorPos = strlen(dest); + size_t cursorPos = strlen(dest); dest[cursorPos] = '_'; dest[cursorPos + 1] = '\0'; @@ -1155,7 +1155,7 @@ int _GNW_process_menu(MenuBar* menuBar, int pulldownIndex) // Calculates max length of string needed to represent a1 or a2. // // 0x4DD03C -int _calc_max_field_chars_wcursor(int a1, int a2) +size_t _calc_max_field_chars_wcursor(int a1, int a2) { char* str = (char*)internal_malloc(17); if (str == NULL) { @@ -1163,10 +1163,10 @@ int _calc_max_field_chars_wcursor(int a1, int a2) } sprintf(str, "%d", a1); - int len1 = strlen(str); + size_t len1 = strlen(str); sprintf(str, "%d", a2); - int len2 = strlen(str); + size_t len2 = strlen(str); internal_free(str); diff --git a/src/window_manager_private.h b/src/window_manager_private.h index 0802090..cb067a5 100644 --- a/src/window_manager_private.h +++ b/src/window_manager_private.h @@ -27,7 +27,7 @@ int _win_width_needed(char** fileNameList, int fileNameListLength); int _win_input_str(int win, char* dest, int maxLength, int x, int y, int textColor, int backgroundColor); int sub_4DBD04(int win, Rect* rect, char** items, int itemsLength, int a5, int a6, MenuBar* menuBar, int pulldownIndex); int _GNW_process_menu(MenuBar* menuBar, int pulldownIndex); -int _calc_max_field_chars_wcursor(int a1, int a2); +size_t _calc_max_field_chars_wcursor(int a1, int a2); void _GNW_intr_init(); void _GNW_intr_exit(); void _tm_watch_msgs();