From: Armin Novak Date: Wed, 24 Oct 2018 11:05:49 +0000 (+0200) Subject: Changed size iterator variables to size_t X-Git-Tag: 2.0.0-rc4~34^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a4b47aaacce733ef5b797f24885611858e1c7b0;p=platform%2Fupstream%2Ffreerdp.git Changed size iterator variables to size_t --- diff --git a/libfreerdp/locale/keyboard_layout.c b/libfreerdp/locale/keyboard_layout.c index 9b66604..8661ffb 100644 --- a/libfreerdp/locale/keyboard_layout.c +++ b/libfreerdp/locale/keyboard_layout.c @@ -313,7 +313,7 @@ fail: const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutID) { - int i; + size_t i; for (i = 0; i < ARRAYSIZE(RDP_KEYBOARD_LAYOUT_TABLE); i++) { @@ -338,7 +338,7 @@ const char* freerdp_keyboard_get_layout_name_from_id(DWORD keyboardLayoutID) DWORD freerdp_keyboard_get_layout_id_from_name(const char* name) { - int i; + size_t i; for (i = 0; i < ARRAYSIZE(RDP_KEYBOARD_LAYOUT_TABLE); i++) { diff --git a/libfreerdp/locale/locale.c b/libfreerdp/locale/locale.c index c461397..0ae7e55 100644 --- a/libfreerdp/locale/locale.c +++ b/libfreerdp/locale/locale.c @@ -631,14 +631,13 @@ static const LOCALE_KEYBOARD_LAYOUTS LOCALE_KEYBOARD_LAYOUTS_TABLE[] = { XHOSA, { 0x00000409, 0x00000409, 0x0, 0x0, 0x0 } }, }; -BOOL freerdp_get_system_language_and_country_codes(char* language, char* country) +static BOOL freerdp_get_system_language_and_country_codes(char* language, char* country) { int dot; DWORD nSize; int underscore; char* env_lang = NULL; LPCSTR lang = "LANG"; - /* LANG = _. */ nSize = GetEnvironmentVariableA(lang, NULL, 0); @@ -650,9 +649,10 @@ BOOL freerdp_get_system_language_and_country_codes(char* language, char* country if (!env_lang) return FALSE; - if (GetEnvironmentVariableA(lang, env_lang, nSize) != nSize - 1) /* Get locale from environment variable LANG */ + if (GetEnvironmentVariableA(lang, env_lang, + nSize) != nSize - 1) /* Get locale from environment variable LANG */ { - free (env_lang); + free(env_lang); return FALSE; } @@ -688,18 +688,18 @@ BOOL freerdp_get_system_language_and_country_codes(char* language, char* country return TRUE; } -SYSTEM_LOCALE* freerdp_detect_system_locale() +static SYSTEM_LOCALE* freerdp_detect_system_locale(void) { - int i; + size_t i; char language[4]; char country[10]; SYSTEM_LOCALE* locale = NULL; - freerdp_get_system_language_and_country_codes(language, country); for (i = 0; i < ARRAYSIZE(SYSTEM_LOCALE_TABLE); i++) { - if ((strcmp(language, SYSTEM_LOCALE_TABLE[i].language) == 0) && (strcmp(country, SYSTEM_LOCALE_TABLE[i].country) == 0)) + if ((strcmp(language, SYSTEM_LOCALE_TABLE[i].language) == 0) && + (strcmp(country, SYSTEM_LOCALE_TABLE[i].country) == 0)) { locale = (SYSTEM_LOCALE*) &SYSTEM_LOCALE_TABLE[i]; break; @@ -709,10 +709,9 @@ SYSTEM_LOCALE* freerdp_detect_system_locale() return locale; } -DWORD freerdp_get_system_locale_id() +DWORD freerdp_get_system_locale_id(void) { SYSTEM_LOCALE* locale; - locale = freerdp_detect_system_locale(); if (locale != NULL) @@ -723,7 +722,7 @@ DWORD freerdp_get_system_locale_id() const char* freerdp_get_system_locale_name_from_id(DWORD localeId) { - int index; + size_t index; for (index = 0; index < ARRAYSIZE(LOCALE_NAME_TABLE); index++) { @@ -736,11 +735,10 @@ const char* freerdp_get_system_locale_name_from_id(DWORD localeId) int freerdp_detect_keyboard_layout_from_system_locale(DWORD* keyboardLayoutId) { - int i, j; + size_t i, j; char language[4]; char country[10]; SYSTEM_LOCALE* locale; - freerdp_get_system_language_and_country_codes(language, country); if ((strcmp(language, "C") == 0) || (strcmp(language, "POSIX") == 0)) @@ -761,7 +759,6 @@ int freerdp_detect_keyboard_layout_from_system_locale(DWORD* keyboardLayoutId) if (LOCALE_KEYBOARD_LAYOUTS_TABLE[i].locale == locale->code) { /* Locale found in list of default keyboard layouts */ - for (j = 0; j < 5; j++) { if (LOCALE_KEYBOARD_LAYOUTS_TABLE[i].keyboardLayouts[j] == ENGLISH_UNITED_STATES)