mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-28 19:18:03 -04:00
app: Don't shadow global variables
These were pointed out by lgtm.com
This commit is contained in:
committed by
Alexander Larsson
parent
194ef58fb9
commit
4e7cee1b98
@@ -385,7 +385,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
|
||||
GVariantBuilder builder;
|
||||
g_autoptr(OstreeAsyncProgressFinish) progress = NULL;
|
||||
g_auto(GLnxConsoleRef) console = { 0, };
|
||||
g_autoptr(GVariant) options = NULL;
|
||||
g_autoptr(GVariant) pull_options = NULL;
|
||||
gboolean res;
|
||||
|
||||
if (opt_untrusted)
|
||||
@@ -404,9 +404,9 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
|
||||
g_variant_builder_add (&builder, "{s@v}", "depth",
|
||||
g_variant_new_variant (g_variant_new_int32 (0)));
|
||||
|
||||
options = g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||
pull_options = g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||
res = ostree_repo_pull_with_options (dst_repo, src_repo_uri,
|
||||
options,
|
||||
pull_options,
|
||||
progress,
|
||||
cancellable, error);
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ print_history (GPtrArray *dirs,
|
||||
#endif
|
||||
|
||||
static GDateTime *
|
||||
parse_time (const char *opt_since)
|
||||
parse_time (const char *since_opt)
|
||||
{
|
||||
g_autoptr(GDateTime) now = NULL;
|
||||
g_auto(GStrv) parts = NULL;
|
||||
@@ -392,12 +392,12 @@ parse_time (const char *opt_since)
|
||||
tm.tm_min = 0;
|
||||
tm.tm_sec = 0;
|
||||
|
||||
rest = strptime (opt_since, fmts[i], &tm);
|
||||
rest = strptime (since_opt, fmts[i], &tm);
|
||||
if (rest && *rest == '\0')
|
||||
return g_date_time_new_local (tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
|
||||
}
|
||||
|
||||
parts = g_strsplit (opt_since, " ", -1);
|
||||
parts = g_strsplit (since_opt, " ", -1);
|
||||
|
||||
for (i = 0; parts[i]; i++)
|
||||
{
|
||||
|
||||
@@ -194,10 +194,10 @@ flatpak_complete_permission_set (FlatpakCompletion *completion)
|
||||
flatpak_complete_options (completion, options);
|
||||
|
||||
{
|
||||
const char **tables = get_known_permission_tables ();
|
||||
for (i = 0; tables != NULL && tables[i] != NULL; i++)
|
||||
const char **known_tables = get_known_permission_tables ();
|
||||
for (i = 0; known_tables != NULL && known_tables[i] != NULL; i++)
|
||||
{
|
||||
flatpak_complete_word (completion, "%s ", tables[i]);
|
||||
flatpak_complete_word (completion, "%s ", known_tables[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -118,14 +118,14 @@ uninstall_dir_ensure (GHashTable *uninstall_dirs,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
flatpak_delete_data (gboolean opt_yes,
|
||||
flatpak_delete_data (gboolean yes_opt,
|
||||
const char *app_id,
|
||||
GError **error)
|
||||
{
|
||||
g_autofree char *path = g_build_filename (g_get_home_dir (), ".var", "app", app_id, NULL);
|
||||
g_autoptr(GFile) file = g_file_new_for_path (path);
|
||||
|
||||
if (!opt_yes &&
|
||||
if (!yes_opt &&
|
||||
!flatpak_yes_no_prompt (FALSE, _("Delete data for %s?"), app_id))
|
||||
return TRUE;
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ no_message_handler (const char *log_domain,
|
||||
}
|
||||
|
||||
static GOptionContext *
|
||||
flatpak_option_context_new_with_commands (FlatpakCommand *commands)
|
||||
flatpak_option_context_new_with_commands (FlatpakCommand *f_commands)
|
||||
{
|
||||
GOptionContext *context;
|
||||
GString *summary;
|
||||
@@ -203,25 +203,25 @@ flatpak_option_context_new_with_commands (FlatpakCommand *commands)
|
||||
|
||||
summary = g_string_new (_("Builtin Commands:"));
|
||||
|
||||
while (commands->name != NULL)
|
||||
while (f_commands->name != NULL)
|
||||
{
|
||||
if (!commands->deprecated)
|
||||
if (!f_commands->deprecated)
|
||||
{
|
||||
if (commands->fn != NULL)
|
||||
if (f_commands->fn != NULL)
|
||||
{
|
||||
g_string_append_printf (summary, "\n %s", commands->name);
|
||||
g_string_append_printf (summary, "\n %s", f_commands->name);
|
||||
/* Note: the 23 is there to align command descriptions with
|
||||
* the option descriptions produced by GOptionContext.
|
||||
*/
|
||||
if (commands->description)
|
||||
g_string_append_printf (summary, "%*s%s", (int) (23 - strlen (commands->name)), "", _(commands->description));
|
||||
if (f_commands->description)
|
||||
g_string_append_printf (summary, "%*s%s", (int) (23 - strlen (f_commands->name)), "", _(f_commands->description));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append_printf (summary, "\n%s", _(commands->name));
|
||||
g_string_append_printf (summary, "\n%s", _(f_commands->name));
|
||||
}
|
||||
}
|
||||
commands++;
|
||||
f_commands++;
|
||||
}
|
||||
|
||||
g_option_context_set_summary (context, summary->str);
|
||||
|
||||
Reference in New Issue
Block a user