Skip to content

Commit

Permalink
Run uncrustify
Browse files Browse the repository at this point in the history
Closes: #1870
Approved by: alexlarsson
  • Loading branch information
alexlarsson authored and rh-atomic-bot committed Jul 8, 2018
1 parent c97b1d5 commit 3f4518b
Show file tree
Hide file tree
Showing 81 changed files with 3,745 additions and 3,456 deletions.
4 changes: 2 additions & 2 deletions app/flatpak-builtins-add-remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ get_config_from_opts (FlatpakDir *dir, const char *remote_name, gboolean *change

static void
load_options (const char *filename,
GBytes **gpg_data)
GBytes **gpg_data)
{
g_autoptr(GError) error = NULL;
g_autoptr(GKeyFile) keyfile = g_key_file_new ();
Expand Down Expand Up @@ -349,7 +349,7 @@ flatpak_builtin_add_remote (int argc, char **argv,
if (remotes == NULL)
return FALSE;

if (g_strv_contains ((const char **)remotes, remote_name))
if (g_strv_contains ((const char **) remotes, remote_name))
{
if (opt_if_not_exists)
return TRUE; /* Do nothing */
Expand Down
12 changes: 6 additions & 6 deletions app/flatpak-builtins-build-bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ typedef void (*IterateBundleIconsCallback) (const char *icon_size_name,
gpointer user_data);

static gboolean
iterate_bundle_icons (GFile *root,
const char *name,
IterateBundleIconsCallback callback,
gpointer user_data,
GCancellable *cancellable,
GError **error)
iterate_bundle_icons (GFile *root,
const char *name,
IterateBundleIconsCallback callback,
gpointer user_data,
GCancellable *cancellable,
GError **error)
{
g_autoptr(GFile) icons_dir =
g_file_resolve_relative_path (root,
Expand Down
23 changes: 12 additions & 11 deletions app/flatpak-builtins-build-commit-from.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ _ostree_get_relative_static_delta_path (const char *from,

static GVariant *
new_bytearray (const guchar *data,
gsize len)
gsize len)
{
gpointer data_copy = g_memdup (data, len);
GVariant *ret = g_variant_new_from_data (G_VARIANT_TYPE ("ay"), data_copy,
len, FALSE, g_free, data_copy);

return ret;
}

Expand All @@ -127,9 +128,9 @@ rewrite_delta (OstreeRepo *src_repo,
const char *src_commit,
OstreeRepo *dst_repo,
const char *dst_commit,
GVariant *dst_commitv,
GVariant *dst_commitv,
const char *from,
GError **error)
GError **error)
{
g_autoptr(GFile) src_delta_file = NULL;
g_autoptr(GFile) dst_delta_file = NULL;
Expand Down Expand Up @@ -178,7 +179,7 @@ rewrite_delta (OstreeRepo *src_repo,

g_variant_builder_add_value (&superblock_builder, g_variant_dict_end (&dst_metadata_dict));
g_variant_builder_add_value (&superblock_builder, g_variant_get_child_value (src_superblock, 1)); /* timestamp */
g_variant_builder_add_value (&superblock_builder, from ? ostree_checksum_to_bytes_v (from) : new_bytearray ((guchar *)"", 0));
g_variant_builder_add_value (&superblock_builder, from ? ostree_checksum_to_bytes_v (from) : new_bytearray ((guchar *) "", 0));
g_variant_builder_add_value (&superblock_builder, ostree_checksum_to_bytes_v (dst_commit));
g_variant_builder_add_value (&superblock_builder, dst_commitv);
g_variant_builder_add_value (&superblock_builder, src_recurse);
Expand Down Expand Up @@ -244,7 +245,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella

dst_repo_arg = argv[1];

dst_refs = (const char **)argv + 2;
dst_refs = (const char **) argv + 2;
n_dst_refs = argc - 2;

if (opt_src_repo == NULL && n_dst_refs != 1)
Expand Down Expand Up @@ -304,7 +305,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
cancellable, error))
return FALSE;

keys = (const char **)g_hash_table_get_keys_as_array (all_src_refs, NULL);
keys = (const char **) g_hash_table_get_keys_as_array (all_src_refs, NULL);

for (i = 0; keys[i] != NULL; i++)
{
Expand All @@ -313,7 +314,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
g_ptr_array_add (src_refs, g_strdup (keys[i]));
}
n_dst_refs = src_refs->len;
dst_refs = (const char **)src_refs->pdata;
dst_refs = (const char **) src_refs->pdata;
}
else
{
Expand Down Expand Up @@ -353,7 +354,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
g_variant_builder_add (&builder, "{s@v}", "flags",
g_variant_new_variant (g_variant_new_int32 (pullflags)));
g_variant_builder_add (&builder, "{s@v}", "refs",
g_variant_new_variant (g_variant_new_strv ((const char *const*) resolved_src_refs->pdata,
g_variant_new_variant (g_variant_new_strv ((const char * const *) resolved_src_refs->pdata,
resolved_src_refs->len)));
g_variant_builder_add (&builder, "{s@v}", "depth",
g_variant_new_variant (g_variant_new_int32 (0)));
Expand All @@ -380,7 +381,7 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella
if (transaction == NULL)
return FALSE;

for (i = 0; i < resolved_src_refs->len; i ++)
for (i = 0; i < resolved_src_refs->len; i++)
{
const char *dst_ref = dst_refs[i];
const char *resolved_ref = g_ptr_array_index (resolved_src_refs, i);
Expand Down Expand Up @@ -434,10 +435,10 @@ flatpak_builtin_build_commit_from (int argc, char **argv, GCancellable *cancella

g_variant_get_child (src_commitv, 3, "s", &subject);
if (opt_subject)
subject = (const char *)opt_subject;
subject = (const char *) opt_subject;
g_variant_get_child (src_commitv, 4, "s", &body);
if (opt_body)
body = (const char *)opt_body;
body = (const char *) opt_body;

dst_collection_id = ostree_repo_get_collection_id (dst_repo);

Expand Down
69 changes: 37 additions & 32 deletions app/flatpak-builtins-build-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ commit_filter (OstreeRepo *repo,
* case. So, we canonicalize the mode to writable only by the user,
* readable to all, and executable for all for directories and
* files that the user can execute.
*/
*/
mode = g_file_info_get_attribute_uint32 (file_info, "unix::mode");
if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY)
mode = 0755 | S_IFDIR;
Expand Down Expand Up @@ -266,26 +266,28 @@ find_file_in_tree (GFile *base, const char *filename)
if (!enumerator)
return FALSE;

do {
g_autoptr(GFileInfo) info = g_file_enumerator_next_file (enumerator, NULL, NULL);
GFileType type;
const char *name;
do
{
g_autoptr(GFileInfo) info = g_file_enumerator_next_file (enumerator, NULL, NULL);
GFileType type;
const char *name;

if (!info)
return FALSE;
if (!info)
return FALSE;

type = g_file_info_get_file_type (info);
name = g_file_info_get_name (info);
type = g_file_info_get_file_type (info);
name = g_file_info_get_name (info);

if (type == G_FILE_TYPE_REGULAR && strcmp (name, filename) == 0)
return TRUE;
else if (type == G_FILE_TYPE_DIRECTORY)
{
g_autoptr(GFile) dir = g_file_get_child (base, name);
if (find_file_in_tree (dir, filename))
return TRUE;
}
} while (1);
if (type == G_FILE_TYPE_REGULAR && strcmp (name, filename) == 0)
return TRUE;
else if (type == G_FILE_TYPE_DIRECTORY)
{
g_autoptr(GFile) dir = g_file_get_child (base, name);
if (find_file_in_tree (dir, filename))
return TRUE;
}
}
while (1);

return FALSE;
}
Expand All @@ -309,15 +311,16 @@ convert_app_absolute_path (const char *path, GFile *files)
}

static gboolean
validate_desktop_file (GFile *desktop_file,
GFile *export,
GFile *files,
validate_desktop_file (GFile *desktop_file,
GFile *export,
GFile *files,
const char *app_id,
char **icon,
gboolean *activatable,
GError **error)
char **icon,
gboolean *activatable,
GError **error)
{
g_autofree char *path = g_file_get_path (desktop_file);

g_autoptr(GSubprocess) subprocess = NULL;
g_autofree char *stdout_buf = NULL;
g_autofree char *stderr_buf = NULL;
Expand Down Expand Up @@ -393,9 +396,9 @@ validate_desktop_file (GFile *desktop_file,

static gboolean
validate_icon (const char *icon,
GFile *export,
GFile *export,
const char *app_id,
GError **error)
GError **error)
{
g_autoptr(GFile) icondir = NULL;
g_autofree char *png = NULL;
Expand All @@ -415,13 +418,14 @@ validate_icon (const char *icon,
}

static gboolean
validate_service_file (GFile *service_file,
gboolean activatable,
GFile *files,
validate_service_file (GFile *service_file,
gboolean activatable,
GFile *files,
const char *app_id,
GError **error)
GError **error)
{
g_autofree char *path = g_file_get_path (service_file);

g_autoptr(GKeyFile) key_file = NULL;
g_autofree char *name = NULL;
g_autofree char *command = NULL;
Expand Down Expand Up @@ -480,6 +484,7 @@ static gboolean
validate_exports (GFile *export, GFile *files, const char *app_id, GError **error)
{
g_autofree char *desktop_path = NULL;

g_autoptr(GFile) desktop_file = NULL;
g_autofree char *service_path = NULL;
g_autoptr(GFile) service_file = NULL;
Expand Down Expand Up @@ -654,7 +659,7 @@ flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable,
g_autoptr(GVariant) metadata_dict_v = NULL;
gboolean is_runtime = FALSE;
gboolean is_extension = FALSE;
guint64 installed_size = 0,download_size = 0;
guint64 installed_size = 0, download_size = 0;
struct timespec ts;
const char *collection_id;

Expand Down Expand Up @@ -769,7 +774,7 @@ flatpak_builtin_build_export (int argc, char **argv, GCancellable *cancellable,
body = g_strdup_printf ("Name: %s\n"
"Arch: %s\n"
"Branch: %s\n"
"Built with: "PACKAGE_STRING"\n",
"Built with: "PACKAGE_STRING "\n",
id, arch, branch);

full_branch = g_strconcat ((opt_runtime || is_runtime) ? "runtime/" : "app/", id, "/", arch, "/", branch, NULL);
Expand Down
36 changes: 18 additions & 18 deletions app/flatpak-builtins-build-finish.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,16 @@ static GOptionEntry options[] = {
};

static gboolean
export_dir (int source_parent_fd,
const char *source_name,
const char *source_relpath,
int destination_parent_fd,
const char *destination_name,
char **allowed_prefixes,
char **allowed_extensions,
gboolean require_exact_match,
GCancellable *cancellable,
GError **error)
export_dir (int source_parent_fd,
const char *source_name,
const char *source_relpath,
int destination_parent_fd,
const char *destination_name,
char **allowed_prefixes,
char **allowed_extensions,
gboolean require_exact_match,
GCancellable *cancellable,
GError **error)
{
int res;

Expand Down Expand Up @@ -196,14 +196,14 @@ export_dir (int source_parent_fd,
}

static gboolean
copy_exports (GFile *source,
GFile *destination,
const char *source_prefix,
char **allowed_prefixes,
char **allowed_extensions,
gboolean require_exact_match,
GCancellable *cancellable,
GError **error)
copy_exports (GFile *source,
GFile *destination,
const char *source_prefix,
char **allowed_prefixes,
char **allowed_extensions,
gboolean require_exact_match,
GCancellable *cancellable,
GError **error)
{
if (!flatpak_mkdir_p (destination, cancellable, error))
return FALSE;
Expand Down
1 change: 1 addition & 0 deletions app/flatpak-builtins-build-import-bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ import_oci (OstreeRepo *repo, GFile *file,
g_autofree char *dir_uri = NULL;
g_autofree char *target_ref = NULL;
const char *oci_digest;

g_autoptr(FlatpakOciRegistry) registry = NULL;
g_autoptr(FlatpakOciVersioned) versioned = NULL;
FlatpakOciManifest *manifest = NULL;
Expand Down
2 changes: 1 addition & 1 deletion app/flatpak-builtins-build-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static GOptionEntry options[] = {

static gboolean
ensure_extensions (FlatpakDeploy *src_deploy, const char *default_branch,
char *src_extensions[], GFile *top_dir, GCancellable *cancellable, GError **error)
char *src_extensions[], GFile *top_dir, GCancellable *cancellable, GError **error)
{
g_autoptr(GKeyFile) metakey = flatpak_deploy_get_metadata (src_deploy);
GList *extensions = NULL, *l;
Expand Down

0 comments on commit 3f4518b

Please sign in to comment.