Avoid shadowing local variables
This should help with code readability. Fixes https://github.com/ostreedev/ostree/issues/2194
This commit is contained in:
1 parent
9c040c1a73
commit
c4f26bfdc8
21 files changed
+93
-94
No files matched your search
@@ -93,16 +93,16 @@ main (int argc, char **argv)
|
||||
|
||||
g_ptr_array_add (refs, NULL); /* NULL terminator */
|
||||
|
||||
g_autoptr(GAsyncResult) result = NULL;
|
||||
g_autoptr(GAsyncResult) async_result = NULL;
|
||||
ostree_repo_finder_resolve_async (OSTREE_REPO_FINDER (finder),
|
||||
(const OstreeCollectionRef * const *) refs->pdata,
|
||||
parent_repo, NULL, result_cb, &result);
|
||||
parent_repo, NULL, result_cb, &async_result);
|
||||
|
||||
while (result == NULL)
|
||||
while (async_result == NULL)
|
||||
g_main_context_iteration (context, TRUE);
|
||||
|
||||
g_autoptr(GPtrArray) results = ostree_repo_finder_resolve_finish (OSTREE_REPO_FINDER (finder),
|
||||
result, &error);
|
||||
async_result, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
/* Check that the results are correct: the invalid refs should have been
|
||||
|
||||
@@ -230,7 +230,7 @@ test_repo_finder_config_mixed_configs (Fixture *fixture,
|
||||
{
|
||||
g_autoptr(OstreeRepoFinderConfig) finder = NULL;
|
||||
g_autoptr(GMainContext) context = NULL;
|
||||
g_autoptr(GAsyncResult) result = NULL;
|
||||
g_autoptr(GAsyncResult) async_result = NULL;
|
||||
g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */
|
||||
g_autoptr(GError) error = NULL;
|
||||
gsize i;
|
||||
@@ -266,13 +266,13 @@ test_repo_finder_config_mixed_configs (Fixture *fixture,
|
||||
|
||||
/* Resolve the refs. */
|
||||
ostree_repo_finder_resolve_async (OSTREE_REPO_FINDER (finder), refs,
|
||||
fixture->parent_repo, NULL, result_cb, &result);
|
||||
fixture->parent_repo, NULL, result_cb, &async_result);
|
||||
|
||||
while (result == NULL)
|
||||
while (async_result == NULL)
|
||||
g_main_context_iteration (context, TRUE);
|
||||
|
||||
results = ostree_repo_finder_resolve_finish (OSTREE_REPO_FINDER (finder),
|
||||
result, &error);
|
||||
async_result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_nonnull (results);
|
||||
g_assert_cmpuint (results->len, ==, 3);
|
||||
|
||||
@@ -317,7 +317,7 @@ test_repo_finder_mount_mixed_mounts (Fixture *fixture,
|
||||
g_autoptr(OstreeRepoFinderMount) finder = NULL;
|
||||
g_autoptr(GVolumeMonitor) monitor = NULL;
|
||||
g_autoptr(GMainContext) context = NULL;
|
||||
g_autoptr(GAsyncResult) result = NULL;
|
||||
g_autoptr(GAsyncResult) async_result = NULL;
|
||||
g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GList) mounts = NULL; /* (element-type OstreeMockMount) */
|
||||
@@ -395,13 +395,13 @@ test_repo_finder_mount_mixed_mounts (Fixture *fixture,
|
||||
/* Resolve the refs. */
|
||||
ostree_repo_finder_resolve_async (OSTREE_REPO_FINDER (finder), refs,
|
||||
fixture->parent_repo,
|
||||
NULL, result_cb, &result);
|
||||
NULL, result_cb, &async_result);
|
||||
|
||||
while (result == NULL)
|
||||
while (async_result == NULL)
|
||||
g_main_context_iteration (context, TRUE);
|
||||
|
||||
results = ostree_repo_finder_resolve_finish (OSTREE_REPO_FINDER (finder),
|
||||
result, &error);
|
||||
async_result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_nonnull (results);
|
||||
g_assert_cmpuint (results->len, ==, 4);
|
||||
@@ -466,7 +466,7 @@ test_repo_finder_mount_well_known (Fixture *fixture,
|
||||
g_autoptr(OstreeRepoFinderMount) finder = NULL;
|
||||
g_autoptr(GVolumeMonitor) monitor = NULL;
|
||||
g_autoptr(GMainContext) context = NULL;
|
||||
g_autoptr(GAsyncResult) result = NULL;
|
||||
g_autoptr(GAsyncResult) async_result = NULL;
|
||||
g_autoptr(GPtrArray) results = NULL; /* (element-type OstreeRepoFinderResult) */
|
||||
g_autoptr(GError) error = NULL;
|
||||
g_autoptr(GList) mounts = NULL; /* (element-type OstreeMockMount) */
|
||||
@@ -507,13 +507,13 @@ test_repo_finder_mount_well_known (Fixture *fixture,
|
||||
/* Resolve the refs. */
|
||||
ostree_repo_finder_resolve_async (OSTREE_REPO_FINDER (finder), refs,
|
||||
fixture->parent_repo,
|
||||
NULL, result_cb, &result);
|
||||
NULL, result_cb, &async_result);
|
||||
|
||||
while (result == NULL)
|
||||
while (async_result == NULL)
|
||||
g_main_context_iteration (context, TRUE);
|
||||
|
||||
results = ostree_repo_finder_resolve_finish (OSTREE_REPO_FINDER (finder),
|
||||
result, &error);
|
||||
async_result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_nonnull (results);
|
||||
g_assert_cmpuint (results->len, ==, 2);
|
||||
|
||||
Reference in new issue
Block a user