Skip to content

Commit

Permalink
trivial: autoformat
Browse files Browse the repository at this point in the history
This is all just churn from clang-format updates... Slightly annoying.
  • Loading branch information
ximion committed Dec 8, 2024
1 parent c6903ab commit 615b411
Show file tree
Hide file tree
Showing 30 changed files with 302 additions and 291 deletions.
11 changes: 6 additions & 5 deletions compose/asc-compose.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ asc_compose_process_task_cb (AscComposeTask *ctask, AscCompose *compose)
} /* end launch entry loop */
}
} /* end of desktop-entry support */
} /* end of metadata parsing loop */
} /* end of metadata parsing loop */

/* process the remaining .desktop files */
if (as_flags_contains (priv->flags, ASC_COMPOSE_FLAG_PROCESS_UNPAIRED_DESKTOP)) {
Expand Down Expand Up @@ -2182,10 +2182,11 @@ asc_compose_run (AscCompose *compose, GCancellable *cancellable, GError **error)

if (as_flags_contains (priv->flags, ASC_COMPOSE_FLAG_NO_PARTIAL_URLS) &&
priv->media_baseurl == NULL) {
g_set_error_literal (error,
ASC_COMPOSE_ERROR,
ASC_COMPOSE_ERROR_FAILED,
_("Partial URLs are not allowed, but no base URL is set to create full URLs."));
g_set_error_literal (
error,
ASC_COMPOSE_ERROR,
ASC_COMPOSE_ERROR_FAILED,
_("Partial URLs are not allowed, but no base URL is set to create full URLs."));
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion compose/asc-hint-tags.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ typedef struct {

extern AscHintTagStatic asc_hint_tag_list[];

#pragma GCC visibility pop
#pragma GCC visibility pop
G_END_DECLS
6 changes: 3 additions & 3 deletions compose/asc-utils-fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ struct {
gint width;
gint height;
} font_screenshot_sizes[] = {
{1024, 78},
{ 640, 48},
{ 0, 0 }
{ 1024, 78 },
{ 640, 48 },
{ 0, 0 }
};

/**
Expand Down
16 changes: 8 additions & 8 deletions compose/asc-utils-screenshots.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ struct {
gint width;
gint height;
} target_screenshot_sizes[] = {
{1248, 702},
{ 752, 423},
{ 624, 351},
{ 224, 126},
{ 0, 0 }
{ 1248, 702 },
{ 752, 423 },
{ 624, 351 },
{ 224, 126 },
{ 0, 0 }
};

static AscVideoInfo *
Expand Down Expand Up @@ -713,9 +713,9 @@ asc_process_screenshot_images (AscResult *cres,
GHashTableIter ht_iter;
gpointer ht_key, ht_value;
g_autoptr(GHashTable) ht_lang_img = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
g_object_unref);
g_str_equal,
g_free,
g_object_unref);

imgs = as_screenshot_get_images_all (scr);
if (imgs->len == 0) {
Expand Down
20 changes: 15 additions & 5 deletions qt/branding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,30 @@ QString Branding::colorSchemeToString(ColorSchemeKind colorScheme)

Branding::ColorSchemeKind Branding::colorSchemefromString(const QString &string)
{
return static_cast<Branding::ColorSchemeKind>(as_color_scheme_kind_from_string(qPrintable(string)));
return static_cast<Branding::ColorSchemeKind>(
as_color_scheme_kind_from_string(qPrintable(string)));
}

void Branding::setColor(Branding::ColorKind kind, Branding::ColorSchemeKind scheme, const QString &color)
void Branding::setColor(Branding::ColorKind kind,
Branding::ColorSchemeKind scheme,
const QString &color)
{
as_branding_set_color(d->brandingp, static_cast<AsColorKind>(kind), static_cast<AsColorSchemeKind>(scheme), qPrintable(color));
as_branding_set_color(d->brandingp,
static_cast<AsColorKind>(kind),
static_cast<AsColorSchemeKind>(scheme),
qPrintable(color));
}

void Branding::removeColor(Branding::ColorKind kind, Branding::ColorSchemeKind scheme)
{
as_branding_remove_color(d->brandingp, static_cast<AsColorKind>(kind), static_cast<AsColorSchemeKind>(scheme));
as_branding_remove_color(d->brandingp,
static_cast<AsColorKind>(kind),
static_cast<AsColorSchemeKind>(scheme));
}

QString Branding::color(Branding::ColorKind kind, Branding::ColorSchemeKind scheme)
{
return valueWrap(as_branding_get_color(d->brandingp, static_cast<AsColorKind>(kind), static_cast<AsColorSchemeKind>(scheme)));
return valueWrap(as_branding_get_color(d->brandingp,
static_cast<AsColorKind>(kind),
static_cast<AsColorSchemeKind>(scheme)));
}
4 changes: 2 additions & 2 deletions src/as-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,8 +1968,8 @@ as_cache_search (AsCache *cache, const gchar *const *terms, gboolean sort, GErro
for (guint j = 0; queries[j].xpath != NULL; j++) {
g_autoptr(GError) error_query = NULL;
g_autoptr(XbQuery) query = xb_query_new (csec->silo,
queries[j].xpath,
&error_query);
queries[j].xpath,
&error_query);
if (query != NULL) {
AsFTSearchHelper *helper = g_new0 (AsFTSearchHelper, 1);
helper->match_value = queries[j].match_value;
Expand Down
4 changes: 2 additions & 2 deletions src/as-component.c
Original file line number Diff line number Diff line change
Expand Up @@ -5190,7 +5190,7 @@ as_component_to_xml_node (AsComponent *cpt, AsContext *ctx, xmlNode *root)
for (guint i = 0; i < priv->tags->len; i++) {
xmlNode *tag_node = NULL;
g_auto(GStrv)
parts = g_strsplit (g_ptr_array_index (priv->tags, i), "::", 2);
parts = g_strsplit (g_ptr_array_index (priv->tags, i), "::", 2);
tag_node = as_xml_add_text_node (tags_node, "tag", parts[1]);
if (!as_is_empty (parts[0]))
as_xml_add_text_prop (tag_node, "namespace", parts[0]);
Expand Down Expand Up @@ -6412,7 +6412,7 @@ as_component_emit_yaml (AsComponent *cpt, AsContext *ctx, yaml_emitter_t *emitte

for (guint i = 0; i < priv->tags->len; i++) {
g_auto(GStrv)
parts = g_strsplit (g_ptr_array_index (priv->tags, i), "::", 2);
parts = g_strsplit (g_ptr_array_index (priv->tags, i), "::", 2);

as_yaml_mapping_start (emitter);
if (!as_is_empty (parts[0]))
Expand Down
20 changes: 10 additions & 10 deletions src/as-content-rating-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ gboolean as_content_rating_load_from_xml (AsContentRating *content_rating,
GError **error);
void as_content_rating_to_xml_node (AsContentRating *content_rating, AsContext *ctx, xmlNode *root);

gboolean as_content_rating_load_from_yaml (AsContentRating *content_rating,
AsContext *ctx,
GNode *node,
GError **error);
void as_content_rating_emit_yaml (AsContentRating *content_rating,
AsContext *ctx,
yaml_emitter_t *emitter);
gboolean as_content_rating_load_from_yaml (AsContentRating *content_rating,
AsContext *ctx,
GNode *node,
GError **error);
void as_content_rating_emit_yaml (AsContentRating *content_rating,
AsContext *ctx,
yaml_emitter_t *emitter);

gboolean as_is_oars_key (const gchar *id, AsOarsVersion version);
gboolean as_is_oars_key (const gchar *id, AsOarsVersion version);

AsOarsVersion as_oars_version_from_string (const gchar *value);
AsOarsVersion as_oars_version_from_string (const gchar *value);

gboolean as_content_rating_id_is_valid (const gchar *id, AsContentRatingValue value);
gboolean as_content_rating_id_is_valid (const gchar *id, AsContentRatingValue value);

#pragma GCC visibility pop
G_END_DECLS
Expand Down
60 changes: 30 additions & 30 deletions src/as-content-rating.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ static const gchar *content_rating_strings[AS_CONTENT_RATING_SYSTEM_LAST][7] = {
[AS_CONTENT_RATING_SYSTEM_RUSSIA] = { "0+", "6+", "12+", "16+", "18+", NULL },
[AS_CONTENT_RATING_SYSTEM_MDA] = { "General", "ADV", "M18", NULL },
[AS_CONTENT_RATING_SYSTEM_GRAC] = { "ALL", "12", "15", "18", NULL },
/* Note: ESRB has locale-specific suffixes, so needs special further
/* Note: ESRB has locale-specific suffixes, so needs special further
* handling in code. These strings are just the locale-independent parts. */
[AS_CONTENT_RATING_SYSTEM_ESRB] = { "Early Childhood",
"Everyone", "Everyone 10+",
Expand Down Expand Up @@ -1204,35 +1204,35 @@ static const struct {
/* Each @id must only appear once. The set of @csm_age_* values for a
* given @id must be complete and non-decreasing. */
/* v1.0 */
{"violence-cartoon", AS_OARS_VERSION_1_0, 0, 3, 4, 6 },
{ "violence-fantasy", AS_OARS_VERSION_1_0, 0, 3, 7, 8 },
{ "violence-realistic", AS_OARS_VERSION_1_0, 0, 4, 9, 14},
{ "violence-bloodshed", AS_OARS_VERSION_1_0, 0, 9, 11, 18},
{ "violence-sexual", AS_OARS_VERSION_1_0, 0, 18, 18, 18},
{ "drugs-alcohol", AS_OARS_VERSION_1_0, 0, 11, 13, 16},
{ "drugs-narcotics", AS_OARS_VERSION_1_0, 0, 12, 14, 17},
{ "drugs-tobacco", AS_OARS_VERSION_1_0, 0, 10, 13, 13},
{ "sex-nudity", AS_OARS_VERSION_1_0, 0, 12, 14, 14},
{ "sex-themes", AS_OARS_VERSION_1_0, 0, 13, 14, 15},
{ "language-profanity", AS_OARS_VERSION_1_0, 0, 8, 11, 14},
{ "language-humor", AS_OARS_VERSION_1_0, 0, 3, 8, 14},
{ "language-discrimination", AS_OARS_VERSION_1_0, 0, 9, 10, 11},
{ "money-advertising", AS_OARS_VERSION_1_0, 0, 7, 8, 10},
{ "money-gambling", AS_OARS_VERSION_1_0, 0, 7, 10, 18},
{ "money-purchasing", AS_OARS_VERSION_1_0, 0, 12, 14, 15},
{ "social-chat", AS_OARS_VERSION_1_0, 0, 4, 10, 13},
{ "social-audio", AS_OARS_VERSION_1_0, 0, 15, 15, 15},
{ "social-contacts", AS_OARS_VERSION_1_0, 0, 12, 12, 12},
{ "social-info", AS_OARS_VERSION_1_0, 0, 0, 13, 13},
{ "social-location", AS_OARS_VERSION_1_0, 0, 13, 13, 13},
/* v1.1 additions */
{ "sex-homosexuality", AS_OARS_VERSION_1_1, 0, 13, 14, 15},
{ "sex-prostitution", AS_OARS_VERSION_1_1, 0, 12, 14, 18},
{ "sex-adultery", AS_OARS_VERSION_1_1, 0, 8, 10, 18},
{ "sex-appearance", AS_OARS_VERSION_1_1, 0, 10, 10, 15},
{ "violence-worship", AS_OARS_VERSION_1_1, 0, 13, 15, 18},
{ "violence-desecration", AS_OARS_VERSION_1_1, 0, 13, 15, 18},
{ "violence-slavery", AS_OARS_VERSION_1_1, 0, 13, 15, 18},
{ "violence-cartoon", AS_OARS_VERSION_1_0, 0, 3, 4, 6 },
{ "violence-fantasy", AS_OARS_VERSION_1_0, 0, 3, 7, 8 },
{ "violence-realistic", AS_OARS_VERSION_1_0, 0, 4, 9, 14 },
{ "violence-bloodshed", AS_OARS_VERSION_1_0, 0, 9, 11, 18 },
{ "violence-sexual", AS_OARS_VERSION_1_0, 0, 18, 18, 18 },
{ "drugs-alcohol", AS_OARS_VERSION_1_0, 0, 11, 13, 16 },
{ "drugs-narcotics", AS_OARS_VERSION_1_0, 0, 12, 14, 17 },
{ "drugs-tobacco", AS_OARS_VERSION_1_0, 0, 10, 13, 13 },
{ "sex-nudity", AS_OARS_VERSION_1_0, 0, 12, 14, 14 },
{ "sex-themes", AS_OARS_VERSION_1_0, 0, 13, 14, 15 },
{ "language-profanity", AS_OARS_VERSION_1_0, 0, 8, 11, 14 },
{ "language-humor", AS_OARS_VERSION_1_0, 0, 3, 8, 14 },
{ "language-discrimination", AS_OARS_VERSION_1_0, 0, 9, 10, 11 },
{ "money-advertising", AS_OARS_VERSION_1_0, 0, 7, 8, 10 },
{ "money-gambling", AS_OARS_VERSION_1_0, 0, 7, 10, 18 },
{ "money-purchasing", AS_OARS_VERSION_1_0, 0, 12, 14, 15 },
{ "social-chat", AS_OARS_VERSION_1_0, 0, 4, 10, 13 },
{ "social-audio", AS_OARS_VERSION_1_0, 0, 15, 15, 15 },
{ "social-contacts", AS_OARS_VERSION_1_0, 0, 12, 12, 12 },
{ "social-info", AS_OARS_VERSION_1_0, 0, 0, 13, 13 },
{ "social-location", AS_OARS_VERSION_1_0, 0, 13, 13, 13 },
/* v1.1 additions */
{ "sex-homosexuality", AS_OARS_VERSION_1_1, 0, 13, 14, 15 },
{ "sex-prostitution", AS_OARS_VERSION_1_1, 0, 12, 14, 18 },
{ "sex-adultery", AS_OARS_VERSION_1_1, 0, 8, 10, 18 },
{ "sex-appearance", AS_OARS_VERSION_1_1, 0, 10, 10, 15 },
{ "violence-worship", AS_OARS_VERSION_1_1, 0, 13, 15, 18 },
{ "violence-desecration", AS_OARS_VERSION_1_1, 0, 13, 15, 18 },
{ "violence-slavery", AS_OARS_VERSION_1_1, 0, 13, 15, 18 },
};

/**
Expand Down
36 changes: 18 additions & 18 deletions src/as-desktop-entry.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ typedef GPtrArray *(*AsTranslateDesktopTextFn) (const GKeyFile *de,
gpointer user_data);

AS_INTERNAL_VISIBLE
gboolean as_desktop_entry_parse_data (AsComponent *cpt,
const gchar *data,
gssize data_len,
AsFormatVersion fversion,
gboolean ignore_nodisplay,
GPtrArray *issues,
AsTranslateDesktopTextFn de_l10n_fn,
gpointer user_data,
GError **error);

gboolean as_desktop_entry_parse_file (AsComponent *cpt,
GFile *file,
AsFormatVersion fversion,
gboolean ignore_nodisplay,
GPtrArray *issues,
AsTranslateDesktopTextFn de_l10n_fn,
gpointer user_data,
GError **error);
gboolean as_desktop_entry_parse_data (AsComponent *cpt,
const gchar *data,
gssize data_len,
AsFormatVersion fversion,
gboolean ignore_nodisplay,
GPtrArray *issues,
AsTranslateDesktopTextFn de_l10n_fn,
gpointer user_data,
GError **error);

gboolean as_desktop_entry_parse_file (AsComponent *cpt,
GFile *file,
AsFormatVersion fversion,
gboolean ignore_nodisplay,
GPtrArray *issues,
AsTranslateDesktopTextFn de_l10n_fn,
gpointer user_data,
GError **error);

#pragma GCC visibility pop
G_END_DECLS
Expand Down
2 changes: 1 addition & 1 deletion src/as-macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ G_BEGIN_DECLS
do { \
((bitfield) ^= flag); \
} while (0)
#define as_flags_contains(bitfield, flag) (((bitfield) &flag) > 0)
#define as_flags_contains(bitfield, flag) (((bitfield) & flag) > 0)

G_END_DECLS

Expand Down
2 changes: 1 addition & 1 deletion src/as-news-convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ as_news_yaml_to_releases (const gchar *yaml_data, gint limit, GError **error)
} else {
/* we only have one list entry, or no list at all and a freeform text instead. Convert to paragraphs */
g_auto(GStrv)
paras = g_strsplit (value, "\n\n", -1);
paras = g_strsplit (value, "\n\n", -1);
for (guint i = 0; paras[i] != NULL; i++) {
g_auto(GStrv) lines = NULL;
gboolean in_listing = FALSE;
Expand Down
Loading

0 comments on commit 615b411

Please sign in to comment.