Local 'len' variables need to prefixed with '_', inner-loop len

variables need to be prefixed with '__'
This commit is contained in:
LibretroAdmin 2025-01-07 02:57:24 +01:00
parent e40f405b97
commit fc48ecaa1d
3 changed files with 20 additions and 19 deletions

View File

@ -1333,14 +1333,14 @@ static LRESULT CALLBACK wnd_proc_common_dinput_internal(HWND hwnd,
break; break;
for (i = 0; i < len1; i = i + 2) for (i = 0; i < len1; i = i + 2)
{ {
size_t len2; size_t __len;
char *utf8 = utf16_to_utf8_string_alloc(wstr+i); char *utf8 = utf16_to_utf8_string_alloc(wstr+i);
if (!utf8) if (!utf8)
continue; continue;
len2 = strlen(utf8) + 1; __len = strlen(utf8) + 1;
if (len2 >= 1 && len2 <= 3) if (__len >= 1 && __len <= 3)
{ {
if (len2 >= 2) if (__len >= 2)
utf8[3] = (gcs) | (gcs >> 4); utf8[3] = (gcs) | (gcs >> 4);
input_keyboard_event(true, 1, *((int*)utf8), 0, RETRO_DEVICE_KEYBOARD); input_keyboard_event(true, 1, *((int*)utf8), 0, RETRO_DEVICE_KEYBOARD);
} }
@ -2137,7 +2137,7 @@ static void win32_localize_menu(HMENU menu)
if (label_enum != MSG_UNKNOWN) if (label_enum != MSG_UNKNOWN)
{ {
int len; int len;
size_t len2; size_t __len;
#ifndef LEGACY_WIN32 #ifndef LEGACY_WIN32
wchar_t* new_label_unicode = NULL; wchar_t* new_label_unicode = NULL;
#else #else
@ -2156,25 +2156,25 @@ static void win32_localize_menu(HMENU menu)
MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST) MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST)
{ {
meta_key_name = "Ctrl+O"; meta_key_name = "Ctrl+O";
len2 = STRLEN_CONST("Ctrl+O"); __len = STRLEN_CONST("Ctrl+O");
} }
else if (label_enum == else if (label_enum ==
MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY) MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY)
{ {
meta_key_name = "Alt+Enter"; meta_key_name = "Alt+Enter";
len2 = STRLEN_CONST("Alt+Enter"); __len = STRLEN_CONST("Alt+Enter");
} }
else if (meta_key != 0) else if (meta_key != 0)
{ {
meta_key_name = win32_meta_key_to_name(meta_key); meta_key_name = win32_meta_key_to_name(meta_key);
len2 = strlen(meta_key_name); __len = strlen(meta_key_name);
} }
/* Append localized name, tab character, and Shortcut Key */ /* Append localized name, tab character, and Shortcut Key */
if (meta_key_name && string_is_not_equal(meta_key_name, "nul")) if (meta_key_name && string_is_not_equal(meta_key_name, "nul"))
{ {
size_t len1 = strlen(new_label); size_t len1 = strlen(new_label);
size_t buf_size = len1 + len2 + 2; size_t buf_size = len1 + __len + 2;
new_label_text = (char*)malloc(buf_size); new_label_text = (char*)malloc(buf_size);
if (new_label_text) if (new_label_text)

View File

@ -997,7 +997,7 @@ static void wl_data_device_handle_drop(void *data,
int pipefd[2]; int pipefd[2];
void *buffer; void *buffer;
size_t length; size_t length;
size_t len = 0; size_t _len = 0;
ssize_t read = 0; ssize_t read = 0;
char *line = NULL; char *line = NULL;
char file_list[512][512] = { 0 }; char file_list[512][512] = { 0 };
@ -1030,7 +1030,7 @@ static void wl_data_device_handle_drop(void *data,
} }
RARCH_WARN("[Wayland]: Files opp:\n"); RARCH_WARN("[Wayland]: Files opp:\n");
while ((read = getline(&line, &len, stream)) != -1) while ((read = getline(&line, &_len, stream)) != -1)
{ {
line[strcspn(line, "\r\n")] = 0; line[strcspn(line, "\r\n")] = 0;
RARCH_DBG("[Wayland]: > \"%s\"\n", line); RARCH_DBG("[Wayland]: > \"%s\"\n", line);

View File

@ -163,14 +163,15 @@ static INLINE bool _rjson_pushchar(rjson_t *json, _rjson_char_t c)
static INLINE bool _rjson_pushchars(rjson_t *json, static INLINE bool _rjson_pushchars(rjson_t *json,
const unsigned char *from, const unsigned char *to) const unsigned char *from, const unsigned char *to)
{ {
size_t len = json->string_len, new_len = len + (to - from);
unsigned char* string; unsigned char* string;
size_t _len = json->string_len;
size_t new_len = _len + (to - from);
while (new_len >= json->string_cap) while (new_len >= json->string_cap)
if (!_rjson_grow_string(json)) if (!_rjson_grow_string(json))
return false; return false;
string = (unsigned char *)json->string; string = (unsigned char *)json->string;
while (len != new_len) while (_len != new_len)
string[len++] = *(from++); string[_len++] = *(from++);
json->string_len = new_len; json->string_len = new_len;
return true; return true;
} }
@ -1126,7 +1127,7 @@ enum rjson_type rjson_parse(rjson_t *json, void* context,
bool (*null_handler )(void *context)) bool (*null_handler )(void *context))
{ {
bool in_object = false; bool in_object = false;
size_t len; size_t _len;
const char* string; const char* string;
if (!object_member_handler) object_member_handler = _rjson_nop_string; if (!object_member_handler) object_member_handler = _rjson_nop_string;
if (!string_handler ) string_handler = _rjson_nop_string; if (!string_handler ) string_handler = _rjson_nop_string;
@ -1142,16 +1143,16 @@ enum rjson_type rjson_parse(rjson_t *json, void* context,
switch (rjson_next(json)) switch (rjson_next(json))
{ {
case RJSON_STRING: case RJSON_STRING:
string = rjson_get_string(json, &len); string = rjson_get_string(json, &_len);
if (_rJSON_LIKELY( if (_rJSON_LIKELY(
(in_object && (json->stack_top->count & 1) ? (in_object && (json->stack_top->count & 1) ?
object_member_handler : string_handler) object_member_handler : string_handler)
(context, string, len))) (context, string, _len)))
continue; continue;
return RJSON_STRING; return RJSON_STRING;
case RJSON_NUMBER: case RJSON_NUMBER:
string = rjson_get_string(json, &len); string = rjson_get_string(json, &_len);
if (_rJSON_LIKELY(number_handler(context, string, len))) if (_rJSON_LIKELY(number_handler(context, string, _len)))
continue; continue;
return RJSON_NUMBER; return RJSON_NUMBER;
case RJSON_OBJECT: case RJSON_OBJECT: