(Clang) Silence 'n' is never used warnings

This commit is contained in:
twinaphex 2021-02-03 11:48:33 +01:00
parent 4c97c22e00
commit 4df6d287e3
7 changed files with 49 additions and 12 deletions

View File

@ -217,6 +217,7 @@ static void rcheevos_get_user_agent(
{
frontend->get_os(tmp, sizeof(tmp), &major, &minor);
ptr += sprintf(ptr, " (%s %d.%d)", tmp, major, minor);
(void)ptr;
}
}

View File

@ -168,6 +168,7 @@ bool core_backup_get_backup_path(
if ((n < 0) || (n >= 128))
n = 0; /* Silence GCC warnings... */
(void)n;
/* Build final path */
fill_pathname_join(backup_path, backup_dir,
backup_filename, len);
@ -742,7 +743,7 @@ bool core_backup_list_get_entry_timestamp_str(
if ((n < 0) || (n >= 32))
n = 0; /* Silence GCC warnings... */
(void)n;
return true;
}
@ -762,6 +763,6 @@ bool core_backup_list_get_entry_crc_str(
if ((n < 0) || (n >= 32))
n = 0; /* Silence GCC warnings... */
(void)n;
return true;
}

View File

@ -1397,7 +1397,7 @@ static int action_bind_sublabel_playlist_entry(
if ((n < 0) || (n >= 64))
n = 0; /* Silence GCC warnings... */
(void)n;
if (!string_is_empty(tmp))
strlcat(s, tmp, len);
}

View File

@ -3367,7 +3367,8 @@ static bool materialui_render_process_entry_playlist_desktop(
if ((n < 0) || (n >= 255))
n = 0; /* Silence GCC warnings... */
(void)n;
/* All metadata is cached */
mui->status_bar.cached = true;
@ -7074,7 +7075,7 @@ static void materialui_status_bar_init(
if ((n < 0) || (n >= 255))
n = 0; /* Silence GCC warnings... */
(void)n;
n = snprintf(mui->status_bar.last_played_fallback_str,
sizeof(mui->status_bar.last_played_fallback_str), "%s %s",
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED),
@ -7082,6 +7083,7 @@ static void materialui_status_bar_init(
if ((n < 0) || (n >= 255))
n = 0; /* Silence GCC warnings... */
(void)n;
}
}

View File

@ -3764,6 +3764,7 @@ static unsigned menu_displaylist_parse_content_information(
tmp[0] = '\0';
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_LABEL), sizeof(tmp));
(void)n;
strlcat(tmp, ": ", sizeof(tmp));
n = strlcat(tmp, content_label, sizeof(tmp));
@ -3771,7 +3772,7 @@ static unsigned menu_displaylist_parse_content_information(
* (getting so sick of these...) */
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0;
(void)n;
if (menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_INFO_LABEL),
MENU_ENUM_LABEL_CONTENT_INFO_LABEL,
@ -3785,14 +3786,17 @@ static unsigned menu_displaylist_parse_content_information(
tmp[0] = '\0';
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_PATH), sizeof(tmp));
(void)n;
n = strlcat(tmp, ": ", sizeof(tmp));
(void)n;
n = strlcat(tmp, content_path, sizeof(tmp));
/* Silence gcc compiler warning
* (getting so sick of these...) */
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0;
(void)n;
if (menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_INFO_PATH),
MENU_ENUM_LABEL_CONTENT_INFO_PATH,
@ -3807,14 +3811,17 @@ static unsigned menu_displaylist_parse_content_information(
tmp[0] = '\0';
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CORE_NAME), sizeof(tmp));
(void)n;
n = strlcat(tmp, ": ", sizeof(tmp));
(void)n;
n = strlcat(tmp, core_name, sizeof(tmp));
/* Silence gcc compiler warning
* (getting so sick of these...) */
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0;
(void)n;
if (menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_INFO_CORE_NAME),
MENU_ENUM_LABEL_CONTENT_INFO_CORE_NAME,
@ -3876,14 +3883,17 @@ static unsigned menu_displaylist_parse_content_information(
tmp[0] = '\0';
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CHEEVOS_HASH), sizeof(tmp));
(void)n;
n = strlcat(tmp, ": ", sizeof(tmp));
(void)n;
n = strlcat(tmp, rcheevos_get_hash(), sizeof(tmp));
/* Silence gcc compiler warning
* (getting so sick of these...) */
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0;
(void)n;
if (menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CHEEVOS_HASH),
MENU_ENUM_LABEL_VALUE_CONTENT_INFO_CHEEVOS_HASH,
@ -3911,14 +3921,17 @@ static unsigned menu_displaylist_parse_content_information(
tmp[0] = '\0';
n = strlcpy(tmp, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CONTENT_INFO_DATABASE), sizeof(tmp));
(void)n;
n = strlcat(tmp, ": ", sizeof(tmp));
(void)n;
n = strlcat(tmp, db_name_no_ext, sizeof(tmp));
/* Silence gcc compiler warning
* (getting so sick of these...) */
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0;
(void)n;
if (menu_entries_append_enum(info->list, tmp,
msg_hash_to_str(MENU_ENUM_LABEL_CONTENT_INFO_DATABASE),
MENU_ENUM_LABEL_CONTENT_INFO_DATABASE,
@ -6688,6 +6701,7 @@ unsigned menu_displaylist_build_list(
/* Suppress GCC warnings... */
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0;
(void)n;
}
else
snprintf(

View File

@ -12255,6 +12255,7 @@ static void command_event_runtime_log_deinit(struct rarch_state *p_rarch)
hours, minutes, seconds);
if ((n < 0) || (n >= PATH_MAX_LENGTH))
n = 0; /* Just silence any potential gcc warnings... */
(void)n;
RARCH_LOG("%s\n",log);
/* Only write to file if content has run for a non-zero length of time */

View File

@ -577,6 +577,7 @@ void runtime_log_get_runtime_str(runtime_log_t *runtime_log,
if ((n < 0) || (n >= 64))
n = 0; /* Silence GCC warnings... */
(void)n;
}
/* Gets last played entry values */
@ -831,6 +832,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.day,
runtime_log->last_played.hour,
runtime_log->last_played.minute);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_YMD:
switch (date_separator)
@ -851,6 +853,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.year,
runtime_log->last_played.month,
runtime_log->last_played.day);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_YM:
switch (date_separator)
@ -870,6 +873,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED),
runtime_log->last_played.year,
runtime_log->last_played.month);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_MDYYYY_HMS:
switch (date_separator)
@ -893,6 +897,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.hour,
runtime_log->last_played.minute,
runtime_log->last_played.second);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_MDYYYY_HM:
switch (date_separator)
@ -915,6 +920,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.year,
runtime_log->last_played.hour,
runtime_log->last_played.minute);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_MD_HM:
switch (date_separator)
@ -936,6 +942,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.day,
runtime_log->last_played.hour,
runtime_log->last_played.minute);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_MDYYYY:
switch (date_separator)
@ -956,6 +963,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.month,
runtime_log->last_played.day,
runtime_log->last_played.year);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_MD:
switch (date_separator)
@ -975,6 +983,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED),
runtime_log->last_played.month,
runtime_log->last_played.day);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_DDMMYYYY_HMS:
switch (date_separator)
@ -998,6 +1007,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.hour,
runtime_log->last_played.minute,
runtime_log->last_played.second);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_DDMMYYYY_HM:
switch (date_separator)
@ -1020,6 +1030,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.year,
runtime_log->last_played.hour,
runtime_log->last_played.minute);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_DDMM_HM:
switch (date_separator)
@ -1041,6 +1052,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.month,
runtime_log->last_played.hour,
runtime_log->last_played.minute);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_DDMMYYYY:
switch (date_separator)
@ -1061,6 +1073,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.day,
runtime_log->last_played.month,
runtime_log->last_played.year);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_DDMM:
switch (date_separator)
@ -1079,6 +1092,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
msg_hash_to_str(
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED),
runtime_log->last_played.day, runtime_log->last_played.month);
(void)n;
return;
case PLAYLIST_LAST_PLAYED_STYLE_YMD_HMS:
default:
@ -1103,6 +1117,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
runtime_log->last_played.hour,
runtime_log->last_played.minute,
runtime_log->last_played.second);
(void)n;
return;
}
}
@ -1116,6 +1131,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log,
if ((n < 0) || (n >= 64))
n = 0; /* Silence GCC warnings... */
(void)n;
}
/* Status */
@ -1200,7 +1216,8 @@ void runtime_log_save(runtime_log_t *runtime_log)
runtime_log->runtime.seconds);
if ((n < 0) || (n >= 64))
n = 0; /* Silence GCC warnings... */
(void)n;
rjsonwriter_add_spaces(writer, 2);
rjsonwriter_add_string(writer, "runtime");
rjsonwriter_add_colon(writer);
@ -1220,6 +1237,7 @@ void runtime_log_save(runtime_log_t *runtime_log)
if ((n < 0) || (n >= 64))
n = 0; /* Silence GCC warnings... */
(void)n;
rjsonwriter_add_spaces(writer, 2);
rjsonwriter_add_string(writer, "last_played");
rjsonwriter_add_colon(writer);